summaryrefslogtreecommitdiff
path: root/res/res_pjsip_messaging.c
diff options
context:
space:
mode:
authorScott Griepentrog <scott@griepentrog.com>2017-08-10 09:09:29 -0500
committerScott Griepentrog <sgriepentrog@digium.com>2017-08-10 09:23:38 -0500
commit4ed2733ddea705761f0e340cdcba972a5f8be68a (patch)
treeecc23a620734f9d0a252ea8b115fd640dfba43da /res/res_pjsip_messaging.c
parentf5f0b73e3fbfe6c1610bdcf04d643df3a19f0ead (diff)
res_pjsip_messaging: IPv6 receive address needs brackets
When handling an incoming SIP MESSAGE, PJSIP attaches the IP address that the message was received from to the message in the variable PJSIP_RECVADDR. When the IP address is IPv6 the :PORT appended results in an unparseable mess. By using an additional bit flag on the pj_sockaddr_print call, the conventional use of brackets around the address is achieved. ASTERISK-27193 #close Change-Id: I12342521f2ce87a5b6e4883d480a3fd957aa9fd9
Diffstat (limited to 'res/res_pjsip_messaging.c')
-rw-r--r--res/res_pjsip_messaging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c
index 5c41a7056..d31e10129 100644
--- a/res/res_pjsip_messaging.c
+++ b/res/res_pjsip_messaging.c
@@ -512,7 +512,7 @@ static enum pjsip_status_code rx_data_to_ast_msg(pjsip_rx_data *rdata, struct as
buf[size] = '\0';
res |= ast_msg_set_from(msg, "%s", buf);
- field = pj_sockaddr_print(&rdata->pkt_info.src_addr, buf, sizeof(buf) - 1, 1);
+ field = pj_sockaddr_print(&rdata->pkt_info.src_addr, buf, sizeof(buf) - 1, 3);
res |= ast_msg_set_var(msg, "PJSIP_RECVADDR", field);
switch (rdata->tp_info.transport->key.type) {