Skip to content

Commit

Permalink
nathelper: it doesn't ping contacts if ping_nated_only=0
Browse files Browse the repository at this point in the history
- nathelper sends ping only if nat flag is specified, but if ping_nated_only=0 it should ping all contact in any case.

(cherry picked from commit b34cf58)
  • Loading branch information
Konstantin Poliakov authored and miconda committed May 9, 2018
1 parent cefd474 commit c5df855
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/nathelper/nathelper.c
Expand Up @@ -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");
}
Expand Down

0 comments on commit c5df855

Please sign in to comment.