<div dir="ltr"><div><div><div><div>Hi all,<br><br><br></div><div>------------------FREESWITCH--------------(bridge=sofia/external/sip:outbound-opensip.com:5060)-----------OPENSIP----------------------<br></div><div><br></div>
I am facing NAT problem when i am dialing SIP URI via sip profile. When i am dialing the SIP uri with Gateway trunk NAT is working properly.<br><br></div>Dialing SIP URI <br><br>&lt;action application=&quot;bridge&quot;  data=&quot;sofia/external/sip:<a href="http://outbound-opensip.com:5060">outbound-opensip.com:5060</a>&quot;<br>
<br></div>In external profile setting I made the setting for ext-rtp-ip and ext-sip-ip. In freeswitch cli &quot;sofia status profile external&quot; i am able to see the external rtp and sip ip correctly.<br><br>But when freeswitch sending INVITE external IPs are not set in<span style="background-color:rgb(204,0,0)"> SDP and FROM</span> Header, instead it is using local IP. When i tried to debug the problem in switch_core_media.c freeswitch failed to check the NAT settings.<br>
<br></div><div>switch_core_media.c <br><br>SWITCH_DECLARE(switch_status_t) switch_core_media_choose_port(switch_core_session_t *session, switch_media_type_t type, int force)<br></div><div><br><span style="background-color:rgb(204,0,0)">/* Check if NAT is detected  */<br>
    if (!zstr(smh-&gt;mparams-&gt;remote_ip) &amp;&amp; switch_core_media_check_nat(smh, smh-&gt;mparams-&gt;remote_ip)) {<br>        /* Yes, map the port through switch_nat */<br></span></div><span style="background-color:rgb(204,0,0)">        /* Code */<br>
</span><div><span style="background-color:rgb(204,0,0)">    } else {<br>        /* No NAT traversal required, use the profile&#39;s rtp ip */<br>        use_ip = smh-&gt;mparams-&gt;rtpip;<br>    }    </span><br><br></div>
<div>Here remote IP is NULL always when i am dialing URI with external profile. When I tried to make call  by &quot;sofia/gateway/trunk/sip:<a href="http://outbound-opensip.com:5060">outbound-opensip.com:5060</a>&quot; i can see the remote ip as &quot;<a href="http://oubound-opensip.com">oubound-opensip.com</a>&quot; and its able to external IP in SDP. <br>
<br></div><div>Can any body tell how to solve this problem ? Is there any configuration to set relam in dialplan ? <br><br></div><div>I am using freeswitch version 1.5.6.  <br><br></div><div>Hopping the earliest response.<br>
<br>Regards<br><br></div><div>Andrew <br></div></div>