From: Sean Bright Date: Fri, 8 Nov 2024 13:08:42 +0000 (-0500) Subject: res_pjsip.c: Fix Contact header rendering for IPv6 addresses. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db79bcb82f15f9ef60dd68ab6acfeda383e4d3e1;p=thirdparty%2Fasterisk.git res_pjsip.c: Fix Contact header rendering for IPv6 addresses. Fix suggested by @nvsystems. Fixes #985 --- 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) ? "]" : "",