]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add fifo_consumer_exit_key variable (MODAPP-100)
authorMichael Jerris <mike@jerris.com>
Tue, 15 Jul 2008 18:09:16 +0000 (18:09 +0000)
committerMichael Jerris <mike@jerris.com>
Tue, 15 Jul 2008 18:09:16 +0000 (18:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9043 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_fifo/mod_fifo.c

index 17e02a82782d831cec84fb48d5e13e367beed7eb..c4211d2b1e9bce09a7778346b0aca0dbf708bfdd 100644 (file)
@@ -65,8 +65,15 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
                        switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
                        switch_channel_t *bchan = switch_core_session_get_channel(bleg);
                        switch_channel_t *channel = switch_core_session_get_channel(session);
+
+                       const char *consumer_exit_key = switch_channel_get_variable(channel, "fifo_consumer_exit_key");
+
                        if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_ORIGINATOR)) {
-                               if (dtmf->digit == '*') {
+                               if ( consumer_exit_key && dtmf->digit == *consumer_exit_key ) {
+                                       switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING);
+                                       return SWITCH_STATUS_BREAK;
+                               }
+                               else if ( !consumer_exit_key && dtmf->digit == '*' ) {
                                        switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING);
                                        return SWITCH_STATUS_BREAK;
                                } else if (dtmf->digit == '0') {