Module: kamailio Branch: master Commit: b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9 URL: https://github.com/kamailio/kamailio/commit/b34cf58a3a88e5ed2b2aa6aa9e5df0e5bb1808f9
Author: Konstantin Poliakov <[email protected]> Committer: Konstantin Poliakov <[email protected]> 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"); } _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
