]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make break all stop broadcast too
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Nov 2008 19:48:36 +0000 (19:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Nov 2008 19:48:36 +0000 (19:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10545 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_commands/mod_commands.c

index 05117a4573fe005cffe3d09de8fea41a414ae9f8..a02efb99f7a61c10b3c6cfc6b819902040022f43 100644 (file)
@@ -1766,7 +1766,8 @@ SWITCH_STANDARD_API(break_function)
 {
        switch_core_session_t *psession = NULL;
        char *mycmd, *flag;
-       
+       switch_channel_t *channel = NULL;
+
        if (session) {
                return SWITCH_STATUS_FALSE;
        }
@@ -1792,7 +1793,12 @@ SWITCH_STANDARD_API(break_function)
                switch_core_session_flush_private_events(psession);
        }
 
-       switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK);
+       channel = switch_core_session_get_channel(psession);
+       if (switch_channel_test_flag(channel, CF_BROADCAST)) {
+               switch_channel_stop_broadcast(channel);
+       } else {
+               switch_channel_set_flag(channel, CF_BREAK);
+       }
        switch_core_session_rwunlock(psession);
 
        return SWITCH_STATUS_SUCCESS;