#define switch_core_media_bug_remove_all(_s) switch_core_media_bug_remove_all_function(_s, NULL)
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream);
-SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session);
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_callback(switch_core_session_t *orig_session, switch_core_session_t *new_session,
switch_media_bug_callback_t callback, void * (*user_data_dup_func) (switch_core_session_t *, void *));
tsession = other_session;
other_session = NULL;
if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(tmp, tsession);
+ switch_ivr_transfer_recordings(tmp, tsession);
}
switch_core_session_rwunlock(tmp);
}
if (br_a) {
ch_a = switch_core_session_get_channel(br_a);
- switch_core_media_bug_transfer_recordings(session, br_a);
+ switch_ivr_transfer_recordings(session, br_a);
}
if (br_b) {
ch_b = switch_core_session_get_channel(br_b);
- switch_core_media_bug_transfer_recordings(tech_pvt->other_session, br_b);
+ switch_ivr_transfer_recordings(tech_pvt->other_session, br_b);
}
if (ch_a && ch_b && switch_channel_test_flag(ch_a, CF_BRIDGED) && switch_channel_test_flag(ch_b, CF_BRIDGED)) {
p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context);
if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(session, a_session);
+ switch_ivr_transfer_recordings(session, a_session);
}
switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, sip_redirect_dialplan, sip_redirect_context);
p_contact->m_url->url_user);
if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(session, a_session);
+ switch_ivr_transfer_recordings(session, a_session);
}
switch_ivr_session_transfer(a_session, p_contact->m_url->url_user, NULL, NULL);
if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer")) &&
(tmp = switch_core_session_locate(br_a))) {
- switch_core_media_bug_transfer_recordings(session, tmp);
+ switch_ivr_transfer_recordings(session, tmp);
switch_core_session_rwunlock(tmp);
}
if (switch_channel_up(channel_a)) {
if (switch_true(switch_channel_get_variable(channel_a, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(session, a_session);
+ switch_ivr_transfer_recordings(session, a_session);
}
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);
+ switch_ivr_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_ivr_transfer_recordings(b_session, tmpsess);
switch_core_session_rwunlock(tmpsess);
}
if (switch_true(switch_channel_get_variable(channel_a, "recording_follow_transfer")) &&
(tmp = switch_core_session_locate(br_a))) {
switch_channel_set_variable(switch_core_session_get_channel(tmp), "transfer_disposition", "bridge");
- switch_core_media_bug_transfer_recordings(session, tmp);
+ switch_ivr_transfer_recordings(session, tmp);
switch_core_session_rwunlock(tmp);
}
if (switch_true(switch_channel_get_variable(channel_b, "recording_follow_transfer")) &&
(tmp = switch_core_session_locate(br_b))) {
- switch_core_media_bug_transfer_recordings(b_session, tmp);
+ switch_ivr_transfer_recordings(b_session, tmp);
switch_core_session_rwunlock(tmp);
}
if (switch_true(switch_channel_get_variable(hup_channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(hup_session, t_session);
+ switch_ivr_transfer_recordings(hup_session, t_session);
}
if(sofia_test_pflag(profile, PFLAG_FIRE_TRANFER_EVENTS)) {
}
if (switch_true(switch_channel_get_variable(channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(session, b_session);
+ switch_ivr_transfer_recordings(session, b_session);
}
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "BLIND_TRANSFER");
if (switch_true(switch_channel_get_variable(tech_pvt->channel, "recording_follow_transfer")) &&
(tmp = switch_core_session_locate(br_a))) {
switch_channel_set_variable(switch_core_session_get_channel(tmp), "transfer_disposition", "bridge");
- switch_core_media_bug_transfer_recordings(session, tmp);
+ switch_ivr_transfer_recordings(session, tmp);
switch_core_session_rwunlock(tmp);
}
if (switch_true(switch_channel_get_variable(b_tech_pvt->channel, "recording_follow_transfer")) &&
(tmp = switch_core_session_locate(br_b))) {
- switch_core_media_bug_transfer_recordings(b_session, tmp);
+ switch_ivr_transfer_recordings(b_session, tmp);
switch_core_session_rwunlock(tmp);
}
ext = switch_channel_get_variable(hup_channel, "destination_number");
if (switch_true(switch_channel_get_variable(hup_channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(hup_session, t_session);
+ switch_ivr_transfer_recordings(hup_session, t_session);
}
if (idest) {
if (switch_true(switch_channel_get_variable(channel, "flip_record_on_hold"))) {
switch_core_session_t *other_session;
if (switch_core_session_get_partner(channel->session, &other_session) == SWITCH_STATUS_SUCCESS) {
- switch_core_media_bug_transfer_recordings(channel->session, other_session);
+ switch_ivr_transfer_recordings(channel->session, other_session);
switch_core_session_rwunlock(other_session);
}
}
return SWITCH_STATUS_FALSE;
}
-SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session)
-{
- switch_media_bug_t *bp;
- char *list[100] = { 0 };
- int stop_times[100] = { 0 };
- int i = 0, x = 0;
-
- if (orig_session->bugs) {
- switch_channel_t *new_channel = switch_core_session_get_channel(new_session);
- switch_channel_t *orig_channel = switch_core_session_get_channel(orig_session);
- const char *save_append = switch_channel_get_variable(new_channel, "record_append");
- const char *save_stereo = switch_channel_get_variable(new_channel, "record_stereo");
- const char *orig_stereo = switch_channel_get_variable(orig_channel, "record_stereo");
- const char *new_stereo = orig_stereo;
-
- switch_thread_rwlock_wrlock(orig_session->bug_rwlock);
- switch_channel_set_variable(new_channel, "RECORD_MIN_SEC", "0");
- switch_channel_set_variable(new_channel, "record_append", "true");
- switch_channel_set_variable(new_channel, "record_stereo", new_stereo);
-
- for (bp = orig_session->bugs; bp; bp = bp->next) {
- if (!strcmp(bp->function, "session_record")) {
- list[x] = switch_core_session_strdup(new_session, bp->target);
- if (bp->stop_time > 0) {
- stop_times[x] = (int)(bp->stop_time - switch_epoch_time_now(NULL));
- }
- x++;
- }
- }
-
- switch_thread_rwlock_unlock(orig_session->bug_rwlock);
-
- for(i = 0; i < x; i++) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(orig_session), SWITCH_LOG_DEBUG, "Transfering %s from %s to %s\n", list[i],
- switch_core_session_get_name(orig_session), switch_core_session_get_name(new_session));
- switch_ivr_stop_record_session(orig_session, list[i]);
- switch_ivr_record_session(new_session, list[i], stop_times[i], NULL);
- }
-
- switch_channel_set_variable(new_channel, "record_append", save_append);
- switch_channel_set_variable(new_channel, "record_stereo", save_stereo);
-
- }
-
- return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
-}
-
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_callback(switch_core_session_t *orig_session, switch_core_session_t *new_session,
switch_media_bug_callback_t callback, void * (*user_data_dup_func) (switch_core_session_t *, void *))
switch_channel_set_variable(holding_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, "true");
if (caller_channel && switch_true(switch_channel_get_variable(caller_channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(session, originate_status[i].peer_session);
+ switch_ivr_transfer_recordings(session, originate_status[i].peer_session);
}
if (switch_true(switch_channel_get_variable(holding_channel, "recording_follow_transfer"))) {
- switch_core_media_bug_transfer_recordings(holding_session, originate_status[i].peer_session);
+ switch_ivr_transfer_recordings(holding_session, originate_status[i].peer_session);
}
switch_core_session_rwunlock(holding_session);