<div dir="ltr"><div><div><div>Tanguy,<br><br></div>setting the auto_to_user should set the destination number field to the correct one according to the wiki<br><br>&quot;Note: <i>extension</i> parameter influence the contents of channel variable <i>Caller-Destination-Number</i> and <i>destination_number</i>. If it is blank, <i>Caller-Destination-Number</i> will always be set to gateway&#39;s username. If it has a value, <i>Caller-Destination-Number</i> will always be set to this value. If it has value <i>auto_to_user</i>, <i>Caller-Destination-Number</i> will be populated with value <i>${sip_to_user}</i> which means the real dialed number in case of an inbound call.&quot;<br><br></div>from: <a href="https://wiki.freeswitch.org/wiki/Sofia.conf.xml" target="_blank">https://wiki.freeswitch.org/wiki/Sofia.conf.xml</a><br><br></div>where is this config that you listed currently located? (full file path please)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 1, 2015 at 2:03 PM, Tanguy <span dir="ltr">&lt;<a href="mailto:phenix@vfemail.net" target="_blank">phenix@vfemail.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello<br>
    <br>
    With or without the extension parameter, it&#39;s exactly the same.<br>
    <br>
    Thanks<div><div class="h5"><br>
    <br>
    On 01/05/2015 20:04, Stanislav Sinyagin wrote:
    <blockquote type="cite">
      <p dir="ltr">Remove the extension parameter and see if it helps.</p>
      <div class="gmail_quote">On May 1, 2015 6:11 PM, &quot;Tanguy&quot; &lt;<a href="mailto:phenix@vfemail.net" target="_blank">phenix@vfemail.net</a>&gt;
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div text="#000000" bgcolor="#FFFFFF"> Hello, <br>
            <br>
            My provider did not send correct DID number in the INVITE
            packet but i can use &quot;To&quot; argument<br>
            <br>
            <tt>INVITE <a href="mailto:sip:gw+0a96c3d3-0b0e-4864-b9ec-759fa4422429@92.222.18.xxx:5080;transport=udp;gw=0a96c3d3-0b0e-4864-b9ec-759fa4422429" target="_blank">sip:gw+0a96c3d3-0b0e-4864-b9ec-759fa4422429@92.222.18.xxx:5080;transport=udp;gw=0a96c3d3-0b0e-4864-b9ec-759fa4422429</a>
              SIP/2.0.<br>
              Call-ID: <a href="mailto:25016-VB-188fd96b-526e3dbd4@sip.ovh.fr" target="_blank">25016-VB-188fd96b-526e3dbd4@sip.ovh.fr</a>.<br>
              Contact: &lt;sip:<a href="http://10.7.1.60:5060" target="_blank">10.7.1.60:5060</a>&gt;.<br>
              Content-Type: application/sdp.<br>
              CSeq: 403749831 INVITE.<br>
              From: &quot;0967212xxx&quot;
              <a href="mailto:sip:0967212xxx@sip.ovh.fr;user=phone" target="_blank">&lt;sip:0967212xxx@sip.ovh.fr;user=phone&gt;</a>;tag=25016-VE-188fd96c-18bb43586.<br>
              Max-Forwards: 27.<br>
              Record-Route: &lt;sip:91.121.129.20:5060;lr&gt;.<br>
              <b>To: <a href="mailto:sip:0557590xxx@10.7.1.60;user=phone" target="_blank">&lt;sip:0557590xxx@10.7.1.60;user=phone&gt;</a>.</b><br>
              Via: SIP/2.0/UDP
              91.121.129.20:5060;branch=z9hG4bK-WGZO-1fe73949-2df58378.</tt><br>
            <br>
            Using asterisk i can bypass the issue using something like 
            <tt>exten =&gt;
              s,1,Goto(from-trunk,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)</tt>
            but i am unable to do the same under freeswitch.<br>
            <br>
            My trunk configuration seems correct, as you can see i used 
            auto_to_user, but the destination number remains <tt>0033972480xxx

              when i call 0557590xxx.</tt><br>
            <br>
            2015-05-01 18:02:12.235827 [INFO] mod_dialplan_xml.c:635
            Processing 0967212xxx &lt;0967212xxx&gt;-&gt;0033972480xxx
            in context public<br>
            <br>
            <br>
            <tt>&lt;include&gt;<br>
                  &lt;gateway
              name=&quot;0a96c3d3-0b0e-4864-b9ec-759fa4422429&quot;&gt;<br>
                    &lt;param name=&quot;username&quot; value=&quot;0033972480xxx&quot;/&gt;<br>
                    &lt;param name=&quot;password&quot; value=&quot;xxxxxxx&quot;/&gt;<br>
                    &lt;param name=&quot;proxy&quot; value=&quot;<a href="http://sip.ovh.fr" target="_blank">sip.ovh.fr</a>&quot;/&gt;<br>
                    &lt;param name=&quot;expire-seconds&quot; value=&quot;800&quot;/&gt;<br>
                    &lt;param name=&quot;register&quot; value=&quot;true&quot;/&gt;<br>
                    &lt;param name=&quot;retry-seconds&quot; value=&quot;30&quot;/&gt;<br>
                    &lt;param name=&quot;extension&quot; value=&quot;auto_to_user&quot;/&gt;<br>
                    &lt;param name=&quot;context&quot; value=&quot;public&quot;/&gt;<br>
                  &lt;/gateway&gt;<br>
              &lt;/include&gt;</tt><br>
            <br>
            I tried to edit my inbound dialplan manually, it works
            using  &lt;condition field=&quot;${sip_to_user}&quot;
            expression=&quot;0557590xxx&quot; &gt; but i prefer a proper way to do
            this because i will also use telcos with normal invite
            packets<br>
            <br>
            I how i can copy $sip_to_header to destination for this
            specific trunk ?<br>
            <br>
            Please note that i use fusionpbx.<br>
            <br>
            Best regards, sorry for my bad English<br>
             <br>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div></div></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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>