national-gold
national-gold3mo ago

Need help connecting Asterisk to VAPI SIP for incoming GSM calls from GOIP

Hi everyone, I’m currently integrating a GOIP device (Dinstar with GSM SIM card) with VAPI so that all incoming GSM calls are handled by my VAPI voice assistant. Here’s what I’ve done so far: - ✅ GOIP is successfully registered as a SIP endpoint on my Asterisk server. - ✅ Asterisk shows the GOIP as "Available" with pjsip show endpoints. - ✅ I have a working assistant configured on my VAPI account. My goal: ➡️ When someone calls my GSM SIM (in GOIP), the call reaches Asterisk, which should then forward the call to my assistant via VAPI (SIP). What I need: I’m looking for a working example of how to connect Asterisk to VAPI using SIP (pjsip.conf and extensions.conf). I have my assistant ID and API key, but I’m not sure: - How to generate the SIP URI or SIP trunk inside VAPI. - What to put in the pjsip.conf and extensions.conf to make this work. Any help or working config examples would be greatly appreciated 🙏 Thanks in advance!
3 Replies
Vapi Support Bot
To connect Asterisk to VAPI SIP: 1. Create a SIP URI in VAPI: Use the VAPI dashboard or API to create a SIP phone number with a URI like sip:your_username@sip.vapi.ai and assign your assistant (docs). 2. Asterisk Setup: In pjsip.conf, define an endpoint pointing to sip.vapi.ai. In extensions.conf, route incoming calls to this SIP URI. The documentation does not provide a full Asterisk config example, so you may need to adapt a generic SIP trunk setup. Clarifying question:
What version of Asterisk are you using, and do you already have a working SIP trunk config that we can build on? Sources: - VAPI SIP Integration Guide - VAPI SIP Trunk Guide
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
national-gold
national-goldOP3mo ago
I’m using Asterisk version 20 (installed from latest ISO). My GOIP GSM gateway is already connected to Asterisk and I can see it with pjsip show endpoints as Available. I now want to forward incoming calls from GOIP to VAPI via SIP. I haven’t yet configured the SIP trunk to VAPI. Could you help me write the correct pjsip.conf and extensions.conf entries for that? My VAPI SIP URI is: sip:dinstarvapi@sip.vapi.ai
Sahil
Sahil3mo ago
Hey, writing pjsip.conf is outside our scope of work. Please send the traffic to sip:number@credential_id.sip.vapi.ai and ask ChatGPT to write it for you.

Did you find this page helpful?