Dear all<br><br>I followed tutorial from SER-Getting Start document for Mediaproxy to solve nat problem.<br>I read on the Openser document <br><a href="http://www.openser.org/docs/modules/1.2.x/usrloc.html#AEN83" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.openser.org/docs/modules/1.2.x/usrloc.html#AEN83
</a><br>I have to use modparam("usrloc", "nat_bflag", 6) instead of modparam("registrar", "nat_flag", 6)<br><br>And from the documentation, it said<br>"When SIP clients attempt to REGISTER with our SIP proxy we need a way to tell the registrar module to
<br>store NAT information for any particular UA. We do this by using flag 6, which has been arbitrarily chosen<br>(but defined earlier in the loadmodule parameter section). We could have specified another integer here, but
<br>flag 6 seems to be the accepted standard for nat_flag.<br><br>If the nat_flag is set before calling the save() function to store contact information, SER will preserve the<br>NAT contact information as well as set the flags column in the MySQL location table. By doing so, we can
<br>call lookup(location) when processing messages and flag 6 will be set for NATed clients."<br><br>I have a NAT UA is detected as NAT-ed UA by Openser with below rule and do setflag(6); before it does save("location");
<br><br>Why in mysql, location table, i see the flags column still 0 instead of 6 ?<br><br>Did I miss something?<br>Please help :(<br><br><br># $Id: nat-mediaproxy.cfg 51 2006-01-31 13:28:04Z /CN=Paul Hazlett/emailAddress=
<a href="mailto:paul@onsip.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">paul@onsip.org</a> $<br>debug=3<br>fork=no<br>log_stderror=yes<br>#alias="<a href="http://halodns.powere2e.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
halodns.powere2e.com</a>"<br><br>listen=x.x.x.x # INSERT YOUR IP ADDRESS HERE
<br>port=5060<br>children=4<br><br>dns=no<br>rev_dns=no<br><br>loadmodule "/usr/local/lib/openser/modules/mysql.so"<br>loadmodule "/usr/local/lib/openser/modules/sl.so"<br>loadmodule "/usr/local/lib/openser/modules/tm.so"
<br>loadmodule "/usr/local/lib/openser/modules/rr.so"<br>loadmodule "/usr/local/lib/openser/modules/maxfwd.so"<br>loadmodule "/usr/local/lib/openser/modules/usrloc.so"<br>loadmodule "/usr/local/lib/openser/modules/registrar.so"
<br>loadmodule "/usr/local/lib/openser/modules/auth.so"<br>loadmodule "/usr/local/lib/openser/modules/auth_db.so"<br>loadmodule "/usr/local/lib/openser/modules/uri.so"<br>loadmodule "/usr/local/lib/openser/modules/uri_db.so"
<br>loadmodule "/usr/local/lib/openser/modules/domain.so"<br>loadmodule "/usr/local/lib/openser/modules/mediaproxy.so"<br>loadmodule "/usr/local/lib/openser/modules/nathelper.so"<br>loadmodule "/usr/local/lib/openser/modules/textops.so"
<br>loadmodule "/usr/local/lib/openser/modules/xlog.so"<br>loadmodule "/usr/local/lib/openser/modules/mi_fifo.so"<br><br>modparam("mi_fifo","fifo_name","/tmp/openser_fifo")
<br><br>modparam("auth_db|domain|uri_db|usrloc", "db_url", "mysql://openser:openserrw@localhost/openser")<br>modparam("auth_db", "calculate_ha1", 1)<br>modparam("auth_db", "password_column", "password")
<br><br>modparam("nathelper|registrar", "received_avp", "$avp(i:42)")<br>modparam("nathelper", "rtpproxy_disable", 1)<br>modparam("nathelper", "natping_interval", 0)
<br><br>modparam("mediaproxy","natping_interval", 30)<br>modparam("mediaproxy","mediaproxy_socket", "/var/run/mediaproxy.sock")<br>modparam("mediaproxy","sip_asymmetrics","/usr/local/etc/openser/sip-clients")
<br>modparam("mediaproxy","rtp_asymmetrics","/usr/local/etc/openser/rtp-clients")<br><br><br>modparam("usrloc", "db_mode", 2)<br>modparam("usrloc", "nat_bflag", 6) <- set to 6
<br><br>modparam("rr", "enable_full_lr", 1)<br><br>.<br>.<br>.<br>.<br><br>route[2] {<br><br> # -----------------------------------------------------------------<br> # REGISTER Message Handler
<br> # ----------------------------------------------------------------<br> xlog("L_NOTICE","$Cxg Enter Route[2]: REGISTER $Cxx\n");<br><br> sl_send_reply("100", "Trying");
<br><br> if (!search("^Contact:[ ]*\*") && client_nat_test("2")) {<br> setflag(6);<br> fix_nated_register();<br> force_rport(); <br>
};<br><br> if (!www_authorize("","subscriber")) {<br> www_challenge("","0");<br> return;<br> };<br><br> if (!check_to()) {
<br> sl_send_reply("401", "Unauthorized");<br> return;<br> };<br><br> consume_credentials();<br><br> if (!save("location")) {<br> sl_reply_error();
<br> };<br>}<br><br><br>