mod_fifo: Refactor DTMF exit key matching

This commit is contained in:
Travis Cross 2014-05-26 15:20:38 +00:00
parent c34ad2c0ec
commit 7920630c8f
1 changed files with 2 additions and 4 deletions

View 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') {