[asterisk-commits] branch bweschke/findme_followme - r7532 /team/bweschke/findme_followme/apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Dec 19 22:30:08 CST 2005


Author: bweschke
Date: Mon Dec 19 22:30:06 2005
New Revision: 7532

URL: http://svn.digium.com/view/asterisk?rev=7532&view=rev
Log:
 More debugging work. Fixing the retry attempt looping mechanism and making sure the digits collected from the user are stored properly for later confirmation.

Modified:
    team/bweschke/findme_followme/apps/app_followme.c

Modified: team/bweschke/findme_followme/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/findme_followme/apps/app_followme.c?rev=7532&r1=7531&r2=7532&view=diff
==============================================================================
--- team/bweschke/findme_followme/apps/app_followme.c (original)
+++ team/bweschke/findme_followme/apps/app_followme.c Mon Dec 19 22:30:06 2005
@@ -555,13 +555,28 @@
 							ast_log(LOG_DEBUG, "digit is in?\n");
 						}
 						
+						if (!d)
+							d = -1;
+						
 						while ((!passed) && (attempts < maxretries)) {
 							
-							yn[0] = 0;
-							while ((d != 0) && (ynidx <= 3) && (ynidx < (ynlongest-1))) {
+							if (outbound->stream)
+								d = ast_waitstream(outbound, AST_DIGIT_ANY);
+								
+							if (d && (d != -1)) {
+								ast_log(LOG_DEBUG, "waitfordigit result %d\n", d);
+								if (d) {
+									yn[ynidx] = d;
+									ynidx++;
+								}
+							}
+							
+							ast_log(LOG_DEBUG, "d: %d ynidx: %d ynlongest: %d \n", d, ynidx, ynlongest);
+							
+							while ((d != 0) && (ynidx <= 3) && (ynidx < (ynlongest))) {
+								d = ast_waitfordigit(outbound, featuredigittimeout);
 								yn[ynidx] = d;
 								ynidx++;
-								d = ast_waitfordigit(outbound, featuredigittimeout);
 							}
 							yn[ynidx] = 0;
 							
@@ -612,9 +627,7 @@
 								{
 									ast_log(LOG_DEBUG, "we got a call, and a digit, but it wasn't a 1 or a 2\n");
 									ast_streamfile(outbound, "press-1-to-be-connected-or", outbound->language);
-									if (outbound->stream) 
-										d = ast_waitstream(outbound, AST_DIGIT_ANY);
-									ast_log(LOG_DEBUG, "waitfordigit result %d\n", d);
+									ynidx = 0;
 								}
 							}
 							else



More information about the asterisk-commits mailing list