[mod_sofia] add sip_reply_contact variable

This commit is contained in:
Antonio Silva 2021-05-06 19:24:26 +02:00
parent deecaae870
commit 169f2f91ca
1 changed files with 5 additions and 0 deletions

View File

@ -1333,6 +1333,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_channel_t *channel = switch_core_session_get_channel(session);
private_object_t *tech_pvt = switch_core_session_get_private(session);
switch_status_t status = SWITCH_STATUS_SUCCESS;
const char *sip_reply_contact;
switch_assert(tech_pvt != NULL);
@ -1356,6 +1357,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
goto end;
}
if ((sip_reply_contact = switch_channel_get_variable(channel, "sip_reply_contact"))) {
tech_pvt->reply_contact = switch_core_session_sprintf(session, sip_reply_contact);
}
if (switch_channel_test_flag(channel, CF_CONFERENCE) && !zstr(tech_pvt->reply_contact) && !switch_stristr(";isfocus", tech_pvt->reply_contact)) {
tech_pvt->reply_contact = switch_core_session_sprintf(session, "%s;isfocus", tech_pvt->reply_contact);
}