[SR-Users] usrloc - ka_mode timeout

Daniel-Constantin Mierla miconda at gmail.com
Fri Sep 25 11:24:42 CEST 2020


Hello,

can you try with the lastest 5.4 branch?

Did it happen also when nathelper was used for keepalive-based contact
removing?

Cheers,
Daniel

On 25.09.20 00:46, Ilie Soltanici wrote:
> Hello,
>
> It works also for me with UDP contacts, thank you. One more thing I
> noticed - by using *db_mode=1* and *db_load=1* after restarting
> Kamailio it's not loading anymore all contacts from the DB or it's
> loading but then keepalive module it's removing them from the local
> memory, I believe this is because keepalive doesn't know the status of
> the extension, will be nice to have that fixed as well.
>
> Regards,
> Ilie.
>
> On Wed, 23 Sep 2020 at 16:35, Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>     Hello,
>
>     actually the expires processing on keepalive was done in a
>     callback function triggered only by nathelper, only sending
>     keepalive and computing roundtrip was done on usrloc internal
>     timer callbacks. I pushed fixes to master and 5.4 branches, I
>     tested briefly with a tcp contact and all seemed ok. Let me know
>     if works for you as well.
>
>     Cheers,
>     Daniel
>
>
>     On 23.09.20 10:51, Ilie Soltanici wrote:
>>     Hello,
>>
>>     It's sitting in the memory until the expiration time it's
>>     arriving. See below the ul dump output:
>>
>>     Every 2.0s: /usr/local/sbin/kamcmd ul.dump                      
>>                                                                      
>>                                                                      
>>                                                                 Wed
>>     Sep 23 09:43:44 2020
>>
>>     {
>>             Domains: {
>>                     Domain: {
>>                             Domain: location
>>                             Size: 1024
>>                             AoRs: {
>>                                     Info: {
>>                                             AoR: 101
>>                                             HashID: -1698832128
>>                                             Contacts: {
>>                                                     Contact: {
>>                                                             Address:
>>     sip:101 at 192.168.0.18:49195;ob
>>                                                             Expires: 3548
>>                                                             Q: 1.000000
>>                                                             Call-ID:
>>     03514e7aff5a4c3785b471923ef9a4c5
>>                                                             CSeq: 49773
>>                                                            
>>     User-Agent: MicroSIP/3.20.0
>>                                                             Received:
>>     sip:8.8.8.123:10037 <http://8.8.8.123:10037>
>>                                                             Path:
>>     [not set]
>>                                                             State:
>>     CS_SYNC
>>                                                             Flags: 0
>>                                                             CFlags: 12288
>>                                                             Socket:
>>     udp:1.1.1.10:5060 <http://1.1.1.10:5060>
>>                                                             Methods: 8159
>>                                                             Ruid:
>>     uloc-b-5f6a75ac-7ed8-1
>>                                                             Instance:
>>     [not set]
>>                                                             Reg-Id: 0
>>                                                             Server-Id: 11
>>                                                            
>>     Tcpconn-Id: -1
>>                                                             Keepalive: 1
>>                                                            
>>     Last-Keepalive: 1600850587
>>                                                            
>>     KA-Roundtrip: 20790
>>                                                            
>>     Last-Modified: 1600850572
>>                                                     }
>>                                             }
>>                                     }
>>                             }
>>                             Stats: {
>>                                     Records: 1
>>                                     Max-Slots: 1
>>                             }
>>                     }
>>             }
>>     }
>>
>>     So, for the above extension (101) it will be removed from the
>>     memory only after 3548 sec, even if I killed manually that
>>     connection and the softphone it's not replying anymore to the
>>     keepalive options. By using the keepalive_timeout function from
>>     the nathelper module - it's working fine.
>>
>>     Regards,
>>     Ilie.
>>
>>     On Wed, 23 Sep 2020 at 08:05, Daniel-Constantin Mierla
>>     <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>>
>>         Hello,
>>
>>         have you watched for how long it stays in memory? The usrloc
>>         keepalive should leverage the same mechanism that was used by
>>         the keepalive done by nathelper module, it should not delete
>>         the record immediately, but after ka_timeout elapsed from the
>>         last received keepalive, then expires is set to current
>>         timestamp + 10 seconds, so the next timer cleanup should
>>         remove with.
>>
>>         Can you get the kamctl up dump for the phone you tested with?
>>         The keepalive related attributes (last keepalive timestamp,
>>         last rtt) should be in the json output/
>>
>>         Cheers,
>>         Daniel
>>
>>         On 23.09.20 00:13, Ilie Soltanici wrote:
>>>         Hello,
>>>
>>>         Tried with the latest 5.4 branch, but ka_timeout still
>>>         not working for me, the record it's still available in
>>>         ul.dump even if that extension is not replying anymore to
>>>         the Options sent by the module.
>>>
>>>         See below used configuration:
>>>         modparam("usrloc", "nat_bflag", FLB_NATB)
>>>         modparam("usrloc", "use_domain", FLS_MULTIDOMAIN)
>>>         modparam("usrloc", "timer_interval", 30)
>>>         modparam("usrloc", "db_mode", 1)
>>>         modparam("usrloc", "db_load", 1)
>>>         modparam("usrloc", "db_insert_update", 1)
>>>         modparam("usrloc", "matching_mode", 3)
>>>         modparam("usrloc", "fetch_rows", 4000)
>>>         modparam("usrloc", "timer_procs", 4)
>>>         modparam("usrloc", "handle_lost_tcp", 1)
>>>         modparam("usrloc", "close_expired_tcp", 1)
>>>         modparam("usrloc", "db_timer_clean", 1)
>>>         modparam("usrloc", "server_id_filter", 1)
>>>         modparam("usrloc", "ka_mode", 1)
>>>         modparam("usrloc", "ka_method", "OPTIONS")
>>>         modparam("usrloc", "ka_from", "sip:options at devserver.net
>>>         <mailto:sip%3Aoptions at devserver.net>")
>>>         modparam("usrloc", "ka_domain", "devserver.net
>>>         <http://devserver.net>")
>>>         modparam("usrloc", "ka_filter", 0)
>>>         modparam("usrloc", "ka_timeout", 60)
>>>         modparam("tm|usrloc", "xavp_contact", "ulattrs")
>>>
>>>         version: kamailio 5.4.1 (x86_64/linux) 609685
>>>
>>>         Regards,
>>>         Ilie
>>>
>>>         On Tue, 22 Sep 2020 at 18:58, Ilie Soltanici
>>>         <iliusha.md at gmail.com <mailto:iliusha.md at gmail.com>> wrote:
>>>
>>>             Thank you Daniel for the latest update, I will try to
>>>             test the latest 5.4 branch on the Dev environment and
>>>             will come back here for any issues encountered.
>>>
>>>             Regards,
>>>             Ilie.
>>>
>>>             On Tue 22 Sep 2020 at 18:44, Daniel-Constantin Mierla
>>>             <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>                 Hello,
>>>
>>>
>>>
>>>                 the usrloc keepalive are done on its timer interval:
>>>
>>>
>>>
>>>                   -
>>>
>>>                 https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.timer_interval
>>>                 <https://www.kamailio.org/docs/modules/stable/modules/usrloc.html#usrloc.p.timer_interval>
>>>
>>>
>>>
>>>                 For the keepalive timeout I was misled by presence
>>>                 of the global
>>>
>>>                 variable in the usrloc, but was actually not
>>>                 exported by this
>>>
>>>                 module. I did it afterwards, just pushed to branch
>>>                 5.4 as well.
>>>
>>>
>>>
>>>                 While is not recommended to run both at the same
>>>                 time, imo
>>>
>>>                 nothing really bad can happen, you may see more
>>>                 keepalives for
>>>
>>>                 natted udp contacts (not for tls, tcp, ...).
>>>
>>>
>>>
>>>                 As for an unorthodox and untested idea :-) : if you
>>>                 do not want
>>>
>>>                 to run from latest 5.4 branch yet, you can
>>>                 eventually set
>>>
>>>                 natping_interval to a very large value, like 20
>>>                 years in seconds,
>>>
>>>                 so you are pretty sure you will do an upgrade before
>>>                 nathelper
>>>
>>>                 timer fires,
>>>
>>>
>>>
>>>                 Cheers,
>>>
>>>
>>>                 Daniel
>>>
>>>
>>>
>>>
>>>                 On 22.09.20 19:17, Ilie Soltanici
>>>
>>>                 wrote:
>>>
>>>
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 Hello,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 Is there any way to add those functions from the
>>>>                 nathelper
>>>>
>>>>                 module to the usrloc module?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 *keepalive_timeout
>>>>
>>>>
>>>>                 natping_interval*
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 I'm looking to use ka_mode feature from the usrloc
>>>>                 module
>>>>
>>>>                 in order to have roundtrip time computed for each
>>>>                 extension
>>>>
>>>>                 but because those functions are missing in the
>>>>                 usrloc module
>>>>
>>>>                 and per documentation this functionality conflicts
>>>>                 in some way
>>>>
>>>>                 with nathelper module it's not recommended to have both
>>>>
>>>>                 modules enabled.  Or maybe there is another way to
>>>>                 have them
>>>>
>>>>                 "interconnected"?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 Thank you.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>                 _______________________________________________
>>>>
>>>>                 Kamailio (SER) - Users Mailing List
>>>>
>>>>                 sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>>>>
>>>>                 https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users <https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users>
>>>>
>>>>
>>>>
>>>
>>>
>>>                 -- 
>>>
>>>                 Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>>>
>>>                 www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>>>
>>>                 Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>         -- 
>>         Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>>         www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>>         Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>>
>     -- 
>     Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>     www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>     Funding: https://www.paypal.me/dcmierla <https://www.paypal.me/dcmierla>
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200925/41e2a1f6/attachment.htm>


More information about the sr-users mailing list