Dear All,<br><br>I use Opensips 1.4.1 with rtpproxy 1.2 for NAT support.<br><br>I use X-Lite which is Behind NAT, register to OpenSIPs proxy, Opensips store right contact address. But, when i use Nokia E66 to register to Opensips, the contact address is bellow: <br>

<br>Online SIP Users<br>Username Domain Contact Expires User Agent<br>5000 <b><font color="#ff0000"><a href="mailto:sip%3A5000@192.168.1.100" target="_blank">sip:5000@192.168.1.100</a>;transport=UDP</font></b> 2009-03-30 07:20:24.0 E66-1 RM-343 102.07.81<br>

<br>User 5000 do not store with external IP address of its (external address not 192.168.1.100). Do you have any ideas about this?<br><br>Bellow is my Opensips.conf<br><br>Thanks and Regards,<br><br>-LN<br><br>Opensips.conf<br>

<br><p>==================<br><br>####### Global Parameters #########<br><br>debug=4<br>log_stderror=yes<br>log_facility=LOG_LOCAL0<br><br>fork=yes<br>children=4<br><br>/* uncomment the following lines to enable debugging */<br>
#debug=6<br>#fork=no<br>#log_stderror=yes<br><br>#disable_tcp=yes<br>#disable_dns_blacklist=no<br>#dns_try_ipv6=yes<br>#auto_aliases=no<br><br>/* uncomment the following lines to enable TLS support  (default off) */<br>#disable_tls = no<br>
#listen = tls:your_IP:5061<br>#tls_verify_server = 1<br>#tls_verify_client = 1<br>#tls_require_client_certificate = 0<br>#tls_method = TLSv1<br>#tls_certificate = &quot;//etc/opensips/tls/user/user-cert.pem&quot;<br>#tls_private_key = &quot;//etc/opensips/tls/user/user-privkey.pem&quot;<br>
#tls_ca_list = &quot;//etc/opensips/tls/user/user-calist.pem&quot;<br><br><br>port=5060<br>listen=udp:MY_OPENSIP_IP:5060<br><br><br>####### Modules Section ########<br><br>#set module path<br>mpath=&quot;//lib/opensips/modules/&quot;<br>
<br>/* uncomment next line for MySQL DB support */<br>loadmodule &quot;db_mysql.so&quot;<br>loadmodule &quot;sl.so&quot;<br>loadmodule &quot;tm.so&quot;<br>loadmodule &quot;rr.so&quot;<br>loadmodule &quot;maxfwd.so&quot;<br>
loadmodule &quot;usrloc.so&quot;<br>loadmodule &quot;registrar.so&quot;<br>loadmodule &quot;textops.so&quot;<br>loadmodule &quot;mi_fifo.so&quot;<br>loadmodule &quot;uri_db.so&quot;<br>loadmodule &quot;uri.so&quot;<br>loadmodule &quot;xlog.so&quot;<br>
loadmodule &quot;acc.so&quot;<br>loadmodule &quot;auth.so&quot;<br>loadmodule &quot;auth_db.so&quot;<br><br>#loadmodule &quot;presence.so&quot;<br>#loadmodule &quot;presence_xml.so&quot;<br><br>loadmodule &quot;nathelper.so&quot;<br>
loadmodule &quot;avpops.so&quot;<br>######################<br><br><br>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/opensips_fifo&quot;)<br>modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)<br>modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)<br>
modparam(&quot;registrar&quot;, &quot;method_filtering&quot;, 1)<br><br>/* uncomment the next line to disable parallel forking via location */<br># modparam(&quot;registrar&quot;, &quot;append_branches&quot;, 0)<br>/* uncomment the next line not to allow more than 10 contacts per AOR */<br>
#modparam(&quot;registrar&quot;, &quot;max_contacts&quot;, 10)<br>modparam(&quot;uri_db&quot;, &quot;use_uri_table&quot;, 1)<br>modparam(&quot;uri_db&quot;, &quot;db_url&quot;, &quot;mysql://sermyadmin:secret@MY_DATABASE_IP/sermyadmin&quot;)<br>
#them for bug9, like guide in bug9<br>modparam(&quot;uri_db&quot;, &quot;db_table&quot;, &quot;uri&quot;)<br><br><br># ----- acc params -----<br>/* what sepcial events should be accounted ? */<br>modparam(&quot;acc&quot;, &quot;early_media&quot;, 1)<br>
modparam(&quot;acc&quot;, &quot;report_ack&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)<br>modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)<br>
modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 2)<br>modparam(&quot;acc&quot;, &quot;db_flag&quot;, 1)<br>modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, 2)<br>
<br>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;,   2)<br>modparam(&quot;usrloc&quot;, &quot;db_url&quot;,<br>    &quot;mysql://sermyadmin:secret@MY_DATABASE_IP/sermyadmin&quot;)<br><br>modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)<br>
modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)<br>modparam(&quot;auth_db|permission&quot;, &quot;db_url&quot;,<br>    &quot;mysql://sermyadmin:secret@MY_DATABASE_IP/sermyadmin&quot;)<br></p>
<p>modparam(&quot;avpops&quot;, &quot;avp_url&quot;, &quot;mysql://sermyadmin:secret@MY_DATABASE_IP/sermyadmin&quot;)<br>modparam(&quot;avpops&quot;, &quot;avp_table&quot;, &quot;usr_preferences&quot;)<br><br>#try for fix error of Mobile Address<br>
modparam(&quot;registrar&quot;, &quot;received_avp&quot;, &quot;$avp(s:rcv)&quot;)<br>modparam(&quot;nathelper&quot;, &quot;received_avp&quot;, &quot;$avp(s:rcv)&quot;)<br><br>#Theo guide <a href="http://www.opensips.org/html/docs/modules/1.4.x/registrar.html">http://www.opensips.org/html/docs/modules/1.4.x/registrar.html</a><br>
modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, 6) <br>modparam(&quot;nathelper&quot;, &quot;ping_nated_only&quot;, 1)<br>modparam(&quot;nathelper&quot;, &quot;sipping_bflag&quot;, 8)<br><br>#modparam(&quot;nathelper&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:MY_RTPPROXY_IP:7890&quot;)<br>
modparam(&quot;nathelper&quot;, &quot;force_socket&quot;, &quot;udp:MY_RTPPROXY_IP:7890&quot;)<br>modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 89)<br>modparam(&quot;nathelper&quot;, &quot;sipping_from&quot;, &quot;sip:1000@MY_OPENSIP_IP&quot;)<br>
<br><br># main request routing logic<br><br>route {<br><br>    # -----------------------------------------------------------------<br>    # Sanity Check Section<br>    # -----------------------------------------------------------------<br>
    if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>        sl_send_reply(&quot;483&quot;, &quot;Too Many Hops&quot;);<br>        exit;<br>    }<br><br>    if (msg:len &gt; max_len) {<br>        sl_send_reply(&quot;513&quot;, &quot;Message Overflow&quot;);<br>
        exit;<br>    }<br><br>    # -----------------------------------------------------------------<br>    # Record Route Section<br>    # -----------------------------------------------------------------<br>    if (method!=&quot;REGISTER&quot;) {<br>
        record_route();<br>    }<br><br>    if (method==&quot;BYE&quot; || method==&quot;CANCEL&quot;) {<br>        unforce_rtp_proxy();<br>    } <br><br>    # -----------------------------------------------------------------<br>
    # Loose Route Section<br>    # -----------------------------------------------------------------<br>    if (loose_route()) {<br><br>        if ((method==&quot;INVITE&quot; || method==&quot;REFER&quot;) &amp;&amp; !has_totag()) {<br>
            sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>            exit;<br>        }<br><br>        if (method==&quot;INVITE&quot;) {<br><br>            if (!proxy_authorize(&quot;MY_OPENSIPS_IP&quot;,&quot;subscriber&quot;)) {<br>
                proxy_challenge(&quot;MY_OPENSIPS_IP&quot;,&quot;0&quot;);<br>                exit;<br>            } else if (!check_from()) {<br>                sl_send_reply(&quot;403&quot;, &quot;Use From=ID&quot;);<br>
                exit;<br>            }<br>            consume_credentials();<br><br>            if (nat_uac_test(&quot;19&quot;)) {<br>                setflag(6);<br>                force_rport();<br>                fix_nated_contact();<br>
            }<br>            force_rtp_proxy(&quot;l&quot;);<br>        }<br>        route(1);<br>        exit;<br>    }<br><br>    # -----------------------------------------------------------------<br>    # Call Type Processing Section<br>
    # -----------------------------------------------------------------<br>    if (uri!=myself) {<br>        route(4);<br>        route(1);<br>        exit;<br>    }<br><br>    if (method==&quot;ACK&quot;) {<br>        route(1);<br>
        exit;<br>    } else if (method==&quot;CANCEL&quot;) {<br>        route(1);<br>        exit;<br>    } else if (method==&quot;INVITE&quot;) {<br>        route(3);<br>        exit;<br>    } else  if (method==&quot;REGISTER&quot;) {<br>
        route(2);<br>        exit;<br>    }<br><br>    lookup(&quot;aliases&quot;);<br>    if (uri!=myself) {<br>        route(4);<br>        route(1);<br>        exit;<br>    }<br><br>    if (!lookup(&quot;location&quot;)) {<br>
        sl_send_reply(&quot;404&quot;, &quot;User Not Found&quot;);<br>        exit;<br>    }<br><br>    route(1);<br>}<br><br>route[1] {<br><br>    # -----------------------------------------------------------------<br>    # Default Message Handler<br>
    # -----------------------------------------------------------------<br><br>    t_on_reply(&quot;1&quot;);<br><br>    if (!t_relay()) {<br>        if (method==&quot;INVITE&quot; &amp;&amp; isflagset(6)) {<br>            unforce_rtp_proxy();<br>
        };<br>        sl_reply_error();<br>    }<br>}<br><br>route[2] {<br><br>    # -----------------------------------------------------------------<br>    # REGISTER Message Handler<br>    # ----------------------------------------------------------------<br>
<br>    if (!search(&quot;^Contact:[ ]*\*&quot;) &amp;&amp; nat_uac_test(&quot;19&quot;)) {<br>        setflag(6);<br>        fix_nated_register();<br>        force_rport();<br>    }<br><br>    sl_send_reply(&quot;100&quot;, &quot;Trying&quot;);<br>
<br>    if (!www_authorize(&quot;MY_OPENSIPS_IP&quot;,&quot;subscriber&quot;)) {<br>        www_challenge(&quot;MY_OPENSIPS_IP&quot;,&quot;0&quot;);<br>        exit;<br>    }<br><br>    #if (!check_to()) {<br>    #    sl_send_reply(&quot;401&quot;, &quot;Unauthorized Loi Ngo&quot;);<br>
    #    exit;<br>    #}<br><br>    consume_credentials();<br><br>    if (!save(&quot;location&quot;)) {<br>        sl_reply_error();<br>    };<br>}<br><br>route[3] {<br><br>    # -----------------------------------------------------------------<br>
    # INVITE Message Handler<br>    # -----------------------------------------------------------------<br>    <br>    #Drop because error Use From=ID when call. Open<br>    #if (!proxy_authorize(&quot;&quot;,&quot;subscriber&quot;)) {<br>
    #    proxy_challenge(&quot;&quot;,&quot;0&quot;);<br>    #    exit;<br>    #} else if (!check_from()) {<br>    #    sl_send_reply(&quot;403&quot;, &quot;Use From=ID&quot;);<br>    #    exit;<br>    #}<br><br>    #consume_credentials();<br>
<br>    if (nat_uac_test(&quot;19&quot;)) {<br>        setflag(6);<br>    }<br><br>    lookup(&quot;aliases&quot;);<br>    if (uri!=myself) {<br>        route(4);<br>        route(1);<br>        exit;<br>    }<br><br>    if (!lookup(&quot;location&quot;)) {<br>
        sl_send_reply(&quot;404&quot;, &quot;User Not Found&quot;);<br>        exit;<br>    }<br><br>    route(4);<br>    route(1);<br>}<br><br>route[4] {<br><br>    # -----------------------------------------------------------------<br>
    # NAT Traversal Section<br>    # -----------------------------------------------------------------<br><br>    if (isflagset(6)) {<br>        force_rport();<br>        fix_nated_contact();<br>        force_rtp_proxy();<br>
    }<br>}<br><br>onreply_route[1] {<br><br>    if (isflagset(6) &amp;&amp; status=~&quot;(180)|(183)|2[0-9][0-9]&quot;) {<br>        if (!search(&quot;^Content-Length:[ ]*0&quot;)) {<br>            force_rtp_proxy();<br>
        }<br>    }<br><br>    if (nat_uac_test(&quot;1&quot;)) {<br>        fix_nated_contact();<br>    }<br>}<br></p><p></p>