@ -62,6 +62,12 @@
be answered before the sound is played . < / para >
be answered before the sound is played . < / para >
< note > < para > Not all channel types support playing messages while still on hook . < / para > < / note >
< note > < para > Not all channel types support playing messages while still on hook . < / para > < / note >
< / option >
< / 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 >
< / optionlist >
< / parameter >
< / parameter >
< / syntax >
< / syntax >
@ -446,6 +452,7 @@ static int playback_exec(struct ast_channel *chan, const char *data)
char * tmp ;
char * tmp ;
int option_skip = 0 ;
int option_skip = 0 ;
int option_say = 0 ;
int option_say = 0 ;
int option_mix = 0 ;
int option_noanswer = 0 ;
int option_noanswer = 0 ;
AST_DECLARE_APP_ARGS ( args ,
AST_DECLARE_APP_ARGS ( args ,
@ -466,6 +473,8 @@ static int playback_exec(struct ast_channel *chan, const char *data)
option_skip = 1 ;
option_skip = 1 ;
if ( strcasestr ( args . options , " say " ) )
if ( strcasestr ( args . options , " say " ) )
option_say = 1 ;
option_say = 1 ;
if ( strcasestr ( args . options , " mix " ) )
option_mix = 1 ;
if ( strcasestr ( args . options , " noanswer " ) )
if ( strcasestr ( args . options , " noanswer " ) )
option_noanswer = 1 ;
option_noanswer = 1 ;
}
}
@ -486,6 +495,13 @@ static int playback_exec(struct ast_channel *chan, const char *data)
while ( ! res & & ( front = strsep ( & back , " & " ) ) ) {
while ( ! res & & ( front = strsep ( & back , " & " ) ) ) {
if ( option_say )
if ( option_say )
res = say_full ( chan , front , " " , ast_channel_language ( chan ) , NULL , - 1 , - 1 ) ;
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
else
res = ast_streamfile ( chan , front , ast_channel_language ( chan ) ) ;
res = ast_streamfile ( chan , front , ast_channel_language ( chan ) ) ;
if ( ! res ) {
if ( ! res ) {