]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_fifo: Avoid getting a var when we won't use it
authorTravis Cross <tc@traviscross.com>
Mon, 26 May 2014 15:09:20 +0000 (15:09 +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 4621f29be190f25ee4907fa8f88935caa1eb7466..fdd68441d39a89113c6d5233a341e07f1a73689f 100644 (file)
@@ -468,9 +468,8 @@ static switch_status_t on_dtmf(switch_core_session_t *session, void *input, swit
                        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_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;