Module: kamailio Branch: master Commit: cb80d6b93325787c336100c3710cda8f6d88c404 URL: https://github.com/kamailio/kamailio/commit/cb80d6b93325787c336100c3710cda8f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: GitHub noreply@github.com Date: 2018-05-02T08:13:06+02:00
Merge pull request #1516 from tiglat/tiglat/nathelper_doesnt_ping_all_contacts
nathelper: it doesn't ping contacts if ping_nated_only=0
---
Modified: src/modules/nathelper/nathelper.c
---
Diff: https://github.com/kamailio/kamailio/commit/cb80d6b93325787c336100c3710cda8f... Patch: https://github.com/kamailio/kamailio/commit/cb80d6b93325787c336100c3710cda8f...
---
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c index 935c981ee8..5382d4c6b8 100644 --- a/src/modules/nathelper/nathelper.c +++ b/src/modules/nathelper/nathelper.c @@ -1921,6 +1921,7 @@ static void nh_timer(unsigned int ticks, void *timer_idx) unsigned int path_ip = 0; unsigned short path_port = 0; int options = 0; + int should_send_ping = 0;
if((*natping_state) == 0) goto done; @@ -2059,10 +2060,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) { + 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"); }