Hello James,

 

on easy alternative would be to use the nathelper pinging method. It also supports UDP ping, and you can specify it on a registration level with a certain flag if you want to ping or not.

 

Cheers,

 

Henning

 

From: James Lipski via sr-users <sr-users@lists.kamailio.org>
Sent: Dienstag, 20. August 2024 17:01
To: sr-users@lists.kamailio.org
Cc: James Lipski <jameslipski@protonmail.com>
Subject: [SR-Users] apply keepalive to only udp

 

 

Hello,

 

I wanted to know if this can be accomplished, or if I'm doing something wrong.

 

What I'm hoping to accomplish is to have kamailio periodically send OPTIONS packets to endpoints that are connected over UDP only.

 

As of right now, I currently have the following configured under usrloc:

 

modparam("usrloc", "timer_interval", 5)

modparam("usrloc", "timer_procs", 2)

modparam("usrloc", "use_domain", MULTIDOMAIN)

modparam("usrloc", "db_url", DBURL)

modparam("usrloc", "db_mode", 0)

modparam("usrloc", "ka_mode", 1)

modparam("usrloc", "ka_method", "OPTIONS")

modparam("usrloc", "ka_from", "sip:ping@sip-domain.com")

modparam("usrloc", "ka_domain", "sip-domain.com")

modparam("usrloc", "ka_timeout", 125)

modparam("usrloc", "ka_interval", 60)

 

With these parameters, all endpoints will be sent OPTIONS packets periodically as expected. When setting "ka_mode" to "4", as expected, endpoints registered with UDP only receive OPTIONS packets; which is what I wanted.

 

The issue that I'm having with these parameters is that endpoints registered with anything other that UDP are triggering a contact-expired event after a little over 2 minutes. I have the registrar set to 3600 as an expiry; I'm assuming the contact is expiring due to the "ka_timeout" value.

 

--------------------------

 

Is there a way to only have keep-alive packets/ and timeouts apply to endpoints registered on UDP?

 

Thank you.