<div dir="ltr">Hi,<div><br></div><div>I only add the two defines.The follow is my settings.</div><div><br></div><div>







<p class=""><span class=""> </span>#!define <span class="">WITH_NAT</span></p>
<p class=""> #!define <span class="">WITH_NAT</span>SIPPIN</p></div><div>







<p class=""><span class=""> </span>modparam("<span class="">nathelper</span>", "natping_interval", 30)<br></p>
<p class=""><span class=""> </span>modparam("<span class="">nathelper</span>", "ping_nated_only", 1)</p>
<p class=""><span class=""> </span>modparam("<span class="">nathelper</span>", "sipping_bflag", FLB_NATSIPPING)</p>
<p class=""><span class=""> </span>modparam("<span class="">nathelper</span>", "sipping_from", "<a href="mailto:sip%3Apinger@kamailio.org">sip:pinger@kamailio.org</a>")</p>
<p class=""><span class=""> </span>modparam("<span class="">nathelper</span>|registrar", "received_avp", "$avp(RECEIVED)")<br></p><p class=""><br></p><p class="">Does the kamailio server send OPTIONS packages?If the server doesn't send,the configure file must have error.</p><p class="">Lucky.</p><p class=""><br></p><p class="">Xuefeng Zhang</p><p class=""><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-22 20:51 GMT+08:00 Filip Malenka <span dir="ltr"><<a href="mailto:filip.malenka@gmail.com" target="_blank">filip.malenka@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Xuefeng,<br>
<br>
did you do set any other module parameters?<br>
I can't get it to work..<br>
<br>
My UAs uregister only because of expire=300, that means that they go<br>
offline after 5 minutes. Usually UAs have much higher expire=3600, does<br>
that mean they would go offline in 1 hour?<br>
<br>
I hoped, that when I set<br>
<br>
#!define WITH_NAT<br>
#!define WITH_NATSIPPING<br>
<br>
# ----- nathelper params -----<br>
modparam("nathelper", "natping_interval", 10)<br>
# modparam("nathelper", "ping_nated_only", 1)<br>
modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)<br>
modparam("nathelper", "sipping_from", "<a href="mailto:sip%3Apinger@kamailio.org">sip:pinger@kamailio.org</a>")<br>
modparam("nathelper", "keepalive_timeout", 40)<br>
<br>
and<br>
<br>
# ----- presence params -----<br>
modparam("presence", "db_url", DBURL)<br>
modparam("presence", "clean_period", 10)<br>
modparam("presence", "db_update_period", 10)<br>
<br>
that my UAs will get "offline" as soon as in 40 seconds..<br>
Where did I go wrong?<br>
Thanks.<br>
<span class=""><br>
On <a href="tel:22.04.2015%2004" value="+12204201504">22.04.2015 04</a>:21, xuefeng zhang wrote:<br>
> Hi all,<br>
><br>
> I add the WITH_NAT and WITH_NATSIPPING and it works ok.The account will<br>
> unregister after 3 minutes.<br>
><br>
> Thank you very much.<br>
><br>
> Xuefeng Zhang<br>
><br>
> 2015-04-21 17:43 GMT+08:00 Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
</span>> <mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>>>:<br>
<div><div class="h5">><br>
>     Hello,<br>
><br>
>     On 21/04/15 07:07, Mickael Marrache wrote:<br>
>>     Hi,<br>
>><br>
>>     IIR means If I Remember.<br>
>     indeed, thanks for completing -- it was a result of incomplete<br>
>     typing as I wanted to use IIRC (if i remember correctly), which is<br>
>     more standard acronym out there.<br>
><br>
>     Xuefeng: sending keepalives is done via nathelper module, by seeting<br>
>     sipping branch flag when processing REGISTER requests - see:<br>
><br>
>     -<br>
>     <a href="http://kamailio.org/docs/modules/4.2.x/modules/nathelper.html#nathelper.p.sipping_bflag" target="_blank">http://kamailio.org/docs/modules/4.2.x/modules/nathelper.html#nathelper.p.sipping_bflag</a><br>
><br>
>     For a proper example of usage, see the default kamailio.cfg for v4.2<br>
>     - it has this feature inside, easy to enable with defines:<br>
><br>
>     #!define WITH_NAT<br>
>     #!define WITH_NATSIPPING<br>
><br>
>     Add those lines somewhere at the beginning of kamailio.cfg -- also,<br>
>     read the comments at the top of the kamailio.cfg, some notes about<br>
>     this are made there.<br>
><br>
>     Cheers,<br>
>     Daniel<br>
><br>
>><br>
>>     Are you also using keepalives sent by clients? I often read that<br>
>>     NATs don't refresh their mapping on incoming traffic, you may want<br>
>>     to take a look at client keepalives.<br>
>><br>
>>     Mickael<br>
>><br>
>>     On 21 באפר 2015, at 07:38, xuefeng zhang<br>
</div></div>>>     <<a href="mailto:zhangxuefeng1007@gmail.com">zhangxuefeng1007@gmail.com</a> <mailto:<a href="mailto:zhangxuefeng1007@gmail.com">zhangxuefeng1007@gmail.com</a>>><br>
<span class="">>>     wrote:<br>
>><br>
>>>     Hi Daniel,<br>
>>><br>
>>>     I understand your reply.The kamailio can set the "IIR" to send<br>
>>>     the OPTIONS packets period.<br>
>>>     But I don't found out the knowledge of the "IIR".<br>
>>><br>
>>>     Would you give me some things how to do it.<br>
>>><br>
>>>     Thanks!<br>
>>><br>
>>>     Xuefeng Zhang<br>
>>><br>
>>>     2015-04-20 18:10 GMT+08:00 Daniel-Constantin Mierla<br>
</span>>>>     <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a> <mailto:<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>>>:<br>
<div><div class="h5">>>><br>
>>>         IIR, the keepalives are sent stateless, so no transactions<br>
>>>         are create<br>
>>>         for them. Just OPTIONS packets sent out, resulting in less<br>
>>>         load on<br>
>>>         kamailio (well, comparing with normal transactional<br>
>>>         forwarding). The<br>
>>>         mechanism behind detecting offline users with keepalives is<br>
>>>         based on a<br>
>>>         counter kept in memory for the location record, which is<br>
>>>         reset if the<br>
>>>         reply to OPTIONS comes back. If there are three (or so)<br>
>>>         keepalives sent<br>
>>>         out and none was replied, then the record is removed.<br>
>>>         Practically there<br>
>>>         is no retransmission for those keepalive requests, no special<br>
>>>         states,<br>
>>>         just this counter in memory per location record. Given this,<br>
>>>         (again<br>
>>>         iirc), this feature doesn't work with db_mode set to database<br>
>>>         only.<br>
>>><br>
>>>         Cheers,<br>
>>>         Daniel<br>
>>><br>
>>>         On 20/04/15 10:46, Mickael Marrache wrote:<br>
>>>         > Didn't know about that, it's interesting.<br>
>>>         ><br>
>>>         > I'm curious about the load impact of this feature, since<br>
>>>         keepalives are<br>
>>>         > generally sent every 30 sec.<br>
>>>         ><br>
>>>         > -----Original Message-----<br>
>>>         > From: sr-users<br>
>>>         [mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a><br>
>>>         <mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>>] On Behalf Of<br>
>>>         > Daniel Grotti<br>
>>>         > Sent: Monday, April 20, 2015 11:40 AM<br>
>>>         > To: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</div></div><span class="">>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
>>>         > Subject: Re: [SR-Users] Expect the kamailio's sip account<br>
>>>         is unregistered<br>
>>>         > state when the client app is shutdown<br>
>>>         ><br>
>>>         > Hi,<br>
>>>         > you may want to use:<br>
>>>         ><br>
>>>         ><br>
>>>         <a href="http://www.kamailio.org/docs/modules/4.2.x/modules/nathelper.html#nathelper" target="_blank">http://www.kamailio.org/docs/modules/4.2.x/modules/nathelper.html#nathelper</a>.<br>
>>>         > p.keepalive_timeout<br>
>>>         ><br>
>>>         ><br>
>>>         > --<br>
>>>         > Daniel Grotti<br>
>>>         > VoIP Engineer<br>
>>>         ><br>
>>>         ><br>
>>>         > Sipwise GmbH<br>
>>>         > Europaring F15 | 2345 Brunn am Gebirge, Austria |<br>
</span>>>>         <a href="http://www.sipwise.com" target="_blank">www.sipwise.com</a> <<a href="http://www.sipwise.com" target="_blank">http://www.sipwise.com</a>><br>
<span class="">>>>         ><br>
>>>         > On 04/20/2015 10:34 AM, Filip Malenka wrote:<br>
>>>         >> Thank you for information..<br>
>>>         >> What can Kamailio do about clients, that exit abnormally<br>
>>>         (e.g. crash, turn<br>
>>>         > off, ..) which do unregister properly? Can Kamailio send<br>
>>>         this "expire=0" on<br>
>>>         > behalf of these clients?<br>
>>>         >> Can Kamailio determine that a client got offline based on<br>
>>>         e.g. TLS<br>
>>>         > connection or other "heartbeats"?<br>
>>>         >> On 20.04.2015 10:16, Daniel Grotti wrote:<br>
>>>         >>> Hi,<br>
>>>         >>> here you are:<br>
>>>         >>><br>
>>>         >>> <a href="https://tools.ietf.org/html/rfc3665#section-2.4" target="_blank">https://tools.ietf.org/html/rfc3665#section-2.4</a><br>
>>>         >>><br>
>>>         >>><br>
>>>         >>><br>
>>>         >>> --<br>
>>>         >>> Daniel Grotti<br>
>>>         >>> VoIP Engineer<br>
>>>         >>><br>
>>>         >>><br>
>>>         >>> Sipwise GmbH<br>
>>>         >>> Europaring F15 | 2345 Brunn am Gebirge, Austria |<br>
</span>>>>         <a href="http://www.sipwise.com" target="_blank">www.sipwise.com</a> <<a href="http://www.sipwise.com" target="_blank">http://www.sipwise.com</a>><br>
<div><div class="h5">>>>         >>><br>
>>>         >>> On 04/20/2015 10:10 AM, Mickael Marrache wrote:<br>
>>>         >>>> Hi,<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> You need to configure your client to un register when<br>
>>>         the app is closed.<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> For that, your client must send a REGISTER with Expires: 0.<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> Mickael<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> *From:*sr-users<br>
>>>         [mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a><br>
>>>         <mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>>] *On<br>
>>>         >>>> Behalf Of *xuefeng zhang<br>
>>>         >>>> *Sent:* Monday, April 20, 2015 10:58 AM<br>
>>>         >>>> *To:* Daniel-Constantin Mierla; Kamailio (SER) - Users<br>
>>>         Mailing List<br>
>>>         >>>> *Subject:* [SR-Users] Expect the kamailio's sip account is<br>
>>>         >>>> unregistered state when the client app is shutdown<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> Hi Daniel,<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> When the client's app is closed,the sip account may be<br>
>>>         registered<br>
>>>         >>>> state,because the expired time may have some rest time.I<br>
>>>         want to<br>
>>>         >>>> implement when the client's app is closed,the account<br>
>>>         also unregister.<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> How can I implement this function?Would you give me some<br>
>>>         advices?<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> Thanks!<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> Xuefeng Zhang<br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>><br>
>>>         >>>> _______________________________________________<br>
>>>         >>>> SIP Express Router (SER) and Kamailio (OpenSER) -<br>
>>>         sr-users mailing<br>
>>>         >>>> list <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</div></div>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         >>>><br>
>>>         <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>         >>>><br>
>>>         >>> _______________________________________________<br>
>>>         >>> SIP Express Router (SER) and Kamailio (OpenSER) -<br>
>>>         sr-users mailing<br>
>>>         >>> list <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</span>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         >>> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>         >>><br>
>>>         >><br>
>>>         >> _______________________________________________<br>
>>>         >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>         mailing<br>
>>>         >> list <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</span>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         >> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>         >><br>
>>>         > _______________________________________________<br>
>>>         > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>         mailing list<br>
>>>         > <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</span>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         > <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>>         ><br>
>>>         ><br>
>>>         > _______________________________________________<br>
>>>         > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>         mailing list<br>
>>>         > <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</span>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         > <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>><br>
>>>         --<br>
>>>         Daniel-Constantin Mierla<br>
>>>         <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a><br>
</span>>>>         <<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#%21/miconda</a>> -<br>
<span class="">>>>         <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
>>>         Kamailio World Conference, May 27-29, 2015<br>
>>>         Berlin, Germany - <a href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a><br>
>>><br>
>>><br>
>>>         _______________________________________________<br>
>>>         SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>         mailing list<br>
>>>         <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
</span>>>>         <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>         <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>>><br>
>>><br>
>>>     _______________________________________________<br>
>>>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users<br>
>>>     mailing list<br>
</span>>>>     <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>>     <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
>><br>
>><br>
>>     _______________________________________________<br>
>>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
</span>>>     <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<span class="">>>     <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
>     --<br>
>     Daniel-Constantin Mierla<br>
>     <a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a><br>
>     Kamailio World Conference, May 27-29, 2015<br>
>     Berlin, Germany - <a href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a><br>
><br>
><br>
>     _______________________________________________<br>
>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
</span>>     <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a> <mailto:<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<div class="HOEnZb"><div class="h5">>     <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
> <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
> <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>