]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 15 Feb 2008 16:01:12 +0000 (16:01 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 15 Feb 2008 16:01:12 +0000 (16:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7618 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_core.h
src/mod/applications/mod_fifo/mod_fifo.c
src/switch_core_session.c

index 7f4732f0a7300b8977c04f1c1464c6deea724f78..1bcc93cf1f12159f13eebaf82d581494b66d7f8f 100644 (file)
@@ -779,6 +779,7 @@ SWITCH_DECLARE(uint32_t) switch_core_session_private_event_count(_In_ switch_cor
 */
 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
index 889e31d85c5943301e936bb697c93ce2d9686d3c..4b6a44efba02f3b6b8a836db3848914b85add9aa 100644 (file)
@@ -268,7 +268,7 @@ SWITCH_STANDARD_APP(fifo_function)
             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 @@ SWITCH_STANDARD_APP(fifo_function)
 
                 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)) {
index 07e04c8b3e01b9304f614665680e0102d32460e9..87426ea3b60f499334e55e3ba3b75552e6487b81 100644 (file)
@@ -563,6 +563,21 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_private_event(switch
        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);