Twilio Flow To FreePBX Voicemail?

I’ve been using Twilio with my FreePBX for a few years and it works quite well. Now I’m trying something a bit different with one of my numbers that I could use some advice on.

I have designed a Twilio flow for one number that first routes it to my CRM and the if the person is unavailable I want to have it send it to my FreePBX server directly into voicemail.

The problem I’m encountering is that with the “Connect Call” Twilio Flow widget I’m not able to send a call to a specific extension on FreePBX, and I’m sure it is because I don’t know the proper way to place a direct SIP call to FreePBX.

The configuration asks for the SIP endpoint (as “sip:[email protected]”) with a username and password as optional extras. I thought this would translate extension 101 as “sip:[email protected]” so that is what I have in the setting. I’ve tried having no user/pass (which I was totally confident would fail), tried the extensions username and extension password (which I figured would also fail since this isn’t connecting a sip phone) and I tried my actual user login to FreePBX. None of these worked.

I figure there is probably a setting somewhere in FreePBX to allow this kind of addressing on an extension but I’m not sure where. Twilio is fully integrated with this instance of FreePBX but I don’t see a way to “tap into” that existing SIP trunk and then route to the extension in any kind of flow widget. I’m sure I could probably trigger off of the Twilio phone number to create an inbound route and just have the flow call the main number but it seems like I should be able to use the “sip:[email protected]” method to get where I want without extra inbound routing rules.

Any thoughts on how to make this work?

You’ll need a “Trunk” between the two and have twilio call sip:*[email protected]
That trunk will have to use the from-internal context so it can reach this extension’s voicemail.

I do have a trunk between the two already. So would it be sip:*[email protected]??? I’m not sure what to call the trunk in the command or where to find that in Twilio that would be used here. Is it the trunk SID? Or is it the "[sipuri].pstn.twilio.com?

You are calling from twilio to the PBX, so you obviously don’t want to use the Twilio URI

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