FreePBX 13 asterisk 11 Twilio Elastic Sip Trunk Setup.

It's been over six months now that Twilio has opened up its Elastic Sip Trunking to the masses.  This video will show you how to hook up your FreePBX box to Twilio's Sip network and take advantage of their super low per minute rates.


This setup uses chan_sip and NOT chan_pjsip.  By default, if you install FreePBX 13 with asterisk 13 your install will set the chan_pjsip protocol to the standard 5060 bind port and chan_sip to bind to port 5160. 

To force chan_sip (if you installed asterisk 13) go to:

Settings > Advanced Settings > then change "Sip Channel Driver" to chan_sip.

Next go to Settings > Asterisk Sip Settings and update the Chan_Sip Bind Port to 5060 and the TLS Bind Port to 5061.

You will also need to update the chan_pjsip Ports to 5160 and 5161.

If you installed asterisk 11 from the start then the chan_pjsip tab will not appear in the Asterisk Sip Settings menu, but you may still have to update the ports in the Settings > Asterisk Sip Settings chan_sip tab.

Comments ( 3 )

  • Alisa
    Jun 30, 2017 at 05:41 PM / Reply

    I left this comment on YouTube as well. Sorry if I'm spamming, but I'm so frustrated right now:

    I just followed along with this video and did exactly what you did, but I'm not able to make an inbound call to my Twilio number. Calling outbound works great, but I get a fast busy signal when I try to call in. The Twilio call logs show my attempted inbound call with a status of "Failed" and the Asterisk logs give me this error:

    [2017-06-30 18:34:09] NOTICE[5686]: respjsip/pjsipdistributor.c:526 logfailedrequest: Request 'INVITE' from '<sip:+[mycell#]@[mycompany]>' failed for '' (callid: [email protected]) - No matching endpoint found

    Any idea what I'm doing wrong? I have the inbound call set to ring my extension and as far as I can tell, I have my extension set up correctly. It dials out anyway!

  • Alisa
    Jun 30, 2017 at 08:00 PM / Reply

    Nevermind - I finally got it working! It was an issue with the ports. Twilio was trying to connect using port 5060, but the current default installation of FreePBX has chansip using 5160 and chanpjsip using 5060. Twilio doesn't seem to work well with chan_pjsip, so I had to find the settings to swap the ports between sip and pjsip.

  • Brian
    Jul 3, 2017 at 01:39 PM / Reply


    Glad you got it figured out!
    Thanks for updating your comment with your solution.
    I'll update the post to include your findings.

Add Comment