[Freeswitch-users] Freeswitch and twilio

Sergey Safarov s.safarov at gmail.com
Tue Oct 6 07:57:41 MSD 2015


If disable registration on inbound gateway, then is possible receive
inbound call?

On Mon, Oct 5, 2015, 22:45 Michael Nielsen <mic.niel84 at gmail.com> wrote:

> Twilio is just taking a sip address as termination address. In this case
> my domain which FS runs on.
> Apparently, Twilio is sending calls to the standard 5060 port - which then
> lands in my public context.
>
> On Monday, October 5, 2015, Stanislav Sinyagin <ssinyagin at gmail.com>
> wrote:
>
>> in your pastebin, you seem to receive the call on your internal profile
>> (port 5060):
>> 11:18:58.277709 [DEBUG] sofia.c:9229 sofia/internal/+
>> 4432445867 at sip.ie1.twilio.com receiving invite from 54.171.127.192:5060
>>
>>
>> so, what exactly is configured on both sides? The external profile is
>> usually on the port 5080.
>>
>>
>>
>> On Mon, Oct 5, 2015 at 6:26 PM, Michael Nielsen <mic.niel84 at gmail.com>
>> wrote:
>>
>>> Here's as log from an incoming call from Twilio:
>>> http://pastebin.com/n0de7jhv
>>>
>>> My guess is the problem is with line 33: "Processing +4432445867
>>> <+4432445867>->+44213395867 in context public"
>>> and it fails on line 40: "Regex (FAIL) [gateway_inbound]
>>> ${target_context}() =~ /^[a-z]/ break=on-false"
>>> due to the fact that there aren't set any ${target_context} variable.
>>>
>>> I've added the Twilio inbound gateway as described in the Twilio guide,
>>> but adding it, removing it etc. doesn't change anything at all.
>>> To the Twilio-Inbound gateway I've added the variable ${target_context}
>>> according to this guide:
>>> https://github.com/voxserv/freeswitch_conf_minimal/blob/master/docs/tutorial_01_simple_pbx.md
>>>
>>> So my guess is that the Twilio-Inbound gateway aren't being used -
>>> however - calls are routed to my FS.
>>>
>>> On Sun, Oct 4, 2015 at 10:15 PM, Michael Nielsen <mic.niel84 at gmail.com>
>>> wrote:
>>>
>>>> I'll create some logs tomorrow.
>>>>
>>>> Just to clarify:
>>>> - Calls are routes from Twilio to my FS
>>>> - My FS is a clean installation, 1.6.2
>>>> - I've used Twilio's guide for setting up gateways, inbound and outbound
>>>> - Outbound calls are routed correctly
>>>> - Inbound calls are as mentioned routes to my FS, but my Twilio-inbound
>>>> doesn't seem to have anything to do with it, therefor, I'm not able to set
>>>> any variables in incoming calls from Twilio so I can detect them in my
>>>> public context and transfer them to my default context.
>>>>
>>>> I don't want to route all calls in my public context to my default
>>>> context, this would open a security issue. Only Twilio calls should be
>>>> handled in such a manner.
>>>> That's my challenge.
>>>>
>>>>
>>>> On Sunday, October 4, 2015, Sergey Safarov <s.safarov at gmail.com> wrote:
>>>>
>>>>> Inbound call can be received
>>>>> 1) if twillio guys configure gateway to route incomes calls to you
>>>>> 2) or if FS provide information how to route call for you
>>>>>
>>>>> After reading gateway config files, I has found that used second case
>>>>> "FS provides information how to route calls via registration mechanism".
>>>>>
>>>>> Please:
>>>>> - configure clean FS host as described in twilio manuals;
>>>>> - enable siptrace;
>>>>> - enable debug log;
>>>>> - make incoming call;
>>>>> - attach debug log in respond to this message.
>>>>>
>>>>> I try help you
>>>>>
>>>>>
>>>>> On Sun, Oct 4, 2015 at 2:37 PM, Michael Nielsen <mic.niel84 at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Still no luck.
>>>>>> Any other ideas on how to "catch" the calls from the public context
>>>>>> in FS?
>>>>>> My goal is to transfer all calls from Twilio to my default context.
>>>>>>
>>>>>>
>>>>>> On Saturday, October 3, 2015, Michael Nielsen <mic.niel84 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Looking at their guide for secure setup:
>>>>>>> https://www.twilio.com/resources/images/docs/Twilio-Freeswitch.pdf
>>>>>>> they've added     <param name="register" value="false"/>
>>>>>>> When I do this, registering doesn't fail (obviously), but inbound
>>>>>>> calls are still not registered as coming from twilio... They still land
>>>>>>> directly in the public context without the variables set correctly.
>>>>>>>
>>>>>>> On Sat, Oct 3, 2015 at 11:58 AM, Michael Nielsen <
>>>>>>> mic.niel84 at gmail.com> wrote:
>>>>>>>
>>>>>>>> When adding the extension, I get the following - even though my
>>>>>>>> username and password etc. are correct as they work for the outbound
>>>>>>>> gateway...:
>>>>>>>>
>>>>>>>> twilio-inbound Failed Registration [908]
>>>>>>>>
>>>>>>>> On Sat, Oct 3, 2015 at 11:57 AM, Michael Nielsen <
>>>>>>>> mic.niel84 at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> I see.
>>>>>>>>> Does it matter that I don't have an extension called 1000 in my
>>>>>>>>> FS, nor in my Twilio account?
>>>>>>>>>
>>>>>>>>> On Fri, Oct 2, 2015 at 11:34 PM, Ahmed Habiba <ahabiba at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> if you have a deep look at  inbound gateway it is for receiving
>>>>>>>>>> calls from Twilio as you can see below, this line informing freeswitch
>>>>>>>>>> where to route inkling call.
>>>>>>>>>>
>>>>>>>>>> <param name="extension" value="1000"/>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *From: *Michael Nielsen <mic.niel84 at gmail.com>
>>>>>>>>>> *Date: *October 2, 2015 at 11:24:51 PM GMT+3
>>>>>>>>>> *To: *FreeSWITCH Users Help <
>>>>>>>>>> freeswitch-users at lists.freeswitch.org>
>>>>>>>>>> *Subject: **Re: [Freeswitch-users] Freeswitch and twilio*
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Outbound works fine.
>>>>>>>>>>
>>>>>>>>>> Without having the inbound gateway calls are still routed to my
>>>>>>>>>> FS to my public context from Twilio.
>>>>>>>>>> Adding the twilio-inbound doesn't seem to change anything...?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Friday, October 2, 2015, Brian West <brian at freeswitch.org>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Well you'd send outbound calls out the outbound  and the inbound
>>>>>>>>>>> one is just to register with twilio so they know where to send your inbound
>>>>>>>>>>> calls.  Nothing more.
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Oct 2, 2015 at 1:46 PM, Michael Nielsen <
>>>>>>>>>>> mic.niel84 at gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> I'm trying to setup twilio as gateway following this guide:
>>>>>>>>>>>>
>>>>>>>>>>>> https://www.twilio.com/docs/sip-trunking/sample-configuration#freeswitch
>>>>>>>>>>>>
>>>>>>>>>>>> In their example of twiliotrunk.xml they have twilio-inbound
>>>>>>>>>>>> and twilio-outbound.
>>>>>>>>>>>>
>>>>>>>>>>>> What is the difference between the two gateways? I know their
>>>>>>>>>>>> names indicate inbound and outbound calling, but how can Freeswitch tell
>>>>>>>>>>>> the difference between them. Especially how can Freeswitch now to use
>>>>>>>>>>>> twilio-inbound for incoming calls from twilio and not just twilit-outbound
>>>>>>>>>>>> as the only difference is register-proxy and expire-seconds between the two?
>>>>>>>>>>>>
>>>>>>>>>>>> Make sense?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> _________________________________________________________________________
>>>>>>>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>>>>>>>> consulting at freeswitch.org
>>>>>>>>>>>> http://www.freeswitchsolutions.com
>>>>>>>>>>>>
>>>>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>>>> http://confluence.freeswitch.org
>>>>>>>>>>>> http://www.cluecon.com
>>>>>>>>>>>>
>>>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> *Brian West*
>>>>>>>>>>> brian at freeswitch.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Twitter: @FreeSWITCH , @briankwest*
>>>>>>>>>>> http://www.freeswitchbook.com
>>>>>>>>>>> http://www.freeswitchcookbook.com
>>>>>>>>>>>
>>>>>>>>>>> Got Bugs? Report them here <https://freeswitch.org/jira>! |
>>>>>>>>>>> Reddit: /r/freeswitch <https://www.reddit.com/r/freeswitch>
>>>>>>>>>>>
>>>>>>>>>>> *T:*+19184209001 | *F:*+19184209002 | *M:*+1918424WEST (9378)
>>>>>>>>>>> *iNUM:*+883 5100 1420 9001 | *ISN:*410*543 | *Skype:*briankwest
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _________________________________________________________________________
>>>>>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>>>>>> consulting at freeswitch.org
>>>>>>>>>> http://www.freeswitchsolutions.com
>>>>>>>>>>
>>>>>>>>>> Official FreeSWITCH Sites
>>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>> http://confluence.freeswitch.org
>>>>>>>>>> http://www.cluecon.com
>>>>>>>>>>
>>>>>>>>>> FreeSWITCH-users mailing list
>>>>>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>>>>>> UNSUBSCRIBE:
>>>>>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>>>>>> http://www.freeswitch.org
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _________________________________________________________________________
>>>>>> Professional FreeSWITCH Consulting Services:
>>>>>> consulting at freeswitch.org
>>>>>> http://www.freeswitchsolutions.com
>>>>>>
>>>>>> Official FreeSWITCH Sites
>>>>>> http://www.freeswitch.org
>>>>>> http://confluence.freeswitch.org
>>>>>> http://www.cluecon.com
>>>>>>
>>>>>> FreeSWITCH-users mailing list
>>>>>> FreeSWITCH-users at lists.freeswitch.org
>>>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>>>> UNSUBSCRIBE:
>>>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>>>> http://www.freeswitch.org
>>>>>>
>>>>>
>>>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20151006/ae05e47a/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list