Module: kamailio
Branch: master
Commit: 4e881304d33356a5fd3b93c15c0a9e06060049f7
URL:
https://github.com/kamailio/kamailio/commit/4e881304d33356a5fd3b93c15c0a9e0…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2020-04-28T16:03:18+02:00
Merge pull request #2306 from NGSegovia/ngsegovia/keepalive_disable_delete_counter
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/4e881304d33356a5fd3b93c15c0a9e0…
Patch:
https://github.com/kamailio/kamailio/commit/4e881304d33356a5fd3b93c15c0a9e0…
---
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);