--- work/asterisk-1.0.9/res/res_agi.c Tue Jun 14 22:24:38 2005 +++ /root/res_agi.c Fri Sep 23 11:24:55 2005 @@ -449,7 +449,11 @@ else return RESULT_FAILURE; } - res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl); + if ( agi->audio > -1 && agi->ctrl > -1) + res = ast_waitstream_full(chan, argv[3], agi->audio, agi->ctrl); + else + res = ast_waitstream(chan, argv[3]); + /* this is to check for if ast_waitstream closed the stream, we probably are at * the end of the stream, return that amount, else check for the amount */ sample_offset = (chan->stream)?ast_tellstream(fs):max_length;