diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-26 02:25:50 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-10-26 02:25:50 +0000 |
commit | 80abe21a73da70232751d92522e107c6dbf5b813 (patch) | |
tree | 808cf0a91d4df76c582df81b947c6bd5e6db19eb /apps/app_controlplayback.c | |
parent | 1b7ab811821fec5e7ecaf1649293ac3ed69b057c (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_controlplayback.c')
-rwxr-xr-x | apps/app_controlplayback.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c index b44eafba9..af2b79900 100755 --- a/apps/app_controlplayback.c +++ b/apps/app_controlplayback.c @@ -35,7 +35,7 @@ static char *descrip = " be included following a pipe symbol. You can use * and # to rewind and\n" " fast forward the playback specified. If 'stopchar' is added the file will\n" " terminate playback when 'stopchar' is pressed. Returns -1 if the channel\n" -" was hung up, or if the file does not exist. Returns 0 otherwise.\n\n" +" was hung up. if the file does not exist jumps to n+101 if it present.\n\n" " Example: exten => 1234,1,ControlPlayback(file|4000|*|#|1|0)\n\n"; STANDARD_LOCAL_USER; @@ -54,6 +54,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) struct localuser *u; char tmp[256]; char *skip = NULL, *fwd = NULL, *rev = NULL, *stop = NULL, *pause = NULL, *file = NULL; + if (!data || ast_strlen_zero((char *)data)) { ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n"); @@ -110,7 +111,12 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) /* If we stopped on one of our stop keys, return 0 */ if(stop && strchr(stop, res)) res = 0; - + + if(res < 0) { + if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) + chan->priority+=100; + res = 0; + } return res; } |