fix race on sql stmt for show calls

This commit is contained in:
Anthony Minessale 2010-07-06 16:01:26 -05:00 committed by Brian West
parent 72bc2e97a4
commit 4d4f5a0ecd
1 changed files with 9 additions and 6 deletions

View File

@ -864,6 +864,7 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session
switch_channel_t *channel = NULL;
const char *key;
switch_core_session_message_t msg = { 0 };
switch_event_t *event = NULL;
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
@ -883,6 +884,13 @@ static switch_status_t signal_bridge_on_hibernate(switch_core_session_t *session
switch_channel_set_variable(channel, SWITCH_BRIDGE_VARIABLE, switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE));
if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);
switch_event_fire(&event);
}
}
return SWITCH_STATUS_SUCCESS;
}
@ -1005,12 +1013,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(caller_channel, event);
switch_event_fire(&event);
}
switch_channel_set_state_flag(caller_channel, CF_RESET);
switch_channel_set_state_flag(peer_channel, CF_RESET);