Index: res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.51 diff -u -r1.51 res_agi.c --- res_agi.c 4 Oct 2005 22:35:43 -0000 1.51 +++ res_agi.c 5 Oct 2005 15:13:58 -0000 @@ -524,7 +524,9 @@ static int handle_streamfile(struct ast_channel *chan, AGI *agi, int argc, char *argv[]) { int res; + int vres; struct ast_filestream *fs; + struct ast_filestream *vfs; long sample_offset = 0; long max_length; @@ -535,16 +537,26 @@ if ((argc > 4) && (sscanf(argv[4], "%ld", &sample_offset) != 1)) return RESULT_SHOWUSAGE; - fs = ast_openstream(chan, argv[2], chan->language); + fs = ast_openstream(chan, argv[2], chan->language); + if (!fs){ fdprintf(agi->fd, "200 result=%d endpos=%ld\n", 0, sample_offset); return RESULT_SUCCESS; } + + vfs = ast_openvstream(chan, argv[2], chan->language); + if (vfs) + ast_log(LOG_DEBUG, "Ooh, found a video stream, too\n"); + + ast_seekstream(fs, 0, SEEK_END); max_length = ast_tellstream(fs); ast_seekstream(fs, sample_offset, SEEK_SET); res = ast_applystream(chan, fs); + if (vfs) vres = ast_applystream(chan, vfs); res = ast_playstream(fs); + if (vfs) vres = ast_playstream(vfs); + if (res) { fdprintf(agi->fd, "200 result=%d endpos=%ld\n", res, sample_offset); if (res >= 0) @@ -2134,4 +2146,3 @@ { return ASTERISK_GPL_KEY; } -