git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5079 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-05-03 19:16:54 +00:00
parent 1be5b1ff45
commit f9a2e791d0

View File

@ -36,7 +36,7 @@ static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
/*********************************************************************************/ /*********************************************************************************/
struct switch_ivr_bridge_data { struct switch_ivr_bridge_data {
switch_core_session_t *session; switch_core_session_t *session;
char *b_uuid; char b_uuid[SWITCH_UUID_FORMATTED_LENGTH + 1];
int stream_id; int stream_id;
switch_input_callback_function_t input_callback; switch_input_callback_function_t input_callback;
void *session_data; void *session_data;
@ -200,10 +200,14 @@ static switch_status_t audio_bridge_on_loopback(switch_core_session_t *session)
if ((bd = (switch_ivr_bridge_data_t *) switch_channel_get_private(channel, "_bridge_"))) { if ((bd = (switch_ivr_bridge_data_t *) switch_channel_get_private(channel, "_bridge_"))) {
switch_channel_set_private(channel, "_bridge_", NULL); switch_channel_set_private(channel, "_bridge_", NULL);
if (bd->session == session && *bd->b_uuid) {
audio_bridge_thread(NULL, (void *) bd); audio_bridge_thread(NULL, (void *) bd);
} else { } else {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
} }
} else {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
switch_channel_clear_state_handler(channel, &audio_bridge_peer_state_handlers); switch_channel_clear_state_handler(channel, &audio_bridge_peer_state_handlers);
if (!switch_channel_test_flag(channel, CF_TRANSFER)) { if (!switch_channel_test_flag(channel, CF_TRANSFER)) {
@ -509,14 +513,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses
a_leg = switch_core_session_alloc(session, sizeof(*a_leg)); a_leg = switch_core_session_alloc(session, sizeof(*a_leg));
b_leg = switch_core_session_alloc(peer_session, sizeof(*b_leg)); b_leg = switch_core_session_alloc(peer_session, sizeof(*b_leg));
assert(a_leg && b_leg);
b_leg->session = peer_session; b_leg->session = peer_session;
b_leg->b_uuid = switch_core_session_strdup(peer_session, switch_core_session_get_uuid(session)); switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
b_leg->stream_id = stream_id; b_leg->stream_id = stream_id;
b_leg->input_callback = input_callback; b_leg->input_callback = input_callback;
b_leg->session_data = session_data; b_leg->session_data = session_data;
a_leg->session = session; a_leg->session = session;
a_leg->b_uuid = switch_core_session_strdup(session, switch_core_session_get_uuid(peer_session)); switch_copy_string(a_leg->b_uuid, switch_core_session_get_uuid(peer_session), sizeof(a_leg->b_uuid));
b_leg->stream_id = stream_id; b_leg->stream_id = stream_id;
b_leg->input_callback = input_callback; b_leg->input_callback = input_callback;
b_leg->session_data = peer_session_data; b_leg->session_data = peer_session_data;