sip Trunk between our Asterisk PBX and VAPI
# support
i
Hey everyone! 👋 I'm trying to set up a BYO SIP Trunk between VAPI and my Asterisk PBX so calls can flow both ways using my company's official DID (+971XXXXXXXX). My Setup: DID +971XXXXXXXX registered on Cisco CUCM Asterisk PBX as SIP gateway PSTN connection through our voice gateway/ISP Created BYO SIP trunk credential in VAPI pointing to my Asterisk What I Want to Achieve: OUTBOUND (Primary Goal): VAPI AI Assistant → (SIP Trunk) → My Asterisk → My Voice Gateway → ISP PSTN → Customer Customer sees call from our DID number +971XXXXXXXX INBOUND (Secondary Goal): Customer → ISP PSTN → My Voice Gateway → Asterisk → (SIP Trunk) → VAPI AI Assistant Anyone calling +971XXXXXXXX reaches the AI Current Problem: When VAPI tries to make outbound calls, they get queued but fail with 503 service unavailable. Zero SIP traffic reaches my Asterisk (confirmed via firewall packet capture). VAPI isn't routing calls through the configured SIP trunk to my PBX at all. Has anyone successfully set up BYO SIP trunks where VAPI connects to your PBX (not directly to PSTN)? Am I missing something?
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
Action Step: Make sure your firewall and Asterisk PBX are configured to allow SIP traffic from Vapi's IPs:
Copy code
44.229.228.186/32
44.238.177.138/32
On your Asterisk, add these to your SIP peer configuration or firewall rules. This is the most common reason for 503 errors and no SIP traffic—Vapi's requests are being blocked before reaching your PBX. Reference: See the [SIP Trunking documentation](https://docs.vapi.ai/advanced/sip/sip-trunk#network-requirements) for more details and example configurations. Source: - [SIP Trunking documentation](https://docs.vapi.ai/advanced/sip/sip-trunk#network-requirements)
i
Thank you for the fast response, but when I enabled the packet capture on our firewall and tried to initiate a call from the ai assistant, we received no logs on the firewall. i will share some call logs ID maybe it can help you find the root cause. Failed Call IDs: - 0199f8fe-0a3e-7449-95b7-7a7bdb748b6d - 0199f8f4-0ff4-744d-b3f8-a8d6e3f1c323 - 0199f502-b60d-7999-b08c-5cd90a7bc513
v
Hey! I’ve helped set up BYO SIP trunks with VAPI going through Asterisk before. That 503 usually means VAPI can’t reach or authenticate with your PBX. Make sure your Asterisk is publicly reachable, SIP ports are open, and the credentials match what VAPI expects. Also, double-check the transport settings (UDP/TCP/TLS) on the trunk, they need to align with VAPI. @Issa Malouf
g
A quick consultation meeting with would get this all resolved, hit me up when you feel interested for a quick chat.
i
Am interested, how can we arrange for it?
I have double checked the configuration as both align with authentication and transport protocol but still the issue persist.
v
Thanks for checking that. Since your setup and protocols match but it’s still failing, it might be something in the SIP signaling or network path blocking VAPI before it reaches your Asterisk. I’ve dealt with this kind of issue before and can help you trace where the connection is breaking. Let’s move this to a private chat so we can go over your logs and fix it together. @Issa Malouf
i
how can we arrange for that?
v
Perfect! Send me a D..M, and we can go over the details. We can also hop on a quick call to troubleshoot together.
@Issa Malouf
i
Done already, you should have received my DM
n
@Issa Malouf The internet providers in the UAE block SIP traffic and use Deep Packet inspection to prevent connectivity between load SIP servers and gateways outside of the UAE.
We have local infrastructure in the UAE that help you bypass this issue - please DM me and we can do a small experiment together.
g
@Nir Simionovich (CEO@Cloudonix) I would love to know what the issue actually is.
n
The issue is simple. The following contries are highly regulated: UAE, Saudi Arabia, Turkey, Kazakhstan, Uzbekistan, India, Pakistan, China and some other central Africa countries. In these countries, VoIP is highly regulated and Internet providers will block any VoIP traffic that aims to pass between servers in these countries and the world. For example, in India, if you get a SIP Trunk from the TATA office in Kalkuta, you MUST connect it to a server in Kalkuta. The ISPs and Telecom providers actively block these connections - even if you change the port numbers, use TCP or even TLS services. In order to work in these countries, in most cases, you will need to use a service provider like Cloudonix, that has local infrastructure and is able to mangle both signalling and media, in such a way that doesn't violate the regulations and allow you to connect to external services such as VAPI and others.
g
@Nir Simionovich (CEO@Cloudonix) Now i tend to understand why the issues like connecting "ooredoo" or "ring-central" keeps occuring. I really appreciate your time and effort used to explaining this..
n
Ring Central is a walled garden, where connecting non-aurhorize hardware or software is blocked in multiple forms. Ooredoo is an Indian provdier if I'm not mistaken, which falls under the TRAI regulation, which means you can't connect it either.
2 Views