[Freeswitch-dev] FreeSWITCH and Twilio

Michael Nielsen mic.niel84 at gmail.com
Thu Jul 23 11:22:28 MSD 2015


Hello everyone,

I'm trying to setup FreeSWITCH with Twilio - to place outbound calls.

I've created a SIP trunk in Twilio and are now trying to terminate calls
via Twilio - all 10 digit calls should go this way (2 digit country code
and 8 digit number - Danish numbers).

This is my twilio.xml in sip_profiles/external:

<include>
  <gateway name="Twilio-outbound">
    <param name="username" value="MY-USER"/>
    <param name="password" value="MY-PASSWORD" />
    <param name="proxy" value="MY-SIP.pstn.twilio.com"/>
    <param name="register" value="false"/>
  </gateway>
</include>

This is my 02_twilio.xml in dialplan/default/:

<include>
  <extension name="international.twilio">
    <condition field="${toll_allow}" expression="international"/>
    <condition field="destination_number" expression="^(\d{10})$">
      <action application="set"
data="effective_caller_id_number=${outbound_caller_id_number}"/>
      <action application="set"
data="effective_caller_id_name=${outbound_caller_id_name}"/>
      <action application="bridge" data="sofia/gateway/Twilio-outbound/$1"/>
    </condition>
  </extension>
</include>

When I try and make a call for a Danish number (for example 4512345678) I
get a "Bad Request 400".

This is my FS log:

freeswitch at MY-SIP> 2015-07-23 07:19:45.745254 [NOTICE]
switch_channel.c:1075 New Channel sofia/internal/
4561912233 at MY-SIP.MY-DOMAIN.com [4af1a50e-5145-4ad8-8b9a-499a27e9e3ec]
2015-07-23 07:19:45.905238 [INFO] mod_dialplan_xml.c:635 Processing
4561912233 <4561912233>->4512345678 in context default
2015-07-23 07:19:45.905238 [NOTICE] switch_channel.c:1075 New Channel
sofia/external/4512345678 [54267cad-615c-478a-9ecc-61950a995068]
2015-07-23 07:19:45.905238 [NOTICE] sofia.c:7543 Hangup
sofia/external/4512345678 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]
2015-07-23 07:19:45.925245 [INFO] mod_dptools.c:3276 Originate Failed.
Cause: NORMAL_TEMPORARY_FAILURE
2015-07-23 07:19:45.925245 [NOTICE] switch_channel.c:4747 Hangup
sofia/internal/4561912233 at MY-SIP.MY-DOMAIN.com [CS_EXECUTE]
[NORMAL_TEMPORARY_FAILURE]
2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1641 Session 47
(sofia/internal/4561912233 at MY-SIP.MY-DOMAIN.com) Ended
2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1645 Close
Channel sofia/internal/4561912233 at MY-SIP.MY-DOMAIN.com [CS_DESTROY]
2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1641 Session 48
(sofia/external/4512345678) Ended
2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1645 Close
Channel sofia/external/4512345678 [CS_DESTROY]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20150723/fe58ee99/attachment-0001.html 


Join us at ClueCon 2014 Aug 4-7, 2014
More information about the FreeSWITCH-dev mailing list