]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix play and get digits when using phrase macros
authorBrian West <brian@freeswitch.org>
Wed, 6 May 2009 18:00:28 +0000 (18:00 +0000)
committerBrian West <brian@freeswitch.org>
Wed, 6 May 2009 18:00:28 +0000 (18:00 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13244 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_play_say.c

index 757aa1add9a2d033aa36aa5f76069934f4b4e23c..b794b8c626f4d58c71d31f0fe870c5acd46dd490 100644 (file)
@@ -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);