<div dir="ltr">Thank you <b style="color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium">Varghese Paul</b><span style="color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium">  for looking my post.</span><div>

<span style="color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium"><br></span></div><div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">My topology is like this:</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">SIP trunk provider   ----------   my FreeSwitch  --------------  Elastix  ------------  X-Lite </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Today, I make it work on the public IP asterisk registered to public IP FreeSwitch.<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">original issue might be I put the wrong register string in Elastix. ( should be    username:passwd@realm and yesterday was username:passwd@realm/username )</div>

<div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Means I can accept the phone from SIP trunk provider to FreeSwitch, and forward to Elastix, however, in Elastix, can not get my real DID ( in my Asterisk log, showes </div>

<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Executing [s@from-pstn:1] Set(&quot;SIP/ABCDE-0000007f&quot;, &quot;__FROM_DID=s&quot;) in new stack</div>

<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">So I guess, I need put application &quot;set“ in my dialplan of my freeswitch, right ?</div>

<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">my current public dialplan of my number from SIP trunk provider like this.</div>

<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><div><br></div><div>&lt;extension name=&quot;abctel-inbound-1234&quot;&gt;</div><div>    &lt;condition field=&quot;destination_number&quot;</div><div>

      expression=&quot;^<a href="tel:%286472221234" value="+16472221234" target="_blank">(6472221234</a>)$&quot;&gt;</div><div>      &lt;action application=&quot;set&quot;</div><div>        data=&quot;domain_name=$${domain}&quot;/&gt;</div>

<div>      &lt;action application=&quot;bridge&quot; data=&quot;user/$1&quot;/&gt;</div><div>    &lt;/condition&gt;</div><div>  &lt;/extension&gt;</div></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">and in my directory/default, I have a file <a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>.xml</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><div>&lt;include&gt;</div><div>  &lt;user id=&quot;<a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>&quot;&gt;</div>

<div>    &lt;params&gt;</div><div>      &lt;param name=&quot;password&quot; value=&quot;$${default_password}&quot;/&gt;</div><div>      &lt;param name=&quot;vm-password&quot; value=&quot;1234&quot;/&gt;</div><div>    &lt;/params&gt;</div>

<div>    &lt;variables&gt;</div><div>      &lt;variable name=&quot;toll_allow&quot; value=&quot;domestic,international,local&quot;/&gt;</div><div>      &lt;variable name=&quot;accountcode&quot; value=&quot;<a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>&quot;/&gt;</div>

<div>      &lt;variable name=&quot;user_context&quot; value=&quot;default&quot;/&gt;</div><div>      &lt;variable name=&quot;effective_caller_id_name&quot; value=&quot;ABCDE&quot;/&gt;</div><div>      &lt;variable name=&quot;effective_caller_id_number&quot; value=&quot;<a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>&quot;/&gt;</div>

<div>      &lt;variable name=&quot;outbound_caller_id_name&quot; value=&quot;ABCDE&quot;/&gt;</div><div>      &lt;variable name=&quot;outbound_caller_id_number&quot; value=&quot;$${outbound_caller_id}&quot;/&gt;</div><div>

      &lt;variable name=&quot;callgroup&quot; value=&quot;techsupport&quot;/&gt;</div><div>    &lt;/variables&gt;</div><div>  &lt;/user&gt;</div><div>&lt;/include&gt;</div></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">What I expect is in Asterisk side, should be my DID from FreeSwitch to Asterisk as </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

&quot;__FROM_DID=<a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>&quot;<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

What&#39;s my missing in Dialplan ? or director /default / <a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a>.xml ?</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<br>
</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">in the freeswitch wiki, it said exten to exten need put context = from-internal, and I did this by from-pstn. </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">my Asterisk trunk like this:</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<div>host=1.1.1.1</div><div>username=<a href="tel:6472221234" value="+16472221234" target="_blank">6472221234</a></div><div>secret=xxxxxxxxxxxxxxx</div><div>type=friend</div><div>port=5060</div><div>qualify=no</div><div>
insecure=very</div>
<div>dtmfmode=rfc2833</div><div>deny=<a href="http://0.0.0.0/0.0.0.0" target="_blank">0.0.0.0/0.0.0.0</a></div><div>permit=<a href="http://1.1.1.1/255.255.255.255" target="_blank">1.1.1.1/255.255.255.255</a></div><div>jbenable=no</div>

<div>disallow=all</div><div>context=from-pstn</div><div>allow=ulaw</div><div>trustpid=yes</div><div>sendrpid=yes</div></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

register string is :</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><a href="mailto:6472221234%3Axxxxxxxxxxxx@1.1.1.1" target="_blank">6472221234:xxxxxxxxxxxx@1.1.1.1</a><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">any idea please let me know.</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">--------------------------------------------</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">My another problem here is the NAT I guess, </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

if my asterisk in my LAN (FreeSwitch still on the public IP. ) </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

the same register shows in my asterisk cli </div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><div>abc*CLI&gt; sip show registry</div><div>Host                                    dnsmgr Username       Refresh State                Reg.Time</div>

<div><a href="http://1.1.1.1:5060/" target="_blank">1.1.1.1:5060</a>                        N      1009               120 Request Sent</div></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>

</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">can not register on the FreeSwitch.</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Thank you again.</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">

Sincerely,</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Shaw</div></div></div>