obey sip_copy_custom_headers on bye

This commit is contained in:
Anthony Minessale 2014-09-12 00:37:15 +05:00
parent 124e3339fc
commit 7144b25254
1 changed files with 6 additions and 1 deletions

View File

@ -938,7 +938,12 @@ void sofia_handle_sip_i_bye(switch_core_session_t *session, int status,
switch_core_session_get_partner(session, &nsession);
if (nsession) {
switch_ivr_transfer_variable(session, nsession, SOFIA_SIP_BYE_HEADER_PREFIX_T);
const char *vval;
switch_channel_t *nchannel = switch_core_session_get_channel(nsession);
if (!(vval = switch_channel_get_variable(nchannel, "sip_copy_custom_headers")) || switch_true(vval)) {
switch_ivr_transfer_variable(session, nsession, SOFIA_SIP_BYE_HEADER_PREFIX_T);
}
switch_core_session_rwunlock(nsession);
}
}