*/
SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event);
+SWITCH_DECLARE(uint32_t) switch_core_session_flush_private_events(switch_core_session_t *session);
/*!
\brief Read a frame from a session
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "push");
switch_event_fire(&event);
}
-
+
switch_ivr_park(session, NULL);
if (switch_channel_ready(channel)) {
if (switch_channel_test_flag(other_channel, CF_TAGGED)) {
switch_channel_clear_flag(other_channel, CF_CONTROLLED);
+ switch_core_session_flush_private_events(other_session);
switch_channel_stop_broadcast(other_channel);
switch_core_session_kill_channel(other_session, SWITCH_SIG_BREAK);
while (switch_channel_test_flag(other_channel, CF_TAGGED)) {
return status;
}
+SWITCH_DECLARE(uint32_t) switch_core_session_flush_private_events(switch_core_session_t *session)
+{
+ switch_status_t status = SWITCH_STATUS_FALSE;
+ int x = 0;
+ void *pop;
+
+ if (session->private_event_queue) {
+ while ((status = (switch_status_t) switch_queue_trypop(session->private_event_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
+ x++;
+ }
+ }
+
+ return x;
+}
+
SWITCH_DECLARE(void) switch_core_session_reset(switch_core_session_t *session, switch_bool_t flush_dtmf)
{
switch_channel_t *channel = switch_core_session_get_channel(session);