Connect your own GSM & run two-way AI calls

Follow this guide top to bottom. When you finish, you can dial any mobile number from the dashboard, the call goes out over your own SIM cards, and the AI agent talks with the person on the other end in real time — both directions.

⬇ Download setup bundle (.tar.gz) Open the portal

How it works

You run a small edge box (a cheap Ubuntu machine or VM) on the same local network as your Dinstar GSM gateway. The edge box dials a secure WireGuard tunnel out to our server — so nothing on your network is ever exposed to the internet. Over that tunnel we place calls through your SIMs and stream the audio to/from the AI.

Your office LAN Our server (this one) ┌───────────────────────────┐ ┌──────────────────────────┐ │ Edge box (Asterisk) │ WireGuard │ VoAIs app + WireGuard │ │ 10.66.0.X ───────────────┼═══ tunnel ═══►│ hub 10.66.0.1 │ │ │ SIP/LAN │ (UDP 51820) │ │ AI bridge (RTP) │ │ ▼ │ │ ▼ │ │ Dinstar UC2000G ──GSM──► 📱 phone │ Hidrogen / OpenAI / … │ └───────────────────────────┘ └──────────────────────────┘

The three pieces you touch: Edge box one install script · Dinstar its own web UI · Portal Settings → Telephony.

0 · What you need

ItemDetails
Edge boxUbuntu 24.04 (a small VM or mini-PC) on the same LAN as the Dinstar. 1 vCPU / 1 GB RAM is plenty. Needs outbound internet — no public IP or port-forwarding required.
Dinstar gatewayA Dinstar UC2000-VG / UC2000-VF (or compatible GoIP-style SIP↔GSM gateway) on the LAN, reachable by its web UI.
SIM cardsOne or more active SIMs, PIN lock disabled, inserted in the Dinstar ports.
Portal accountYour VoAIs login (this site). You'll use Settings → Telephony.
AI keyTo hear a real AI (not just an echo test) you need an AI provider key set on the server — see step 7.

1 · Your server values

These are this server's live WireGuard hub values. You'll paste them into the edge box install. Keep this tab open.

WireGuard hub endpoint
145.223.22.231:51820
WireGuard hub public key
tYDyd+7fNwsfV/qj4J3GEJc890U0RX7yNvLIYlGtBkg=
Hub overlay IP (RTP target)
10.66.0.1
Stasis app
voais
Your edge box's own overlay IP (like 10.66.0.10) is assigned to you in step 4 when you connect the tunnel from the portal — don't guess it.

2 · Get the setup bundle

On the edge box, download and unpack the bundle. It contains the one-shot installer setup.sh plus the Asterisk config templates it needs.

# on the edge box (Ubuntu 24.04), as a normal user
curl -fsSLO https://demo.voais.in/downloads/voais-edge-setup.tar.gz   # or use the button above
tar -xzf voais-edge-setup.tar.gz
cd asterisk
ls   # setup.sh  pjsip.conf  extensions.conf  manager.conf  ari.conf  http.conf  rtp.conf
If your portal is on a different domain than the file host, just use the Download setup bundle button at the top of this page and copy the file to the edge box.

3 · Install the edge box

Run the installer as root. It installs Asterisk 20 + WireGuard + a firewall, deploys the configs, and brings up the tunnel — all in one go. It is safe to re-run.

sudo SAAS_HUB_PUBKEY='tYDyd+7fNwsfV/qj4J3GEJc890U0RX7yNvLIYlGtBkg=' \
     SAAS_ENDPOINT='145.223.22.231:51820' \
     ./setup.sh

It will ask for a few things (press Enter to accept the detected defaults):

PromptWhat to enter
LAN interface / IP / subnetAuto-detected — just confirm.
Dinstar gateway LAN IPThe IP of your Dinstar, e.g. 192.168.1.20. (Find it on the Dinstar's screen or your router's device list.)

When it finishes it prints a summary card (also saved to voais-setup-summary.txt on your Desktop / home folder) containing your AMI/ARI credentials and — most importantly — this box's WireGuard public key:

# shown in the summary, and also here:
sudo cat /etc/wireguard/box.pub
# e.g.  Ki9c…long…base64…=  
Copy that box public key — you need it in the next step.

4 · Connect the tunnel (portal)

This is the link between your box and our server. In the portal go to Settings → Telephony → WireGuard tunnel:

1
Paste the box public key from step 3 into the field.
2
Click Connect / Enroll. The server assigns you an overlay IP (e.g. 10.66.0.10), registers your box as a peer, and pre-fills your Telephony fields.
3
Back on the edge box, re-run setup with the overlay IP it gave you so the tunnel uses the right address:
sudo SAAS_HUB_PUBKEY='tYDyd+7fNwsfV/qj4J3GEJc890U0RX7yNvLIYlGtBkg=' \
     SAAS_ENDPOINT='145.223.22.231:51820' \
     TENANT_OVERLAY_IP='10.66.0.10' \    # ← the IP the portal gave you
     ./setup.sh --yes

Verify the tunnel is live (a recent handshake = connected):

sudo wg show
# look for:  latest handshake: a few seconds ago
ping -c2 10.66.0.1          # the hub should answer over the tunnel
No handshake after a minute? Check that outbound UDP 145.223.22.231:51820 isn't blocked by your office firewall, and that you enrolled the box key in the portal.

5 · Configure the Dinstar gateway

Open the Dinstar's web UI in a browser at http://<dinstar-ip> (default login is on the device label, often admin / admin). This is the Dinstar's own software — not Asterisk. Set up four things:

