]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 12 Nov 2006 20:50:18 +0000 (20:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 12 Nov 2006 20:50:18 +0000 (20:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3332 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_ivr.h
src/switch_ivr.c

index 2bb46bd405f2cccec5e4d1c90a020031de9a1f97..5ac938e033020ae27a90cc0d0bd96844bd4a90e3 100644 (file)
@@ -423,6 +423,7 @@ typedef enum {
        SWITCH_IVR_ACTION_EXECMENU,     /* Goto another menu in the stack. */
        SWITCH_IVR_ACTION_EXECAPP,              /* Execute an application.         */
        SWITCH_IVR_ACTION_PLAYSOUND,    /* Play a sound.                   */
+       SWITCH_IVR_ACTION_SAYTEXT,      /* say text.                   */
        SWITCH_IVR_ACTION_BACK,         /* Go back 1 menu.                 */
        SWITCH_IVR_ACTION_TOMAIN,               /* Go back to the top level menu.  */
        SWITCH_IVR_ACTION_TRANSFER,     /* Transfer caller to another ext. */
index 0c866c85bdd1ec7ffe3bd3fb4a52fb6645d6c21e..3bf7fd214d987abe2d8901736f09ffbe4fe5dbdb 100644 (file)
@@ -3464,10 +3464,12 @@ static switch_status_t play_or_say(switch_core_session_t *session, switch_ivr_me
                ptr = menu->ptr;
        }
 
-       if (menu->tts_engine && menu->tts_voice) {
-               switch_ivr_speak_text(session, menu->tts_engine, menu->tts_voice, NULL, 0, NULL, sound, ptr, len);
-       } else {
+       if (*sound == '/' || *sound == '\\') {
                switch_ivr_play_file(session, NULL, sound, NULL, NULL, ptr, len);
+       } else {
+               if (menu->tts_engine && menu->tts_voice) {
+                       switch_ivr_speak_text(session, menu->tts_engine, menu->tts_voice, NULL, 0, NULL, sound, ptr, len);
+               }
        }
 
        if (need) {
@@ -3551,6 +3553,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *s
                                        case SWITCH_IVR_ACTION_PLAYSOUND:
                                                status = switch_ivr_play_file(session, NULL, aptr, NULL, NULL, NULL, 0);
                                                break;
+                                       case SWITCH_IVR_ACTION_SAYTEXT:
+                                               if (menu->tts_engine &&  menu->tts_voice) {
+                                                       switch_ivr_speak_text(session, menu->tts_engine, menu->tts_voice, NULL, 0, NULL, aptr, NULL, 0);
+                                               }
+                                               break;
                                        case SWITCH_IVR_ACTION_TRANSFER:
                                                switch_ivr_session_transfer(session, aptr, NULL, NULL);
                                                running = 0;