Module: kamailio
Branch: master
Commit: b2ade6ca35499ba9c44d6f46888351244eb87299
URL:
https://github.com/kamailio/kamailio/commit/b2ade6ca35499ba9c44d6f468883512…
Author: Timmo Verlaan <tverlaan(a)gmail.com>
Committer: Timmo Verlaan <tverlaan(a)gmail.com>
Date: 2016-11-04T10:01:41+01:00
nathelper: force socket if set
This fixes force socket in that it will always be forced and not
only when there is no socket.
---
Modified: modules/nathelper/nathelper.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b2ade6ca35499ba9c44d6f468883512…
Patch:
https://github.com/kamailio/kamailio/commit/b2ade6ca35499ba9c44d6f468883512…
---
diff --git a/modules/nathelper/nathelper.c b/modules/nathelper/nathelper.c
index 28508ca..2f02378 100644
--- a/modules/nathelper/nathelper.c
+++ b/modules/nathelper/nathelper.c
@@ -2079,9 +2079,12 @@ nh_timer(unsigned int ticks, void *timer_idx)
}
init_dest_info(&dst);
hostent2su(&dst.to, he, 0, curi.port_no);
+
+ if (force_socket) {
+ send_sock = force_socket;
+ }
if (send_sock==0) {
- send_sock=force_socket ? force_socket :
- get_send_socket(0, &dst.to, PROTO_UDP);
+ send_sock = get_send_socket(0, &dst.to, PROTO_UDP);
}
if (send_sock == NULL) {
LM_ERR("can't get sending socket\n");