aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_authenticate.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-11 15:16:50 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-11-11 15:16:50 +0000
commit168e94e59bfffbb6f3839dde717c59d80366f931 (patch)
treeae8e4216df00d83a8f0b8fedea6ff7df98c2d1fe /apps/app_authenticate.c
parent2240be6b66a85fe716956d6f6938eabd3c0fef9b (diff)
On second thought, require 'j' option to enable new jumping feature
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4205 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_authenticate.c')
-rwxr-xr-xapps/app_authenticate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c
index 7f681006c..8c5d0722e 100755
--- a/apps/app_authenticate.c
+++ b/apps/app_authenticate.c
@@ -42,12 +42,15 @@ static char *descrip =
"of the following letters:\n"
" a - Set account code to the password that is entered\n"
" d - Interpret path as database key, not literal file\n"
+" j - Support jumping to n+101\n"
" r - Remove database key upon successful entry (valid with 'd' only)\n"
"\n"
"When using a database key, the value associated with the key can be\n"
"anything.\n"
"Returns 0 if the user enters a valid password within three\n"
-"tries, or -1 (or on hangup) or n+101 if exists.\n";
+"tries, or -1 on hangup. If the priority n+101 exists and invalid\n"
+"authentication was entered, and the 'j' flag was specified, processing\n"
+"will jump to n+101 and 0 will be returned.\n";
STANDARD_LOCAL_USER;
@@ -56,6 +59,7 @@ LOCAL_USER_DECL;
static int auth_exec(struct ast_channel *chan, void *data)
{
int res=0;
+ int jump = 0;
int retries;
struct localuser *u;
char password[256]="";
@@ -81,6 +85,8 @@ static int auth_exec(struct ast_channel *chan, void *data)
opts++;
} else
opts = "";
+ if (strchr(opts, 'j'))
+ jump = 1;
/* Start asking for password */
prompt = "agent-pass";
for (retries = 0; retries < 3; retries++) {
@@ -133,7 +139,7 @@ static int auth_exec(struct ast_channel *chan, void *data)
if (!res)
res = ast_waitstream(chan, "");
} else {
- if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
+ if (jump && ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 101, chan->cid.cid_num)) {
chan->priority+=100;
res = 0;
} else {