Module: kamailio
Branch: master
Commit: 7f034bf845eb65beaf2dc09594ab496998aa97a7
URL:
https://github.com/kamailio/kamailio/commit/7f034bf845eb65beaf2dc09594ab496…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-07-05T01:16:57+02:00
nat_traversal: use ipv6 address with surrounding square brackets in pv value
---
Modified: src/modules/nat_traversal/nat_traversal.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7f034bf845eb65beaf2dc09594ab496…
Patch:
https://github.com/kamailio/kamailio/commit/7f034bf845eb65beaf2dc09594ab496…
---
diff --git a/src/modules/nat_traversal/nat_traversal.c
b/src/modules/nat_traversal/nat_traversal.c
index d8b2c0bf2d..7f4fc059c4 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -2094,15 +2094,15 @@ static int pv_get_keepalive_socket(
}
-static int pv_get_source_uri(
- struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
+static int pv_get_source_uri(sip_msg_t *msg, pv_param_t *param, pv_value_t *res)
{
static char uri[128];
if(msg == NULL || res == NULL)
return -1;
- snprintf(uri, 64, "sip:%s:%d", ip_addr2a(&msg->rcv.src_ip),
+ uri[0] = '\0';
+ snprintf(uri, 64, "sip:%s:%d", ip_addr2strz(&msg->rcv.src_ip),
msg->rcv.src_port);
switch(msg->rcv.proto) {