[Asterisk-cvs] asterisk/apps app_directory.c,1.24,1.25

markster at lists.digium.com markster at lists.digium.com
Mon Jun 28 11:22:47 CDT 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv10139/apps

Modified Files:
	app_directory.c 
Log Message:
Directory fixes (bug #1887)


Index: app_directory.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_directory.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- app_directory.c	23 Jun 2004 00:06:46 -0000	1.24
+++ app_directory.c	28 Jun 2004 15:08:39 -0000	1.25
@@ -128,7 +128,7 @@
  */
 static int play_mailbox_owner(struct ast_channel *chan, char *context, char *dialcontext, char *ext, char *name) {
 	int res = 0;
-	int loop = -1;
+	int loop = 3;
 	char fn[256];
 	char fn2[256];
 
@@ -172,6 +172,7 @@
 		if (res > -1) {
 			switch (res) {
 				case '1':
+					/* Name selected */
 					loop = 0;
 					if (ast_exists_extension(chan,dialcontext,ext,1,chan->callerid)) {
 						strncpy(chan->exten, ext, sizeof(chan->exten)-1);
@@ -187,14 +188,21 @@
 					break;
 	
 				case '*':   
+					/* Skip to next match in list */
 					loop = 0;
 					break;
 	
 				default:
+					/* Not '1', or '*', so decrement number of tries */
 					res = 0;
+					loop--;
 					break;
 			} /* end switch */
 		} /* end if */
+		else {
+			/* User hungup, so jump out now */
+			loop = 0;
+		}
 	} /* end while */
 
 	return(res);
@@ -261,7 +269,9 @@
 				res = play_mailbox_owner(chan, context, dialcontext, v->name, name);
 				switch (res) {
 					case -1:
-						/* user pressed '1' but extension does not exist */
+						/* user pressed '1' but extension does not exist, or
+						 * user hungup
+						 */
 						lastuserchoice = 0;
 						break;
 					case '1':




More information about the svn-commits mailing list