From: Anthony Minessale Date: Thu, 11 Sep 2014 19:37:15 +0000 (+0500) Subject: obey sip_copy_custom_headers on bye X-Git-Tag: v1.4.8~1^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7144b252545f334fdb91cd49d728cfb32c9b8d2b;p=thirdparty%2Ffreeswitch.git obey sip_copy_custom_headers on bye --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c2fd9adb2f..6cf16e5912 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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); } }