]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Refactor DTMF exit key matching
authorTravis Cross <tc@traviscross.com>
Mon, 26 May 2014 15:20:38 +0000 (15:20 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 28 May 2014 01:32:04 +0000 (01:32 +0000)
src/mod/applications/mod_fifo/mod_fifo.c

index fdd68441d39a89113c6d5233a341e07f1a73689f..8f78c85711835d8bdea200e8d1ee79581b62c1be 100644 (file)
@@ -470,10 +470,8 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
 
                        if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_BRIDGE_ORIGINATOR)) {
                                const char *consumer_exit_key = switch_channel_get_variable(channel, "fifo_consumer_exit_key");
-                               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 == '*') {
+                               if (!consumer_exit_key) consumer_exit_key = "*";
+                               if (dtmf->digit == *consumer_exit_key) {
                                        switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING);
                                        return SWITCH_STATUS_BREAK;
                                } else if (dtmf->digit == '0') {