[asterisk-commits] murf: trunk r79378 - in /trunk: channels/chan_zap.c main/channel.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Aug 14 08:46:59 CDT 2007
Author: murf
Date: Tue Aug 14 08:46:58 2007
New Revision: 79378
URL: http://svn.digium.com/view/asterisk?view=rev&rev=79378
Log:
Don't ask me why, but waitfordigit will immediately return a 1 on my system, unless the outfd is initialized to -1 before calling the nandfds func
Modified:
trunk/channels/chan_zap.c
trunk/main/channel.c
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=79378&r1=79377&r2=79378
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Tue Aug 14 08:46:58 2007
@@ -6079,6 +6079,7 @@
ast_hangup(chan);
return NULL;
} else if (res) {
+ ast_debug(1,"waitfordigit returned '%c' (%d), timeout = %d\n", res, res, timeout);
exten[len++]=res;
exten[len] = '\0';
}
Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=79378&r1=79377&r2=79378
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Aug 14 08:46:58 2007
@@ -1991,12 +1991,14 @@
if (ast_test_flag(c, AST_FLAG_ZOMBIE) || ast_check_hangup(c))
return -1;
/* Wait for a digit, no more than ms milliseconds total. */
+
while (ms) {
struct ast_channel *rchan;
- int outfd;
+ int outfd=-1;
errno = 0;
rchan = ast_waitfor_nandfds(&c, 1, &cmdfd, (cmdfd > -1) ? 1 : 0, NULL, &outfd, &ms);
+
if (!rchan && outfd < 0 && ms) {
if (errno == 0 || errno == EINTR)
continue;
@@ -2004,6 +2006,7 @@
return -1;
} else if (outfd > -1) {
/* The FD we were watching has something waiting */
+ ast_log(LOG_WARNING, "The FD we were waiting for has something waiting. Waitfordigit returning numeric 1\n");
return 1;
} else if (rchan) {
int res;
More information about the asterisk-commits
mailing list