aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_playback.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-26 02:25:50 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-26 02:25:50 +0000
commit80abe21a73da70232751d92522e107c6dbf5b813 (patch)
tree808cf0a91d4df76c582df81b947c6bd5e6db19eb /apps/app_playback.c
parent1b7ab811821fec5e7ecaf1649293ac3ed69b057c (diff)
Add n+101 jump if file does not exist (bug #2722)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4099 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_playback.c')
-rwxr-xr-xapps/app_playback.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_playback.c b/apps/app_playback.c
index c6cb0ba24..d61ba0e61 100755
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -36,8 +36,8 @@ static char *descrip =
"specified, the application will return immediately should the channel not be\n"
"off hook. Otherwise, unless 'noanswer' is specified, the channel channel will\n"
"be answered before the sound is played. Not all channels support playing\n"
-"messages while still hook. Returns -1 if the channel was hung up, or if the\n"
-"file does not exist. Returns 0 otherwise.\n";
+"messages while still hook. Returns -1 if the channel was hung up. If the\n"
+"file does not exist, will jump to priority n+101 if present.\n";
STANDARD_LOCAL_USER;
@@ -81,6 +81,8 @@ static int playback_exec(struct ast_channel *chan, void *data)
res = ast_waitstream(chan, "");
else {
ast_log(LOG_WARNING, "ast_streamfile failed on %s for %s\n", chan->name, (char *)data);
+ if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num))
+ chan->priority+=100;
res = 0;
}
ast_stopstream(chan);