5.1 — SIP trunk to the edge box

Point the Dinstar at Asterisk so calls flow between them.

FieldValue
Remote / SIP server addressthe edge box LAN IP (e.g. 192.168.1.10), port 5060, UDP
RegistrationNone (IP trunk — no username/password)
CodecG.711U (PCMU / ulaw) first — important for clean AI audio

5.2 — IP → Tel routing (outbound: portal → SIM)

Map our dial prefix to the SIM port. The prefix tells the Dinstar which SIM to use, then it is stripped before the real number is dialled.

Prefix from VoAIsSends outDelete length
7030SIM in port 304 (strip the 7030)
7031SIM in port 314
The scheme is 70 + port number. Port 30 → prefix 7030, port 31 → 7031, and so on. You set the matching prefix per SIM in the portal (step 6).

5.3 — Tel → IP routing (inbound: SIM → portal)

So incoming GSM calls reach Asterisk: route any GSM port → the edge box IP :5060, with no number manipulation.

5.4 — Insert SIMs

6 · Portal: Telephony + SIMs

If you used Connect / Enroll in step 4, most of this is already filled. Open Settings → Telephony, set Mode = Bring Your Own (self), and confirm these values (replace 10.66.0.10 with the overlay IP you were assigned):

FieldValue
AMI host / port10.66.0.10 / 5038
AMI user / secretfrom the setup summary card (step 3)
ARI URLhttp://10.66.0.10:8088
ARI user / passwordfrom the setup summary card
ARI appvoais
External media host / port10.66.0.1 / 12000
Trunkdinstar-trunk
AI context / Dial contextgsm-ai-out / gsm-out
Dinstar IPyour Dinstar LAN IP
GSM ports / prefix template30,31 / 70

Click Save, then go to Settings → SIMs and add one row per SIM:

PortPrefixCarrierActive
307030Airtel / Jio / …
317031
The prefix here must exactly match the Dinstar IP→Tel map in step 5.2. Calls are spread across active SIMs automatically (round-robin).

7 · Test & go live

Climb this ladder — each rung proves the layer below it works.

Rung 1 — connection test (AMI)

In Settings → Telephony click Test. Expect ok. A failure here is almost always a firewall block or a wrong AMI user/secret.

Rung 2 — echo call (no AI key needed)

This proves the whole audio path end-to-end without any AI. Dial yourself:

POST /api/calls/dial
{ "number": "<your mobile>", "mode": "ai" }

Answer the call — you should hear your own voice looped back. That confirms: originate → Dinstar → SIM → GSM → your phone → audio back over the tunnel to our server and out again.

Rung 3 — real two-way AI

Set an AI provider key on the server (one of these in the app .env, then restart):

HIDROGEN_API_KEY=...     # or OPENAI_API_KEY / GEMINI_API_KEY
AI_DEFAULT_MODEL=hidrogen-live

Dial again. Now the AI greets the person, listens, and replies — and you can barge in (start talking and the AI stops to listen). Transcripts and call events fill in under Call History. You are live.

Tip: keep the edge box and Dinstar on a UPS. The tunnel auto-reconnects after any network blip (PersistentKeepalive).

8 · Changing things later

You want to…Do this
Add another SIMInsert it in a new Dinstar port → add the IP→Tel prefix map (step 5.2) → add a row in Settings → SIMs with the matching port + prefix.
Change the Dinstar IPUpdate it in Settings → Telephony, and on the edge box re-run sudo DINSTAR_IP=<new> ./setup.sh --yes.
Re-enroll / replace the boxInstall setup.sh on the new box, copy its box.pub, paste it into WireGuard tunnel again. The old peer is replaced; your overlay IP stays.
Disconnect the tunnelClick Revoke under WireGuard tunnel — the peer is removed from the hub immediately.
Rotate AMI/ARI secretsRe-run setup.sh (it keeps existing secrets) or edit /etc/voais/setup.env, then update Settings → Telephony.

9 · Troubleshooting

SymptomFix
WireGuard test / Telephony Test failssudo wg show on the box — no handshake means UDP 145.223.22.231:51820 is blocked outbound, or the box key wasn't enrolled. Re-check step 4.
Call rings but no audio / one-wayRTP firewall. On the box, UDP 10000–20000 must be open both ways on the tunnel; on the Dinstar, codec must be ulaw first.
Dial fails instantlyOn the box: sudo asterisk -rx "pjsip show endpoint dinstar-trunk" — it must say Avail. If not, the Dinstar IP/SIP trunk (step 5.1) is wrong.
AI silent, only echoNo AI key set, or wrong model — see Rung 3. With no key the bridge runs in echo mode on purpose.
ari show apps is emptyThe server hasn't connected to ARI yet — check ARI URL/user/password in Telephony and that the tunnel is up.

Still stuck? Grab voais-setup-summary.txt (on your Desktop / home folder) and the output of sudo wg show + sudo asterisk -rx "pjsip show endpoints" and contact support.

API reference (optional)

Everything in the portal is also an API call (send your session token as a Bearer header).

EndpointPurpose
GET /api/settings/telephony/wireguardHub facts + your enrollment status & assigned overlay IP.
POST /api/settings/telephony/wireguard/enroll{ "public_key": "…" } — connect/replace your box peer.
DELETE /api/settings/telephony/wireguardRevoke the tunnel.
POST /api/settings/telephony/testLive AMI connection test.
POST /api/calls/dial{ "number":"…", "mode":"ai", "model":"…" } — place a call.
POST /api/calls/hangup/:uuidEnd a live call.