]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip.c: Fix Contact header rendering for IPv6 addresses.
authorSean Bright <sean@seanbright.com>
Fri, 8 Nov 2024 13:08:42 +0000 (08:08 -0500)
committerasterisk-org-access-app[bot] <120671045+asterisk-org-access-app[bot]@users.noreply.github.com>
Wed, 13 Nov 2024 14:18:31 +0000 (14:18 +0000)
Fix suggested by @nvsystems.

Fixes #985

res/res_pjsip.c

index fb0383e206dd980f7f646f9d3a230b5e8faeaab2..5b954b222682ee404a14f1ddb487de68aab408b2 100644 (file)
@@ -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) ? "]" : "",