aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-27 03:08:00 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-07-27 03:08:00 +0000
commit95e8895aed14e10eb59592bdb5bc9335bc52465a (patch)
tree658857ddce4416da2d1f6171ba46dd48bb76e569 /apps
parent5b52d9261d58b35cbe5df0f6f70efc6d45e9a0ad (diff)
Merge tilghman's meetme fix for reentering pin (bug #2143)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3520 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_meetme.c59
1 files changed, 35 insertions, 24 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 983bf5f4e..091a613be 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -1324,33 +1324,44 @@ static int conf_exec(struct ast_channel *chan, void *data)
confno[0] = '\0';
} else {
if (!ast_strlen_zero(cnf->pin)) {
- char pin[AST_MAX_EXTENSION];
-
- if (*the_pin) {
- strncpy(pin, the_pin, sizeof(pin) - 1);
- res = 0;
- } else {
- /* Prompt user for pin if pin is required */
- res = ast_app_getdata(chan, "conf-getpin", pin, sizeof(pin) - 1, 0);
- }
- if (res >= 0) {
- if (!strcasecmp(pin, cnf->pin)) {
- /* Pin correct */
- allowretry = 0;
- /* Run the conference */
- res = conf_run(chan, cnf, confflags);
+ char pin[AST_MAX_EXTENSION]="";
+ int j;
+
+ /* Allow the pin to be retried up to 3 times */
+ for (j=0; j<3; j++) {
+ if (*the_pin) {
+ strncpy(pin, the_pin, sizeof(pin) - 1);
+ res = 0;
+ } else {
+ /* Prompt user for pin if pin is required */
+ res = ast_app_getdata(chan, "conf-getpin", pin, sizeof(pin) - 1, 0);
+ }
+ if (res >= 0) {
+ if (!strcasecmp(pin, cnf->pin)) {
+ /* Pin correct */
+ allowretry = 0;
+ /* Run the conference */
+ res = conf_run(chan, cnf, confflags);
+ break;
+ } else {
+ /* Pin invalid */
+ res = ast_streamfile(chan, "conf-invalidpin", chan->language);
+ if (!res)
+ ast_waitstream(chan, "");
+ res = -1;
+ if (allowretry)
+ confno[0] = '\0';
+ }
} else {
- /* Pin invalid */
- res = ast_streamfile(chan, "conf-invalidpin", chan->language);
- if (!res)
- ast_waitstream(chan, "");
res = -1;
- if (allowretry)
- confno[0] = '\0';
+ allowretry = 0;
+ break;
+ }
+
+ /* Don't retry pin with a static pin */
+ if (*the_pin) {
+ break;
}
- } else {
- res = -1;
- allowretry = 0;
}
} else {
/* No pin required */