diff options
Diffstat (limited to 'apps/app_controlplayback.c')
-rwxr-xr-x | apps/app_controlplayback.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c index 8aa7c48fe..089a7f4d8 100755 --- a/apps/app_controlplayback.c +++ b/apps/app_controlplayback.c @@ -57,33 +57,31 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) 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"); return -1; } - strncpy(tmp, (char *)data, sizeof(tmp)-1); file = tmp; - if((skip=strchr(tmp,'|'))) { + if ((skip=strchr(tmp,'|'))) { *skip = '\0'; *skip++; fwd=strchr(skip,'|'); - if(fwd) { + if (fwd) { *fwd = '\0'; *fwd++; rev = strchr(fwd,'|'); - if(rev) { + if (rev) { *rev = '\0'; *rev++; stop = strchr(rev,'|'); - if(stop) { + if (stop) { *stop = '\0'; *stop++; pause = strchr(stop,'|'); - if(pause) { + if (pause) { *pause = '\0'; *pause++; } @@ -93,19 +91,18 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) } skipms = skip ? atoi(skip) : 3000; - if(!skipms) + if (!skipms) skipms = 3000; - if(!fwd || ! is_on_phonepad(*fwd)) + if (!fwd || !is_on_phonepad(*fwd)) fwd = "#"; - if(!rev || ! is_on_phonepad(*rev)) + if (!rev || !is_on_phonepad(*rev)) rev = "*"; - if(stop && ! is_on_phonepad(*stop)) + if (stop && !is_on_phonepad(*stop)) stop = NULL; - if(pause && ! is_on_phonepad(*pause)) + if (pause && !is_on_phonepad(*pause)) pause = NULL; - LOCAL_USER_ADD(u); res = ast_control_streamfile(chan, file, fwd, rev, stop, pause, skipms); |