提交 976859bb authored 作者: Anthony Minessale's avatar Anthony Minessale

fix unreachable condition with a null args to make any key stop playback/record…

fix unreachable condition with a null args to make any key stop playback/record etc without dequing and remove hard-coded flush digits in play_and_get_digits be sure to flush it yourself before using
上级 a8f5bf60
...@@ -224,7 +224,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, ...@@ -224,7 +224,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
switch_ivr_parse_all_events(session); switch_ivr_parse_all_events(session);
if (args && (args->input_callback || args->buf || args->buflen || args->dmachine)) { if (args) {
switch_dtmf_t dtmf; switch_dtmf_t dtmf;
/* /*
......
...@@ -634,7 +634,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se ...@@ -634,7 +634,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
break; break;
} }
if (args && (args->input_callback || args->buf || args->buflen || args->dmachine)) { if (args) {
/* /*
dtmf handler function you can hook up to be executed when a digit is dialed during playback dtmf handler function you can hook up to be executed when a digit is dialed during playback
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
...@@ -862,7 +862,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi ...@@ -862,7 +862,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
switch_ivr_parse_all_events(session); switch_ivr_parse_all_events(session);
if (args && (args->input_callback || args->buf || args->buflen || args->dmachine)) { if (args) {
/* /*
dtmf handler function you can hook up to be executed when a digit is dialed during gentones dtmf handler function you can hook up to be executed when a digit is dialed during gentones
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
...@@ -1314,7 +1314,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess ...@@ -1314,7 +1314,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
switch_ivr_parse_all_events(session); switch_ivr_parse_all_events(session);
if (args && (args->input_callback || args->buf || args->buflen || args->dmachine)) { if (args) {
/* /*
dtmf handler function you can hook up to be executed when a digit is dialed during playback dtmf handler function you can hook up to be executed when a digit is dialed during playback
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
...@@ -1875,7 +1875,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t ...@@ -1875,7 +1875,7 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t
switch_status_t status; switch_status_t status;
memset(digit_buffer, 0, digit_buffer_length); memset(digit_buffer, 0, digit_buffer_length);
switch_channel_flush_dtmf(channel);
status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name, status = switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, var_name,
digit_buffer, digit_buffer_length, timeout, valid_terminators, digit_timeout); digit_buffer, digit_buffer_length, timeout, valid_terminators, digit_timeout);
if (status == SWITCH_STATUS_TIMEOUT && strlen(digit_buffer) >= min_digits) { if (status == SWITCH_STATUS_TIMEOUT && strlen(digit_buffer) >= min_digits) {
...@@ -2037,7 +2037,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session ...@@ -2037,7 +2037,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
switch_event_destroy(&event); switch_event_destroy(&event);
} }
if (args && (args->input_callback || args->buf || args->buflen || args->dmachine)) { if (args) {
/* dtmf handler function you can hook up to be executed when a digit is dialed during playback /* dtmf handler function you can hook up to be executed when a digit is dialed during playback
* if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. * if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
*/ */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论