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.
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.
The three pieces you touch: Edge box one install script · Dinstar its own web UI · Portal Settings → Telephony.
0 · What you need
| Item | Details |
|---|---|
| Edge box | Ubuntu 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 gateway | A Dinstar UC2000-VG / UC2000-VF (or compatible GoIP-style SIP↔GSM gateway) on the LAN, reachable by its web UI. |
| SIM cards | One or more active SIMs, PIN lock disabled, inserted in the Dinstar ports. |
| Portal account | Your VoAIs login (this site). You'll use Settings → Telephony. |
| AI key | To 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.
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
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):
| Prompt | What to enter |
|---|---|
| LAN interface / IP / subnet | Auto-detected — just confirm. |
| Dinstar gateway LAN IP | The 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…=
4 · Connect the tunnel (portal)
This is the link between your box and our server. In the portal go to Settings → Telephony → WireGuard tunnel:
10.66.0.10), registers your box as a peer, and pre-fills your Telephony fields.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
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.
| Field | Value |
|---|---|
| Remote / SIP server address | the edge box LAN IP (e.g. 192.168.1.10), port 5060, UDP |
| Registration | None (IP trunk — no username/password) |
| Codec | G.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 VoAIs | Sends out | Delete length |
|---|---|---|
7030 | SIM in port 30 | 4 (strip the 7030) |
7031 | SIM in port 31 | 4 |
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
- Put each SIM in the port you mapped above (port 30, 31, …).
- Disable the SIM PIN (do this in a phone first if needed).
- Confirm each port shows Registered / Idle with signal on the Dinstar status page.
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):
| Field | Value |
|---|---|
| AMI host / port | 10.66.0.10 / 5038 |
| AMI user / secret | from the setup summary card (step 3) |
| ARI URL | http://10.66.0.10:8088 |
| ARI user / password | from the setup summary card |
| ARI app | voais |
| External media host / port | 10.66.0.1 / 12000 |
| Trunk | dinstar-trunk |
| AI context / Dial context | gsm-ai-out / gsm-out |
| Dinstar IP | your Dinstar LAN IP |
| GSM ports / prefix template | 30,31 / 70 |
Click Save, then go to Settings → SIMs and add one row per SIM:
| Port | Prefix | Carrier | Active |
|---|---|---|---|
30 | 7030 | Airtel / Jio / … | ✓ |
31 | 7031 | … | ✓ |
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.
8 · Changing things later
| You want to… | Do this |
|---|---|
| Add another SIM | Insert 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 IP | Update it in Settings → Telephony, and on the edge box re-run sudo DINSTAR_IP=<new> ./setup.sh --yes. |
| Re-enroll / replace the box | Install 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 tunnel | Click Revoke under WireGuard tunnel — the peer is removed from the hub immediately. |
| Rotate AMI/ARI secrets | Re-run setup.sh (it keeps existing secrets) or edit /etc/voais/setup.env, then update Settings → Telephony. |
9 · Troubleshooting
| Symptom | Fix |
|---|---|
| WireGuard test / Telephony Test fails | sudo 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-way | RTP 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 instantly | On 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 echo | No AI key set, or wrong model — see Rung 3. With no key the bridge runs in echo mode on purpose. |
ari show apps is empty | The 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).
| Endpoint | Purpose |
|---|---|
GET /api/settings/telephony/wireguard | Hub facts + your enrollment status & assigned overlay IP. |
POST /api/settings/telephony/wireguard/enroll | { "public_key": "…" } — connect/replace your box peer. |
DELETE /api/settings/telephony/wireguard | Revoke the tunnel. |
POST /api/settings/telephony/test | Live AMI connection test. |
POST /api/calls/dial | { "number":"…", "mode":"ai", "model":"…" } — place a call. |
POST /api/calls/hangup/:uuid | End a live call. |