[commit] r7618 - in freeswitch/trunk/src: . include mod/applications/mod_fifo
Author: anthm Date: Fri Feb 15 11:01:12 2008 New Revision: 7618 Modified: freeswitch/trunk/src/include/switch_core.h freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c freeswitch/trunk/src/switch_core_session.c Log: update Modified: freeswitch/trunk/src/include/switch_core.h ============================================================================== --- freeswitch/trunk/src/include/switch_core.h (original) +++ freeswitch/trunk/src/include/switch_core.h Fri Feb 15 11:01:12 2008 @@ -779,6 +779,7 @@ */ 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 Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original) +++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Fri Feb 15 11:01:12 2008 @@ -268,7 +268,7 @@ 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)) { @@ -393,6 +393,7 @@ 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)) { Modified: freeswitch/trunk/src/switch_core_session.c ============================================================================== --- freeswitch/trunk/src/switch_core_session.c (original) +++ freeswitch/trunk/src/switch_core_session.c Fri Feb 15 11:01:12 2008 @@ -563,6 +563,21 @@ 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);
participants (1)
-
Freeswitch SVN