[Asterisk-cvs] asterisk app.c,1.27,1.28

anthm at lists.digium.com anthm at lists.digium.com
Thu Sep 23 11:22:35 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv26902

Modified Files:
	app.c 
Log Message:
allow file arg in ast_control_streamfile to accept trailing :end to indicate an instant seek ti the end.

Index: app.c
===================================================================
RCS file: /usr/cvsroot/asterisk/app.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- app.c	23 Sep 2004 14:46:09 -0000	1.27
+++ app.c	23 Sep 2004 15:26:01 -0000	1.28
@@ -416,6 +416,7 @@
 	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 @@
 	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 @@
 			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);




More information about the svn-commits mailing list