mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Add option to prompt for PIN even if specified (bug #3489)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -84,7 +84,8 @@ static char *descrip =
|
|||||||
" (Note: This does not work with non-Zap channels in the same conference)\n"
|
" (Note: This does not work with non-Zap channels in the same conference)\n"
|
||||||
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
|
" 's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
|
||||||
" 'a' -- set admin mode\n"
|
" 'a' -- set admin mode\n"
|
||||||
" 'A' -- set marked mode\n";
|
" 'A' -- set marked mode\n"
|
||||||
|
" 'P' -- always prompt for the pin even if it is specified\n";
|
||||||
|
|
||||||
static char *descrip2 =
|
static char *descrip2 =
|
||||||
" MeetMeCount(confno[|var]): Plays back the number of users in the specifiedi\n"
|
" MeetMeCount(confno[|var]): Plays back the number of users in the specifiedi\n"
|
||||||
@@ -1324,6 +1325,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
int confflags = 0;
|
int confflags = 0;
|
||||||
int dynamic = 0;
|
int dynamic = 0;
|
||||||
int empty = 0, empty_no_pin = 0;
|
int empty = 0, empty_no_pin = 0;
|
||||||
|
int always_prompt = 0;
|
||||||
char *notdata, *info, *inflags = NULL, *inpin = NULL, the_pin[AST_MAX_EXTENSION] = "";
|
char *notdata, *info, *inflags = NULL, *inpin = NULL, the_pin[AST_MAX_EXTENSION] = "";
|
||||||
|
|
||||||
if (!data || ast_strlen_zero(data)) {
|
if (!data || ast_strlen_zero(data)) {
|
||||||
@@ -1397,6 +1399,8 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
empty = 1;
|
empty = 1;
|
||||||
empty_no_pin = 1;
|
empty_no_pin = 1;
|
||||||
}
|
}
|
||||||
|
if (strchr(inflags, 'P'))
|
||||||
|
always_prompt = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -1529,7 +1533,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
/* Allow the pin to be retried up to 3 times */
|
/* Allow the pin to be retried up to 3 times */
|
||||||
for (j=0; j<3; j++) {
|
for (j=0; j<3; j++) {
|
||||||
if (*the_pin) {
|
if (*the_pin && (always_prompt==0)) {
|
||||||
strncpy(pin, the_pin, sizeof(pin) - 1);
|
strncpy(pin, the_pin, sizeof(pin) - 1);
|
||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -1563,7 +1567,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Don't retry pin with a static pin */
|
/* Don't retry pin with a static pin */
|
||||||
if (*the_pin) {
|
if (*the_pin && (always_prompt==0)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user