res_pjsip.c: Set contact_user on incoming call local Contact header

If the contact_user is configured on the endpoint it will now be set on the local Contact header URI for incoming calls. The contact_user has already been set on the local Contact header URI for outgoing calls.

Resolves: #226
This commit is contained in:
MikeNaso 2023-08-08 10:23:37 -04:00
parent 29eb4fe620
commit b286d1cca2
1 changed files with 3 additions and 1 deletions

View File

@ -1141,9 +1141,11 @@ static pjsip_dialog *create_dialog_uas(const struct ast_sip_endpoint *endpoint,
contact.ptr = pj_pool_alloc(rdata->tp_info.pool, PJSIP_MAX_URL_SIZE);
contact.slen = pj_ansi_snprintf(contact.ptr, PJSIP_MAX_URL_SIZE,
"<%s:%s%.*s%s:%d%s%s>",
"<%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)) ? "@" : "",
(int)transport->local_name.host.slen,
transport->local_name.host.ptr,
(type & PJSIP_TRANSPORT_IPV6) ? "]" : "",