aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-18 18:54:58 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-18 18:54:58 +0000
commit29efe52197b51f19e705d72ac5a80f46429cdf58 (patch)
treecb8a285e252e87f29a810f58c09493736c14ad5f /apps
parentd4cdb4796d6d5fa4f301656b97a793bd157b74c9 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@263769 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_directory.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/app_directory.c b/apps/app_directory.c
index 23d2b4d62..440b3f704 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -329,6 +329,14 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context,
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 */
@@ -346,6 +354,8 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context,
}
if (res == '*') /* Skip to next match in list */
break;
+ if (res == '#')
+ break;
/* Not '1', or '*', so decrement number of tries */
res = 0;
@@ -516,6 +526,9 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
lastuserchoice = res;
res = 0;
break;
+ case '#':
+ lastuserchoice = res;
+ return 0;
default:
break;
}
@@ -645,6 +658,8 @@ static int directory_exec(struct ast_channel *chan, void *data)
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);