<div dir="ltr">Im not experienced with Twilio, but as I see from the docu, they're expecting E.164 format which is +45... in your case.<div>Check out <a href="https://en.wikipedia.org/wiki/E.164">https://en.wikipedia.org/wiki/E.164</a></div><div><br></div><div>Rewrite the destination and source via regex f ex </div><div><span style="font-size:12.8px"> <action application="set" data="effective_caller_id_</span><span style="font-size:12.8px">number=+${outbound_caller_id_</span><span style="font-size:12.8px">number}"/></span></div><div><span style="font-size:12.8px">and</span></div><div><span style="font-size:12.8px"> </span><span style="font-size:12.8px"><action application="set" data="destination_number</span><span style="font-size:12.8px">=+${destination_number</span><span style="font-size:12.8px">}"/></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Or just try to write to their support, problably will give you an answer, whats wrong.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thomas</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 July 2015 at 09:21, Michael Nielsen <span dir="ltr"><<a href="mailto:mic.niel84@gmail.com" target="_blank">mic.niel84@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hello everyone,<br><br></div>I'm trying to setup FreeSWITCH with Twilio - to place outbound calls.<br><br></div>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).<br><br></div>This is my twilio.xml in sip_profiles/external:<br><br><include><br> <gateway name="Twilio-outbound"><br> <param name="username" value="MY-USER"/><br> <param name="password" value="MY-PASSWORD" /><br> <param name="proxy" value="<a href="http://MY-SIP.pstn.twilio.com" target="_blank">MY-SIP.pstn.twilio.com</a>"/><br> <param name="register" value="false"/><br> </gateway><br></include><br><br></div>This is my 02_twilio.xml in dialplan/default/:<br><br><include><br> <extension name="international.twilio"><br> <condition field="${toll_allow}" expression="international"/><br> <condition field="destination_number" expression="^(\d{10})$"><br> <action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/><br> <action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/><br> <action application="bridge" data="sofia/gateway/Twilio-outbound/$1"/><br> </condition><br> </extension><br></include><br><br></div>When I try and make a call for a Danish number (for example 4512345678) I get a "Bad Request 400".<br><br></div>This is my FS log:<br><br>freeswitch@MY-SIP> 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" target="_blank">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 <4561912233>->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" target="_blank">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" target="_blank">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" target="_blank">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>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" rel="noreferrer" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>