From 4efa995ae1185e111ccce5d750b44b175a61758b Mon Sep 17 00:00:00 2001
From: James Golovich <james@gnuinter.net>
Date: Fri, 12 Mar 2004 18:49:52 +0000
Subject: [PATCH] Fix incorrect endpos when sildet is used during AGI record
 (bug 1210)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_agi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/apps/app_agi.c b/apps/app_agi.c
index 9e083f2318..67b017d2c3 100755
--- a/apps/app_agi.c
+++ b/apps/app_agi.c
@@ -625,6 +625,7 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
               	if (gotsilence) {
                      	ast_stream_rewind(fs, silence-1000);
                 	ast_truncstream(fs);
+			sample_offset = ast_tellstream(fs);
 		}		
 		fdprintf(agi->fd, "200 result=%d (timeout) endpos=%ld\n", res, sample_offset);
 		ast_closestream(fs);
-- 
GitLab