Browse code

keepalive: ignore delete_counter if it is set to 0

Nacho Garcia Segovia authored on 28/04/2020 12:08:19
Showing 2 changed files
... ...
@@ -96,7 +96,7 @@ modparam("keepalive", "destination", "sip.provider.com")
96 96
 			<section>
97 97
 				<title><varname>delete_counter</varname>(int)</title>
98 98
 				<para>
99
-					Unsuccesful attemps  increase delete_counter . After passing it , keepalive module doesn't try to send options requests.
99
+					Unsuccesful attemps increase delete_counter. After passing it, keepalive module doesn't try to send options requests. Ignored if it's set to 0.
100 100
 				</para>
101 101
 				<para>
102 102
 				<emphasis>
... ...
@@ -67,15 +67,14 @@ void ka_check_timer(unsigned int ticks, void *param)
67 67
 			ka_dest = ka_dest->next) {
68 68
 		LM_DBG("ka_check_timer dest:%.*s\n", ka_dest->uri.len, ka_dest->uri.s);
69 69
 
70
+		if(ka_counter_del > 0 && ka_dest->counter > ka_counter_del) {
71
+			continue;
72
+		}
73
+
70 74
 		/* Send ping using TM-Module.
71 75
 		 * int request(str* m, str* ruri, str* to, str* from, str* h,
72 76
 		 *		str* b, str *oburi,
73 77
 		 *		transaction_cb cb, void* cbp); */
74
-
75
-		if(ka_dest->counter>ka_counter_del){
76
-			continue;
77
-		}
78
-
79 78
 		set_uac_req(&uac_r, &ka_ping_method, 0, 0, 0, TMCB_LOCAL_COMPLETED,
80 79
 				ka_options_callback, (void *)ka_dest);
81 80