]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7196: add recording_follow_transfer support for semi attended transfers
authorFlavio Grossi <flaviogrossi@gmail.com>
Mon, 2 Feb 2015 14:48:26 +0000 (15:48 +0100)
committerFlavio Grossi <flaviogrossi@gmail.com>
Mon, 2 Feb 2015 14:48:26 +0000 (15:48 +0100)
src/mod/endpoints/mod_sofia/sofia.c

index 0f0f492e995434d1e23caa9922b057a8a7e2ceb2..db0bf1467a2ff951dd5ac9bc754f25e632f264b6 100644 (file)
@@ -7916,6 +7916,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;
@@ -7946,6 +7947,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);