diff --git a/apps/app_playback.c b/apps/app_playback.c index 0c9281aa76..ab6e60e3ee 100644 --- a/apps/app_playback.c +++ b/apps/app_playback.c @@ -62,6 +62,12 @@ be answered before the sound is played. Not all channel types support playing messages while still on hook. + + @@ -446,6 +452,7 @@ static int playback_exec(struct ast_channel *chan, const char *data) char *tmp; int option_skip=0; int option_say=0; + int option_mix=0; int option_noanswer = 0; AST_DECLARE_APP_ARGS(args, @@ -466,6 +473,8 @@ static int playback_exec(struct ast_channel *chan, const char *data) option_skip = 1; if (strcasestr(args.options, "say")) option_say = 1; + if (strcasestr(args.options, "mix")) + option_mix = 1; if (strcasestr(args.options, "noanswer")) option_noanswer = 1; } @@ -486,6 +495,13 @@ static int playback_exec(struct ast_channel *chan, const char *data) while (!res && (front = strsep(&back, "&"))) { if (option_say) res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1); + else if (option_mix){ + /* Check if it is in say format but not remote audio file */ + if (strcasestr(front, ":") && !strcasestr(front, "://")) + res = say_full(chan, front, "", ast_channel_language(chan), NULL, -1, -1); + else + res = ast_streamfile(chan, front, ast_channel_language(chan)); + } else res = ast_streamfile(chan, front, ast_channel_language(chan)); if (!res) { diff --git a/doc/CHANGES-staging/add_mix_option_to_playback.txt b/doc/CHANGES-staging/add_mix_option_to_playback.txt new file mode 100644 index 0000000000..cfc876ce77 --- /dev/null +++ b/doc/CHANGES-staging/add_mix_option_to_playback.txt @@ -0,0 +1,7 @@ +Subject: app_playback +Subject: apps + +A new option 'mix' is added to the Playback application that +will play by filename and say.conf. It will look on the format of the +name, if it is like say format it will play with say.conf if not it +will play the file name. \ No newline at end of file