enum srgs_match_type match;
switch_mutex_lock(handler->mutex);
+
component = handler->component;
+ /* additional paranoia check */
+ if (!component) {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Received DTMF without active input component\n");
+ switch_mutex_unlock(handler->mutex);
+ return SWITCH_STATUS_SUCCESS;
+ }
is_term_digit = digit_mask_test(component->term_digit_mask, dtmf->digit);
switch(type) {
case SWITCH_ABC_TYPE_INIT: {
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Adding DTMF callback\n");
switch_core_event_hook_add_recv_dtmf(session, input_component_on_dtmf);
break;
}
if (component->num_digits && component->inter_digit_timeout > 0 && elapsed_ms > component->inter_digit_timeout) {
enum srgs_match_type match;
handler->component = NULL;
+ switch_core_media_bug_set_flag(bug, SMBF_PRUNE);
/* we got some input, check for match */
match = srgs_grammar_match(component->grammar, component->digits);
}
} else if (!component->num_digits && component->initial_timeout > 0 && elapsed_ms > component->initial_timeout) {
handler->component = NULL;
+ switch_core_media_bug_set_flag(bug, SMBF_PRUNE);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "initial-timeout\n");
rayo_component_send_complete(RAYO_COMPONENT(component), INPUT_NOINPUT);
}
rayo_component_send_complete(RAYO_COMPONENT(component), COMPONENT_COMPLETE_HANGUP);
}
}
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Removing DTMF callback\n");
switch_core_event_hook_remove_recv_dtmf(session, input_component_on_dtmf);
break;
default: