From db79bcb82f15f9ef60dd68ab6acfeda383e4d3e1 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Fri, 8 Nov 2024 08:08:42 -0500 Subject: [PATCH] res_pjsip.c: Fix Contact header rendering for IPv6 addresses. Fix suggested by @nvsystems. Fixes #985 --- res/res_pjsip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/res_pjsip.c b/res/res_pjsip.c index fb0383e206..5b954b2226 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1143,9 +1143,9 @@ static pjsip_dialog *create_dialog_uas(const struct ast_sip_endpoint *endpoint, contact.slen = pj_ansi_snprintf(contact.ptr, PJSIP_MAX_URL_SIZE, "<%s:%s%s%s%.*s%s:%d%s%s>", uas_use_sips_contact(rdata) ? "sips" : "sip", - (type & PJSIP_TRANSPORT_IPV6) ? "[" : "", S_OR(endpoint->contact_user, ""), (!ast_strlen_zero(endpoint->contact_user)) ? "@" : "", + (type & PJSIP_TRANSPORT_IPV6) ? "[" : "", (int)transport->local_name.host.slen, transport->local_name.host.ptr, (type & PJSIP_TRANSPORT_IPV6) ? "]" : "",