Still having byo-sip-trunk inbound SIP calls issue...
# support
v
1. Create SIP Phone Number { "id": "fee78833-d97c-4f74-bf8b-dfa498942b16", "orgId": "289e9a2a-f610-4141-8aff-3c9ad3891cee", "assistantId": "3aaebee3-239a-435e-b73d-df1bb9a72079", "createdAt": "2025-03-15T08:10:26.692Z", "updatedAt": "2025-03-15T08:10:26.692Z", "sipUri": "sip:xxxxxxxxx@sip.vapi.ai", "provider": "vapi", "status": "active" } 2. Create SIP Trunk { "id": "c2494f27-bdbd-403c-8599-ec91d17597bb", "orgId": "289e9a2a-f610-4141-8aff-3c9ad3891cee", "provider": "byo-sip-trunk", "createdAt": "2025-03-15T08:15:47.443Z", "updatedAt": "2025-03-15T08:15:47.443Z", "gateways": [ { "ip": "xxxxxxxxxxxxx", "port": 5060, "inboundEnabled": true, "outboundEnabled": true } ], "name": "Zadarma Trunk", "outboundAuthenticationPlan": { "authPassword": "xxxxxxxxx!", "authUsername": "xxxxxxx" }, "outboundLeadingPlusEnabled": true, "sbcAccountConfiguration": { "trunkId": "54e1f960-5a5a-4308-b393-221acc995cf4", "accountId": "608246eb-3dee-4538-88d9-32e85506853d", "gatewayIds": [ "934455a1-4d4d-4087-be82-da4978efafe0" ], "accountApiKey": "6df3b0dd-1fe4-47bc-ac48-8594d1bc3d32", "applicationId": "3e6a77b7-c762-4075-b288-11df89806fe9" } } 3. Associate a Phone Number with the SIP Trunk { "id": "c4f5a660-ea15-4ef8-8809-2829ff9875c5", "orgId": "289e9a2a-f610-4141-8aff-3c9ad3891cee", "number": "+xxxxxxxxxx", "createdAt": "2025-03-15T08:24:05.113Z", "updatedAt": "2025-03-15T08:24:05.113Z", "name": "Zadarma Trunk", "credentialId": "c2494f27-bdbd-403c-8599-ec91d17597bb", "provider": "byo-phone-number", "numberE164CheckEnabled": false, "status": "active" } 4. calling from "ip": "xxxxxxxxxxxxx", authorized by "authPassword": "xxxxxxxxx!", "authUsername": "xxxxxxx" on "number": "+xxxxxxxxxx", and bumping in to SIP 401 while all SIP header modification as required by nonce MD5 encoding is in place.... 5. call pcap is attached https://cdn.discordapp.com/attachments/1350389139522195456/1350389139610013756/message.txt?ex=67dd26e3&is=67dbd563&hm=17d2884deea3f96d8397b78c3bbc0b266e1266d4bdf153ea8139dd6f031e5b8d& https://cdn.discordapp.com/attachments/1350389139522195456/1350389139949748245/MWYyMjdlMTlhNDk3ZjQxNmY1NzZkYjE4ZGQ0YTAxYTE..pcap?ex=67dd26e3&is=67dbd563&hm=bfbaa75fffccb8c41ca31d072215ef7e1884c53db72fb44417936a79bd5ad7fb&
s
Looking at the SIP trace more closely. The authentication is failing because ConnexCS is only sending username but not password. Vapi excepts both username and password. Usernamre has to be your sip username. Keep your password as is (anything non-empty will work according to your information). After making these changes, test the call again.
n
@Shubham Bajaj Actually, I believe he's running into a slightly different problem as well. Normally, a SIP gateway will respod with a
SIP 407 Authentication Required
error. However, based on the above, they are receiving a
SIP 401 - Unauthorized
- which means: If he is trying to send an outbound call from VAPI, using a let's say, and Eastern European phone number, provided by Zadarma - it will not work. Some of these countries apply a "only in-country IP numbers" requirement - which means, of the call comes from a non-local IP number, it will not work. We have similiar cases with customers in Kazakhstan and other areas, which forced us to deploy in country gateway to resolve said issues.
v
I finally figured out the issue. I was associating created sip number I created at vapi with sip trunk created at vapi as well. While I had to URI from my softswitch on Vapi`s SIP trunk only. It works. Just the issue is AI assitants does not respond. Seems there is some media or codec issue as assistan disconnects by 30 sec timeout. Please look in to pcap attached. https://cdn.discordapp.com/attachments/1350389139522195456/1350477653676920842/YmRlZjlhZmQ0OWZmZGY0OGRmMmJjNTdjOWQ1NTQ2M2Y..pcap?ex=67d6e1d3&is=67d59053&hm=41670eb2c92cccf167a75e8ebdc7f4ac3ceaa3845466f6fbdcd24f2c10b3687a&
I can hear assistant speaking, while when I speak it does not respond.
n
A 30 second disconnect is related to a NAT issue, not a media/codec issue. It means that your provider signalling isn't handling NAT properly, or your provider is behing a NAT gateway, which confuses VAPI's signalling.
@Vladimir I've reveiwed the tace you provided, it seems like the 3CX system where the call is originated from is trying to perform a MEDIA Re-INVITE to VAPI. However, as VAPI requires challenge/resposne SIP workflow for Media Re-INVITE as well, I believe something messes up in there. Also, I see some significant media address changes along the way - originating from your side. Are you by any change using the 3CX Cloud service?
n
@Vladimir let's start with the following, 3cx is a great pbx and system, as long as you keep to their tech and platform. Digressing from its intended use will yield unknown results. Now, what are you trying to achieve? What is the use case your aiming to complete?
v
The only issue I experience is a dead air from VAPI when I call to AI assistant. From me to VAPI no speech delivered to AI assistant as Assistant does not respond me and disconnects in 30 seconds by SIP trunk associated with phone number https://docs.vapi.ai/advanced/sip/sip-trunk while responds when I call on twilio number associated with same assistant. From VAPI to me it is all fine. I hear well what assistan says.
n
Sounds like a classic NAT issue from your side. Try zoiper.
v
It worked! Thank you very much for the support @Nir S (CEO/Founder @Cloudonix) !
s
So I'm having some issues as well, I created a trunk with the credential api, set my port have thr outboundauthenticationplan (auth user and pass set) Then using thr phone number api request I am creating a number (called it 909091) so that I can use it as an internal number from thr pbx thus (e164 check is disabled) In pjsip trunk settings I tried all authentication options (inbound, outbound, none, both) and both registration options (and no matter what I do I can't get to the agents). I must be missing a step which I think is on thr vapi platform as I have been using asterisk and other pbx platforms for ages
v
Try follow these steps https://docs.vapi.ai/advanced/sip/sip-trunk. What is more important is to send call on sip username, not the telephone number you created. But it may depend on your softswitch or sipphone.
v
Do you guys need any help with SIP?
s
@Vladimir just to conclude the issue was incorrectly associating a SIP number you created at Vapi with a SIP trunk also created at Vapi, and then you have used the URI from softswitch on Vapi's SIP trunk directly. cc: @Nir S (CEO/Founder @Cloudonix)
cc: @Sahil
@Nir S (CEO/Founder @Cloudonix) Thanks for helping @Vladimir
n
👍
s
Thanks @Nir S (CEO/Founder @Cloudonix)
s
I was not able to get the trunk working, so the only thing I was able to do was to use public URI dialing which interestingly works on a local install but not on a remote isntall of my pbx server (development vs production) with identical settings
v
Can you send me the latest call_id?
s
i cant because a call is not being initiated, the trunk is not connecting properly, i resorted to creating multiple URI using the vapi provider, and just using direct sip URI dialing dont see a downside to this other than having to program more on my end.
v
can you send a loom video?
n
Based on your comments, are you trying to configure Asterisk's chan_pjsip to receive calls from VAPI ?
s
Well, I was trying only to make calls to vapi, but ideally yes two direction would be better. And yes I was trying to configure PJSIP, which I failed so I resulted to using direct sip uri calling with chan_pjsip and it seems to work for now
n
Well, Asterisk and PJSIP have some security constraints built-in, which make the intergration with VAPI a little "challenging". Also, various issues such as NAT on the Asterisk side may cause some "quirks".
Are you using Asterisk as a "Carrier simulation" or a "PBX / Contact Center solution" ?
s
I been using asterisk and PJSIP for years, never had any issues. I don't see why there should be any NAT issues when both vapi servers and our server are on public IPs
n
I'm just raising a potential issue - that's it
I've an Asterisk core developer myself - so I well versed with it
in general, what are you having issues with? getting calls from VAPI to your Asterisk server ?
o
Somebody! Anybody please help me. My VAPI transient assistant is only saying the firstmessage and swith to idle message of (Are you there, are you there) even when obviously i am talking and. It is not going on with the rest of the script
v
Hey, Can you send me the latest call_id? Along with that, can you provide me the duration in the recording where you had this issue?
o
Okay @Sahil I will
@Sahil call logs:ab5eca41-e28b-4340-9531-c972de4a7ed9
@Sahil ab5eca41-e28b-4340-9531-c972de4a7ed9
2dcb9e32-a6ed-4b33-8feb-39540ac59ff6\
i HAVE HAF THE ISSUE ON ALL MY CALLS IN RECENT TIME
@Vapi @Vapi Support Bot @Sahil
s
Which number are you dialing? Also, are you from jobber side?
@OgagaPengist
o
i'm dialing nigerian nuumber +234
s
Sent you invite
we can talk over there!
9 Views