Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS uses remote IP address instead of hostname when sending BYE #3310

Merged
merged 3 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pjsip/include/pjsip/sip_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ struct pjsip_dialog
pjsip_route_hdr route_set; /**< Route set. */
pj_bool_t route_set_frozen; /**< Route set has been set. */
pjsip_auth_clt_sess auth_sess; /**< Client authentication session. */
pj_str_t initial_dest;/**< Initial destination host. */
pj_str_t initial_dest;/**< Initial destination host (used for
verifying remote TLS cert). */

/** Session counter. */
int sess_count; /**< Number of sessions. */
Expand Down
12 changes: 7 additions & 5 deletions pjsip/src/pjsip/sip_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,10 @@ pj_status_t create_uas_dialog( pjsip_user_agent *ua,
pj_strdup(dlg->pool, &dlg->remote.info_str, &tmp);

/* Save initial destination host from transport's info */
pj_strdup(dlg->pool, &dlg->initial_dest,
&rdata->tp_info.transport->remote_name.host);

if (rdata->tp_info.transport->dir == PJSIP_TP_DIR_OUTGOING) {
pj_strdup(dlg->pool, &dlg->initial_dest,
&rdata->tp_info.transport->remote_name.host);
}

/* Init remote's contact from Contact header.
* Iterate the Contact URI until we find sip: or sips: scheme.
Expand Down Expand Up @@ -1831,8 +1832,9 @@ static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_rx_data *rdata)
* transaction as the initial transaction that establishes dialog.
*/
if (dlg->role == PJSIP_ROLE_UAC) {
/* Save initial destination host from transport's info. */
if (!dlg->initial_dest.slen) {
/* Update initial destination host from transport's info. */
if (rdata->tp_info.transport->dir == PJSIP_TP_DIR_OUTGOING)
{
pj_strdup(dlg->pool, &dlg->initial_dest,
&rdata->tp_info.transport->remote_name.host);
}
Expand Down