res_pjsip.c: Fix Contact header rendering for IPv6 addresses.

Fix suggested by @nvsystems.

Fixes #985

(cherry picked from commit 1c0fcd583d)
releases/22
Sean Bright 7 months ago committed by Asterisk Development Team
parent 6d98127a75
commit 94fcb3174b

@ -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) ? "]" : "",

Loading…
Cancel
Save