Merge pull request #174 in FS/freeswitch from ~FLAVIO/freeswitch:origin/bugfix/FS-7196 to master

* commit 'f135232ef5ab3f53f76cfa8ec2a1225f7700de90':
  FS-7196: add recording_follow_transfer support for semi attended transfers
This commit is contained in:
Mike Jerris 2015-06-01 13:52:05 -05:00
commit bbad395866

View File

@ -7928,6 +7928,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if ((a_session = switch_core_session_locate(br_a))) {
const char *moh = profile->hold_music;
switch_core_session_t *tmpsess = NULL;
switch_channel_t *a_channel = switch_core_session_get_channel(a_session);
switch_caller_profile_t *prof = switch_channel_get_caller_profile(channel_b);
const char *tmp;
@ -7958,6 +7959,15 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
} else {
switch_ivr_session_transfer(a_session, "park", "inline", NULL);
}
if (switch_true(switch_channel_get_variable(channel_a, "recording_follow_transfer"))) {
switch_core_media_bug_transfer_recordings(session, a_session);
}
if (switch_true(switch_channel_get_variable(channel_b, "recording_follow_transfer")) && (tmpsess = switch_core_session_locate(br_a))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE,
"Early transfer detected with no media, moving recording bug to other leg\n");
switch_core_media_bug_transfer_recordings(b_session, tmpsess);
switch_core_session_rwunlock(tmpsess);
}
switch_core_session_rwunlock(a_session);