[asterisk-commits] mmichelson: branch 1.6.0 r136634 - in /branches/1.6.0: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 7 14:54:48 CDT 2008


Author: mmichelson
Date: Thu Aug  7 14:54:47 2008
New Revision: 136634

URL: http://svn.digium.com/view/asterisk?view=rev&rev=136634
Log:
Merged revisions 136633 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r136633 | mmichelson | 2008-08-07 14:54:27 -0500 (Thu, 07 Aug 2008) | 7 lines

Fix a calculation error I had made in the poll. The poll
would reset to 500 ms every time a non-voice frame
was received. The total time we poll should be 500 ms, so
now we save the amount of time left after the poll returned
and use that as our argument for the next call to poll


........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/channel.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/channel.c?view=diff&rev=136634&r1=136633&r2=136634
==============================================================================
--- branches/1.6.0/main/channel.c (original)
+++ branches/1.6.0/main/channel.c Thu Aug  7 14:54:47 2008
@@ -1694,17 +1694,20 @@
 			ast_safe_sleep(chan, delay);
 		else {
 			struct ast_frame *f;
+			int ms = ANSWER_WAIT_MS;
 			while (1) {
 				/* 500 ms was the original delay here, so now
 				 * we cap our waiting at 500 ms
 				 */
-				res = ast_waitfor(chan, ANSWER_WAIT_MS);
-				if (res < 0) {
+				ms = ast_waitfor(chan, ms);
+				if (ms < 0) {
 					ast_log(LOG_WARNING, "Error condition occurred when polling channel %s for a voice frame: %s\n", chan->name, strerror(errno));
+					res = -1;
 					break;
 				}
-				if (res == 0) {
+				if (ms == 0) {
 					ast_debug(2, "Didn't receive a voice frame from %s within %d ms of answering. Continuing anyway\n", chan->name, ANSWER_WAIT_MS);
+					res = 0;
 					break;
 				}
 				f = ast_read(chan);




More information about the asterisk-commits mailing list