<div dir="ltr">Hello Miha,<div><br></div><div>The best way to handle nat keep alive is from your sip clients. They usually offer a variety of option and the most efficient one is the udp pinging, in which it keeps sending opensips a udp packet with 4 zeros in it to keep the nat binding open. That would work perfectly if you have static nat binding on the opensips server which means doing port forwarding on the firewall the opensips sits behind.</div>
<div><br></div><div>You can also enable options pinging on your client as well and that will keep nats open on both side as opensips will respond with 200 OK.</div><div><br></div><div>Enabling nat keep alive from opensips is more expensive in terms of resources but that is also a possible way to do.</div>
<div><br></div><div>Regards,</div><div>Ali Pey</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 12, 2013 at 7:16 AM, Miha <span dir="ltr"><<a href="mailto:miha@softnet.si" target="_blank">miha@softnet.si</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
HI,<br>
<br>
I need a little help with nat. UAC register's ok and it is reachable
but after a while it become unreachable due to nat issue. If I use
nat_keepalive on uac deivce everything is ok, but I would like that
this is handled by opensips.<br>
<br>
I tried to use nat_keepalive but getting all the time this:<br>
<br>
54.820695 opensips -> uac_public_ip SIP 308 Request: NOTIFY
<a>sip:uac_public_ip:13401</a> |<br>
54.829847 uac_public_ip -> opensips SIP 297 Status: <b>481 Call
Leg/Transaction Does Not Exis</b>t |<br>
<br>
What is the best way to implement this?<br>
<br>
<br>
<br>
modparam("registrar", "received_avp", "$avp(received_avp)")<br>
modparam("registrar", "tcp_persistent_flag", 10)<br>
modparam("nathelper", "received_avp", "$avp(received_avp)")<br>
modparam("nathelper", "natping_interval", 10)<br>
modparam("nathelper", "ping_nated_only", 1)<br>
<br>
<br>
if (nat_uac_test("18")) {<br>
xlog("fixing nat");<br>
if (method=="REGISTER") {<br>
nat_keepalive();<br>
fix_nated_register();<br>
<br>
} else {<br>
fix_nated_contact();<br>
}<br>
force_rport();<br>
}<br>
<br>
tnx!<span class="HOEnZb"><font color="#888888"><br>
<br>
miha<br>
<br>
<br>
</font></span></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>