[asterisk-commits] jpeeler: branch 1.4 r263769 - /branches/1.4/apps/app_directory.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 18 13:55:00 CDT 2010


Author: jpeeler
Date: Tue May 18 13:54:58 2010
New Revision: 263769

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=263769
Log:
Modify directory name reading to be interrupted with operator or pound escape.

In the case of accidentally entering the wrong first three letters for the
reading, users could be very frustrated if the name listing is very long. This
allows interrupting the reading by pressing 0 or #. 0 will attempt to execute
a configured operator (o) extension and # will exit and proceed in the
dialplan.

ABE-2200

Modified:
    branches/1.4/apps/app_directory.c

Modified: branches/1.4/apps/app_directory.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_directory.c?view=diff&rev=263769&r1=263768&r2=263769
==============================================================================
--- branches/1.4/apps/app_directory.c (original)
+++ branches/1.4/apps/app_directory.c Tue May 18 13:54:58 2010
@@ -329,6 +329,14 @@
 	
 		if (res < 0) /* User hungup, so jump out now */
 			break;
+		if (res == '0') {
+		if (!ast_goto_if_exists(chan, dialcontext, "o", 1) ||
+		    (!ast_strlen_zero(chan->macrocontext) &&
+		     !ast_goto_if_exists(chan, chan->macrocontext, "o", 1))) {
+			/* return 1 to indicate goto has been performed */
+			return '1';
+			}
+		}
 		if (res == '1') {	/* Name selected */
 			if (fromappvm) {
 				/* We still want to set the exten though */
@@ -345,6 +353,8 @@
 			break;
 		}
 		if (res == '*') /* Skip to next match in list */
+			break;
+		if (res == '#')
 			break;
 
 		/* Not '1', or '*', so decrement number of tries */
@@ -516,6 +526,9 @@
 						lastuserchoice = res;
 						res = 0;
 						break;
+					case '#':
+						lastuserchoice = res;
+						return 0;
 					default:
 						break;
 				}
@@ -645,6 +658,8 @@
 		dirintro = ast_variable_retrieve(cfg, "general", "directoryintro");
 	if (ast_strlen_zero(dirintro))
 		dirintro = last ? "dir-intro" : "dir-intro-fn";
+	/* the above prompts probably should be modified to include 0 for dialing operator
+	   and # for exiting (continues in dialplan) */
 
 	if (chan->_state != AST_STATE_UP) 
 		res = ast_answer(chan);




More information about the asterisk-commits mailing list