[sr-dev] git:master:6f52da52: keepalive: ignore delete_counter if it is set to 0
Nacho Garcia Segovia
nacho.gs at zaleos.net
Tue Apr 28 16:03:25 CEST 2020
Module: kamailio
Branch: master
Commit: 6f52da5286b61c5c039070d20a6687ee02e4e762
URL: https://github.com/kamailio/kamailio/commit/6f52da5286b61c5c039070d20a6687ee02e4e762
Author: Nacho Garcia Segovia <nacho.gs at zaleos.net>
Committer: Nacho Garcia Segovia <nacho.gs at zaleos.net>
Date: 2020-04-28T14:08:19+02:00
keepalive: ignore delete_counter if it is set to 0
---
Modified: src/modules/keepalive/doc/keepalive_admin.xml
Modified: src/modules/keepalive/keepalive_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/6f52da5286b61c5c039070d20a6687ee02e4e762.diff
Patch: https://github.com/kamailio/kamailio/commit/6f52da5286b61c5c039070d20a6687ee02e4e762.patch
---
diff --git a/src/modules/keepalive/doc/keepalive_admin.xml b/src/modules/keepalive/doc/keepalive_admin.xml
index 5db99eee4a..98e55222ea 100644
--- a/src/modules/keepalive/doc/keepalive_admin.xml
+++ b/src/modules/keepalive/doc/keepalive_admin.xml
@@ -96,7 +96,7 @@ modparam("keepalive", "destination", "sip.provider.com")
<section>
<title><varname>delete_counter</varname>(int)</title>
<para>
- Unsuccesful attemps increase delete_counter . After passing it , keepalive module doesn't try to send options requests.
+ Unsuccesful attemps increase delete_counter. After passing it, keepalive module doesn't try to send options requests. Ignored if it's set to 0.
</para>
<para>
<emphasis>
diff --git a/src/modules/keepalive/keepalive_core.c b/src/modules/keepalive/keepalive_core.c
index ff0bed3e8e..f641aceb1f 100644
--- a/src/modules/keepalive/keepalive_core.c
+++ b/src/modules/keepalive/keepalive_core.c
@@ -67,15 +67,14 @@ void ka_check_timer(unsigned int ticks, void *param)
ka_dest = ka_dest->next) {
LM_DBG("ka_check_timer dest:%.*s\n", ka_dest->uri.len, ka_dest->uri.s);
+ if(ka_counter_del > 0 && ka_dest->counter > ka_counter_del) {
+ continue;
+ }
+
/* Send ping using TM-Module.
* int request(str* m, str* ruri, str* to, str* from, str* h,
* str* b, str *oburi,
* transaction_cb cb, void* cbp); */
-
- if(ka_dest->counter>ka_counter_del){
- continue;
- }
-
set_uac_req(&uac_r, &ka_ping_method, 0, 0, 0, TMCB_LOCAL_COMPLETED,
ka_options_callback, (void *)ka_dest);
More information about the sr-dev
mailing list