|
@@ -2059,10 +2059,9 @@ static void nh_timer(unsigned int ticks, void *timer_idx)
|
|
dst.proto = PROTO_UDP;
|
|
dst.proto = PROTO_UDP;
|
|
dst.send_sock = send_sock;
|
|
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) {
|
|
if(udp_send(&dst, opt.s, opt.len) < 0) {
|
|
LM_ERR("sip udp_send failed\n");
|
|
LM_ERR("sip udp_send failed\n");
|
|
}
|
|
}
|