From 2ca10c4f4f4b186addfef899dd28de19629f2948 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 6 May 2009 18:00:28 +0000 Subject: [PATCH] fix play and get digits when using phrase macros git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13244 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_play_say.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 757aa1add9..b794b8c626 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -340,7 +340,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s switch_safe_free(substituted); - if (match && do_break && switch_true(do_break)) { + if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) { break; } @@ -860,8 +860,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess char *argv[128] = { 0 }; int argc; int cur; - switch_status_t rst; - switch_core_session_get_read_impl(session, &read_impl); @@ -927,8 +925,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess if ((arg = strchr(dup, ':'))) { *arg++ = '\0'; } - if ((rst = switch_ivr_phrase_macro(session, dup, arg, lang, args) != SWITCH_STATUS_SUCCESS)) { - return rst; + if ((status = switch_ivr_phrase_macro(session, dup, arg, lang, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } else { @@ -951,8 +949,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess } if (!switch_strlen_zero(engine) && !switch_strlen_zero(voice) && !switch_strlen_zero(text)) { - if ((rst = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { - return rst; + if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } else if (!switch_strlen_zero(engine) && !(voice && text)) { @@ -960,8 +958,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess engine = (char *) switch_channel_get_variable(channel, "tts_engine"); voice = (char *) switch_channel_get_variable(channel, "tts_voice"); if (engine && text) { - if ((rst = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { - return rst; + if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) { + return status; } continue; } @@ -1404,8 +1402,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess switch_core_timer_destroy(&timer); } - - switch_safe_free(abuf); switch_core_session_reset(session, SWITCH_FALSE, SWITCH_TRUE);