]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 19 Mar 2008 15:34:43 +0000 (15:34 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 19 Mar 2008 15:34:43 +0000 (15:34 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7927 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_play_say.c

index c4d940e7ac18cf53cb182b72ec2b047ed42bbd09..65a2445ea9bb8118927b82b0e8b4f392c4464fdb 100644 (file)
@@ -682,6 +682,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
        const char *prefix;
        const char *timer_name;
        const char *prebuf;
+       const char *alt = NULL;
 
        switch_zmalloc(abuf, FILE_STARTSAMPLES * sizeof(*abuf));
 
@@ -697,6 +698,49 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
                goto end;
        }
 
+       if ((alt = strchr(file, ':'))) {
+               char *dup;
+
+               if (!strncasecmp(file, "phrase:", 7)) {
+                       char *arg;
+                       char *lang = NULL;
+                       alt = file + 7;
+                       dup = switch_core_session_strdup(session, alt);
+                       if ((arg = strchr(dup, ':'))) {
+                               *arg++ = '\0';
+                               if ((lang = strchr(arg, ':'))) {
+                                       *lang++ = '\0';
+                               }
+                       }
+                       if (dup) {
+                               return switch_ivr_phrase_macro(session, dup, arg, lang, args);
+                       } else {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Args\n");
+                               return SWITCH_STATUS_FALSE;
+                       }
+               } else if (!strncasecmp(file, "say:", 4)) {
+                       char *engine = NULL, *voice = NULL, *text = NULL;
+                       alt = file + 4;
+            dup = switch_core_session_strdup(session, alt);
+                       engine = dup;
+
+                       if ((voice = strchr(engine, ':'))) {
+                               *voice++ = '\0';
+                               if ((text = strchr(voice, ':'))) {
+                                       *text++ = '\0';
+                               }
+                       }
+                       if (engine && voice && text) {
+                               return switch_ivr_speak_text(session, engine, voice, dup, args);
+                       } else {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Args\n");
+                               return SWITCH_STATUS_FALSE;
+                       }
+               }
+               
+       }
+
+
        if (!prefix) {
                prefix = SWITCH_GLOBAL_dirs.base_dir;
        }