Skip to content
Snippets Groups Projects
Commit cfae5224 authored by Shloime Rosenblum's avatar Shloime Rosenblum Committed by George Joseph
Browse files

apps/app_playback.c: Add 'mix' option to app_playback

I am adding a mix option that will play by filename and say.conf unlike
say option that will only play with say.conf. It
will look on the format of the name, if it is like say it play with
say.conf if not it will play the file name.

ASTERISK-29662

Change-Id: I815816916a308f0fa8f165140dc15772dcbd547a
parent 0adcdbd1
No related branches found
No related tags found
3 merge requests!138Merge branch asterisk-20.3.0 into devel properly,!123Merge asterisk '20.3.0' into devel,!118Draft: manager: AOC-S support for AOCMessage
......@@ -62,6 +62,12 @@
be answered before the sound is played.</para>
<note><para>Not all channel types support playing messages while still on hook.</para></note>
</option>
<option name="say">
<para>Play using the say.conf file.</para>
</option>
<option name="mix">
<para>Play using a mix of filename and the say.conf file.</para>
</option>
</optionlist>
</parameter>
</syntax>
......@@ -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) {
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment