Index: apps/app_meetme.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v retrieving revision 1.72 diff -u -r1.72 app_meetme.c --- apps/app_meetme.c 22 Jan 2005 04:51:30 -0000 1.72 +++ apps/app_meetme.c 22 Jan 2005 21:37:06 -0000 @@ -125,6 +125,7 @@ char *recordingfilename; /* Filename to record the Conference into */ char *recordingformat; /* Format to record the Conference in */ char pin[AST_MAX_EXTENSION]; /* If protected by a PIN */ + char pinadmin[AST_MAX_EXTENSION]; /* If protected by a admin PIN */ struct ast_conference *next; } *confs; @@ -223,7 +224,7 @@ ast_mutex_unlock(&conflock); } -static struct ast_conference *build_conf(char *confno, char *pin, int make, int dynamic) +static struct ast_conference *build_conf(char *confno, char *pin, char *pinadmin, int make, int dynamic) { struct ast_conference *cnf; struct zt_confinfo ztc; @@ -241,6 +242,7 @@ memset(cnf, 0, sizeof(struct ast_conference)); strncpy(cnf->confno, confno, sizeof(cnf->confno) - 1); strncpy(cnf->pin, pin, sizeof(cnf->pin) - 1); + strncpy(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin) - 1); cnf->markedusers = 0; cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo", NULL); if (cnf->chan) { @@ -1181,9 +1183,9 @@ /* Query the user to enter a PIN */ ast_app_getdata(chan, "conf-getpin", dynamic_pin, AST_MAX_EXTENSION - 1, 0); } - cnf = build_conf(confno, dynamic_pin, make, dynamic); + cnf = build_conf(confno, dynamic_pin, "", make, dynamic); } else { - cnf = build_conf(confno, "", make, dynamic); + cnf = build_conf(confno, "", "", make, dynamic); } } else { /* Check the config */ @@ -1196,16 +1198,23 @@ while(var) { if (!strcasecmp(var->name, "conf")) { /* Separate the PIN */ - char *pin, *conf; + char *pin, *pinadmin, *conf; - if ((pin = ast_strdupa(var->value))) { - conf = strsep(&pin, "|,"); + if ((pinadmin = ast_strdupa(var->value))) { + conf = strsep(&pinadmin, "|,"); + pin = strsep(&pinadmin, "|,"); if (!strcasecmp(conf, confno)) { /* Bingo it's a valid conference */ if (pin) - cnf = build_conf(confno, pin, make, dynamic); + if (pinadmin) + cnf = build_conf(confno, pin, pinadmin, make, dynamic); + else + cnf = build_conf(confno, pin, "", make, dynamic); else - cnf = build_conf(confno, "", make, dynamic); + if (pinadmin) + cnf = build_conf(confno, "", pinadmin, make, dynamic); + else + cnf = build_conf(confno, "", "", make, dynamic); break; } } @@ -1472,7 +1481,7 @@ if (allowretry) confno[0] = '\0'; } else { - if (!ast_strlen_zero(cnf->pin)) { + if ((!ast_strlen_zero(cnf->pin) && ! (confflags & CONFFLAG_ADMIN)) || (!ast_strlen_zero(cnf->pinadmin) && (confflags & CONFFLAG_ADMIN))) { char pin[AST_MAX_EXTENSION]=""; int j; @@ -1486,9 +1495,12 @@ res = ast_app_getdata(chan, "conf-getpin", pin + strlen(pin), sizeof(pin) - 1 - strlen(pin), 0); } if (res >= 0) { - if (!strcasecmp(pin, cnf->pin)) { + if (!strcasecmp(pin, cnf->pin) || (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin))) { + /* Pin correct */ allowretry = 0; + if (!ast_strlen_zero(cnf->pinadmin) && !strcasecmp(pin, cnf->pinadmin)) + confflags |= CONFFLAG_ADMIN; /* Run the conference */ res = conf_run(chan, cnf, confflags); break; Index: configs/meetme.conf.sample =================================================================== RCS file: /usr/cvsroot/asterisk/configs/meetme.conf.sample,v retrieving revision 1.2 diff -u -r1.2 meetme.conf.sample --- configs/meetme.conf.sample 14 Jan 2004 06:38:29 -0000 1.2 +++ configs/meetme.conf.sample 22 Jan 2005 21:37:06 -0000 @@ -4,7 +4,7 @@ ; [rooms] ; -; Usage is conf => confno[,pin] +; Usage is conf => confno[,pin][,adminpin] ; ;conf => 1234 ;conf => 2345,9938