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