[sr-dev] git:master:b34cf58a: nathelper: it doesn't ping contacts if ping_nated_only=0

Konstantin Poliakov k.polyakov at mightycall.com
Wed May 2 08:13:12 CEST 2018


Module: kamailio
Branch: master
Commit: b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9
URL: https://github.com/kamailio/kamailio/commit/b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9

Author: Konstantin Poliakov <k.polyakov at mightycall.com>
Committer: Konstantin Poliakov <k.polyakov at mightycall.com>
Date: 2018-04-29T21:07:19+03:00

nathelper: it doesn't ping contacts if ping_nated_only=0

- nathelper sends ping only if nat flag is specified, but if ping_nated_only=0 it should ping all contact in any case.

---

Modified: src/modules/nathelper/nathelper.c

---

Diff:  https://github.com/kamailio/kamailio/commit/b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9.diff
Patch: https://github.com/kamailio/kamailio/commit/b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9.patch

---

diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index 935c981ee8..953384265a 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -2059,10 +2059,9 @@ static void nh_timer(unsigned int ticks, void *timer_idx)
 		dst.proto = PROTO_UDP;
 		dst.send_sock = send_sock;
 
-		if((flags & sipping_flag) != 0
-				&& (opt.s = build_sipping(
-							&c, send_sock, &path, &ruid, aorhash, &opt.len))
-						   != 0) {
+		int should_send_ping = (flags & sipping_flag) != 0 || ping_nated_only == 0;
+
+		if ( should_send_ping && (opt.s = build_sipping(&c, send_sock, &path, &ruid, aorhash, &opt.len)) != 0) {
 			if(udp_send(&dst, opt.s, opt.len) < 0) {
 				LM_ERR("sip udp_send failed\n");
 			}




More information about the sr-dev mailing list