Inbound rule forward call to external SIP Domain (Twillio)

Hi there,

I’m facing some issues configuring a route from FreePBX to Twillio.

This is my setup

I got two SIP Trunks
1x For general communication(outgoing and ingoing calls)
2x Twillio Elastic SIP Trunk

Whenever I receive a call via my first SIP Trunk I want to redirect(REFER) it to the Twillio SIP Endpoint to handle my IVR(Twillio Flow).

I was successfully able to test the route from a FreePBX extension to my Twillio SIP Domain endpoint and reach my IVR. However, I don’t find a way to do this redirect automatically for incoming calls.

I tried using a “Custom Destination” with the following string:
“from-internal,<MY_NAME>@.sip.twilio.com,1”
I will receive the following message in my log if I apply the config and call:

 -- Executing [s@macro-dialout-trunk:34] Dial("PJSIP/00094927251-00000047", "PJSIP/sip:<MY_NAME>@<TWILLIO-SIP-DOMAIN>.sip.twilio.com@Twilio-EU,300,b(func-apply-sipheaders^s^1,(2))U(sub-send-obroute-email^sip:<MY_NAME>@<TWILLIO-SIP-DOMAIN>.sip.twilio.com^sip:<MY_NAME>@<TWILLIO-SIP-DOMAIN>.sip.twilio.com^2^1681867819^^+4972195279XXX)") in new stack
[2023-04-19 01:30:19] ERROR[7868]: chan_pjsip.c:2645 request: Unable to create PJSIP channel - endpoint '<TWILLIO-SIP-DOMAIN>.sip.twilio.com@Twilio-EU' was not found
[2023-04-19 01:30:19] WARNING[19618][C-00000048]: app_dial.c:2598 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)

The Custom Destination is working if I replace the SIP endpoint with an extension number from the PBX. So something is going wrong with my SIP transfer.

Any ideas?

Thank you

This dial string is invalid that’s why it’s not working. You need to show the config for the Twilio trunk, it’s misconfigured.

Here are my Trunk settings:


As mentioned calls from my internal extension(PBX) to the Twillio Endpoint to reach IVR are working.

Need to see the Advanced tab with all the other settings.

Sorry.

Here you go

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