<div dir="ltr"><div><div><div><div><div><div>Hello everyone,<br><br></div>I&#39;m trying to setup FreeSWITCH with Twilio - to place outbound calls.<br><br></div>I&#39;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).<br><br></div>This is my twilio.xml in sip_profiles/external:<br><br>&lt;include&gt;<br>  &lt;gateway name=&quot;Twilio-outbound&quot;&gt;<br>    &lt;param name=&quot;username&quot; value=&quot;MY-USER&quot;/&gt;<br>    &lt;param name=&quot;password&quot; value=&quot;MY-PASSWORD&quot; /&gt;<br>    &lt;param name=&quot;proxy&quot; value=&quot;<a href="http://MY-SIP.pstn.twilio.com">MY-SIP.pstn.twilio.com</a>&quot;/&gt;<br>    &lt;param name=&quot;register&quot; value=&quot;false&quot;/&gt;<br>  &lt;/gateway&gt;<br>&lt;/include&gt;<br><br></div>This is my 02_twilio.xml in dialplan/default/:<br><br>&lt;include&gt;<br>  &lt;extension name=&quot;international.twilio&quot;&gt;<br>    &lt;condition field=&quot;${toll_allow}&quot; expression=&quot;international&quot;/&gt;<br>    &lt;condition field=&quot;destination_number&quot; expression=&quot;^(\d{10})$&quot;&gt;<br>      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_number=${outbound_caller_id_number}&quot;/&gt;<br>      &lt;action application=&quot;set&quot; data=&quot;effective_caller_id_name=${outbound_caller_id_name}&quot;/&gt;<br>      &lt;action application=&quot;bridge&quot; data=&quot;sofia/gateway/Twilio-outbound/$1&quot;/&gt;<br>    &lt;/condition&gt;<br>  &lt;/extension&gt;<br>&lt;/include&gt;<br><br></div>When I try and make a call for a Danish number (for example 4512345678) I get a &quot;Bad Request 400&quot;.<br><br></div>This is my FS log:<br><br>freeswitch@MY-SIP&gt; 2015-07-23 07:19:45.745254 [NOTICE] switch_channel.c:1075 New Channel sofia/internal/<a href="mailto:4561912233@MY-SIP.MY-DOMAIN.com">4561912233@MY-SIP.MY-DOMAIN.com</a> [4af1a50e-5145-4ad8-8b9a-499a27e9e3ec]<br>2015-07-23 07:19:45.905238 [INFO] mod_dialplan_xml.c:635 Processing 4561912233 &lt;4561912233&gt;-&gt;4512345678 in context default<br>2015-07-23 07:19:45.905238 [NOTICE] switch_channel.c:1075 New Channel sofia/external/4512345678 [54267cad-615c-478a-9ecc-61950a995068]<br>2015-07-23 07:19:45.905238 [NOTICE] sofia.c:7543 Hangup sofia/external/4512345678 [CS_CONSUME_MEDIA] [NORMAL_TEMPORARY_FAILURE]<br>2015-07-23 07:19:45.925245 [INFO] mod_dptools.c:3276 Originate Failed.  Cause: NORMAL_TEMPORARY_FAILURE<br>2015-07-23 07:19:45.925245 [NOTICE] switch_channel.c:4747 Hangup sofia/internal/<a href="mailto:4561912233@MY-SIP.MY-DOMAIN.com">4561912233@MY-SIP.MY-DOMAIN.com</a> [CS_EXECUTE] [NORMAL_TEMPORARY_FAILURE]<br>2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1641 Session 47 (sofia/internal/<a href="mailto:4561912233@MY-SIP.MY-DOMAIN.com">4561912233@MY-SIP.MY-DOMAIN.com</a>) Ended<br>2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1645 Close Channel sofia/internal/<a href="mailto:4561912233@MY-SIP.MY-DOMAIN.com">4561912233@MY-SIP.MY-DOMAIN.com</a> [CS_DESTROY]<br>2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1641 Session 48 (sofia/external/4512345678) Ended<br>2015-07-23 07:19:45.925245 [NOTICE] switch_core_session.c:1645 Close Channel sofia/external/4512345678 [CS_DESTROY]<br><br></div>