]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't wait forever, if there's a specified recording timeout.
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 11 Dec 2008 16:51:27 +0000 (16:51 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 11 Dec 2008 16:51:27 +0000 (16:51 +0000)
(closes issue #13885)
 Reported by: bamby
 Patches:
       res_agi.c.patch uploaded by bamby (license 430)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163088 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index 1119a2d6153c63c19aa7db0c1f2b344d085bbefb..40c15da8265b2cebe487bea07c8111670be3d2c4 100644 (file)
@@ -970,7 +970,7 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, char
                
                start = ast_tvnow();
                while ((ms < 0) || ast_tvdiff_ms(ast_tvnow(), start) < ms) {
-                       res = ast_waitfor(chan, -1);
+                       res = ast_waitfor(chan, ms - ast_tvdiff_ms(ast_tvnow(), start));
                        if (res < 0) {
                                ast_closestream(fs);
                                fdprintf(agi->fd, "200 result=%d (waitfor) endpos=%ld\n", res,sample_offset);