FreePBX Twilio SIP TRUNK inbound wont work

Hi all,
FreePBX + Twilio sip trunk, outbound works. Inbound wont work, twilio says Error communicating with your SIP communications infrastructure.

Origination on twili is set to my public ip adress, firewall is disabled. How to troubleshoot what is wrong? Why twilio cannot connect to my asterisk?

My SIP INCOMNG settings
type=peer
secret=xxx
username=xxx
host=xxx.pstn.twilio.com
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
insecure=port,invite
fromuser=xxx
fromdomain=xxx.pstn.twilio.com
context=incoming

Inbound route is set to an extension when i call it from softphone it works. Wont work only thru twilio. Thanks

Using Chan_SIP for providers that send calls from dozens of IPs is the wrong choice. Chan_SIP can support ONE IP or Host name. That means you would need dozens of Chan_SIP trunks to support each IP the requests come from.

Change this to a Chan_PJSIP trunk so you can put all the IPs in the Match (Permit) setting and have them all be accepted over one trunk.

1 Like

To amplify this: I used to be a Chan_SIP guy. I didn’t no new Channel Driver - Chan-SIP worked plenny goodly. Then my ITSP added 24 more IP addresses to the list of places calls could come from. That was all I needed to become a convert.

Hi there, thanks for reply! With this config still wont work. twilio_sip_conf|657x500 !

Well let’s time I checked, Twilio wasn’t listening on 5061 they listen on 5060 so fix that. Alos, you are not authing them for inbound calls so remove that. That should be “None”

Hi there, So i changed to ChanPJSIP and not even outbound wont work, I can only call extension . What i dont get is that when i try to call a real phone it says extension not found. Why? Im not calling an extension but a real number. inbound%20router

I use Twilio sip trunks myself. Definitely want to use PJSIP driver for that. Twilio requires at least one ACL setting to be used, either IP address or authentication credentials. In my opinion, use both. Make sure those are both input correctly, or which ever you use. If you use IP authentication, make sure it is the correct IP to your PBX. In your trunk settings, the Authentication should be set to Outbound if you use authentication ACL.

If in doubt, follow their guide, the same one I used to get mine up and working: FreePBX - Twilio Guide

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.