aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authoranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-23 15:26:01 +0000
committeranthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-23 15:26:01 +0000
commitcc5cdf285b95b92e236790bf6ec6d993957ee85a (patch)
tree309b85730863a8921979de183d7a033a099043c4 /app.c
parent7bc943f4abdfcba5caaf1a99d0008ab149805fdd (diff)
allow file arg in ast_control_streamfile to accept trailing :end to indicate an instant seek ti the end.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3824 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/app.c b/app.c
index eb1a37e0a..fe6af0201 100755
--- a/app.c
+++ b/app.c
@@ -416,6 +416,7 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
struct timeval started, ended;
long elapsed = 0,last_elapsed =0;
char *breaks=NULL;
+ char *end=NULL;
int blen=2;
int res=0;
@@ -436,6 +437,13 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
if (chan)
ast_stopstream(chan);
+ if(file) {
+ end = strchr(file,':');
+ if(!strcasecmp(end,":end")) {
+ *end = '\0';
+ end++;
+ }
+ }
for (;;) {
gettimeofday(&started,NULL);
@@ -443,6 +451,10 @@ int ast_control_streamfile(struct ast_channel *chan, char *file, char *fwd, char
ast_stopstream(chan);
res = ast_streamfile(chan, file, chan->language);
if (!res) {
+ if(end) {
+ ast_seekstream(chan->stream, 0, SEEK_END);
+ end=NULL;
+ }
res = 1;
if (elapsed) {
ast_stream_fastforward(chan->stream, elapsed);