aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_meetme.c
diff options
context:
space:
mode:
authorjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 23:21:29 +0000
committerjeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-12 23:21:29 +0000
commit07ddb232b321ca7e213c04a4b50fcff07ea6bc7c (patch)
tree25f2e07c91b4e00b3f461488cefeb45ad68c51f9 /apps/app_meetme.c
parentfaee778ff78f07b0fe8f2dea253f7b4b69440dd5 (diff)
Implement pin usage in MeetMe. Bug #816
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1990 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_meetme.c')
-rwxr-xr-xapps/app_meetme.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index b1555e9fd..580ebb5c3 100755
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -699,13 +699,36 @@ static int conf_exec(struct ast_channel *chan, void *data)
strcpy(confno, "");
} else {
if (strlen(cnf->pin)) {
- /* XXX Should prompt user for pin if pin is required XXX */
+ char pin[AST_MAX_EXTENSION];
+ if (inpin && *inpin) {
+ strncpy(pin, inpin, sizeof(pin) - 1);
+ } 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);
+ }
+ }
+ /* Pin invalid or error */
+ res = ast_streamfile(chan, "conf-invalidpin", chan->language);
+ if (!res)
+ ast_waitstream(chan, "");
+ res = -1;
+ if (allowretry)
+ strcpy(confno, "");
+ } else {
+ /* No pin required */
+ allowretry = 0;
+
+ /* Run the conference */
+ res = conf_run(chan, cnf, confflags);
}
- allowretry = 0;
-
- /* Run the conference */
- res = conf_run(chan, cnf, confflags);
}
}
} while (allowretry);