--- res_agi.c 2006-02-28 10:31:04.000000000 -0800 +++ ../../../asterisk-1.2.7.1/res/res_agi.c 2006-04-29 14:14:09.000000000 -0700 @@ -949,7 +949,7 @@ start = ast_tvnow(); while ((ms < 0) || ast_tvdiff_ms(ast_tvnow(), start) < ms) { - res = ast_waitfor(chan, -1); + res = ast_waitfor(chan, ms); if (res < 0) { ast_closestream(fs); fdprintf(agi->fd, "200 result=%d (waitfor) endpos=%ld\n", res,sample_offset);