[SR-Users] Expect the kamailio's sip account is unregistered state when the client app is shutdown

xuefeng zhang zhangxuefeng1007 at gmail.com
Thu Apr 23 08:40:30 CEST 2015


Hi,

I only add the two defines.The follow is my settings.

 #!define WITH_NAT

 #!define WITH_NATSIPPIN

 modparam("nathelper", "natping_interval", 30)

 modparam("nathelper", "ping_nated_only", 1)

 modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)

 modparam("nathelper", "sipping_from", "sip:pinger at kamailio.org")

 modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")


Does the kamailio server send OPTIONS packages?If the server doesn't
send,the configure file must have error.

Lucky.


Xuefeng Zhang



2015-04-22 20:51 GMT+08:00 Filip Malenka <filip.malenka at gmail.com>:

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


More information about the sr-users mailing list