--- apps/app_meetme.c.old 2004-10-03 18:46:27.000000000 -0400 +++ apps/app_meetme.c 2004-10-03 19:00:10.000000000 -0400 @@ -49,7 +49,7 @@ static char *synopsis3 = "MeetMe conference Administration"; static char *descrip = -" MeetMe([confno][,[options][,pin]]): Enters the user into a specified MeetMe conference.\n" +" MeetMe([confno][,[options][,pin[,musicclass]]]): Enters the user into a specified MeetMe conference.\n" "If the conference number is omitted, the user will be prompted to enter\n" "one. \n" "MeetMe returns 0 if user pressed # to exit (see option 'p'), otherwise -1.\n" @@ -111,6 +111,7 @@ int isdynamic; /* Created on the fly? */ int locked; /* Is the conference locked? */ char pin[AST_MAX_EXTENSION]; /* If protected by a PIN */ + char musicclass[MAX_LANGUAGE]; /* Music class */ struct ast_conference *next; } *confs; @@ -201,7 +202,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 *musicclass, int make, int dynamic) { struct ast_conference *cnf; struct zt_confinfo ztc; @@ -219,6 +220,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->musicclass, musicclass, sizeof(cnf->musicclass) - 1); cnf->markedusers = 0; cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo"); if (cnf->chan) { @@ -584,7 +586,7 @@ /* If we're waiting with hold music, set to silent mode */ if (!res) { confflags |= CONFFLAG_QUIET; - ast_moh_start(chan, NULL); + ast_moh_start(chan, conf->musicclass); res = ast_safe_sleep_conditional(chan, 60000, confnonzero, conf); ast_moh_stop(chan); } @@ -751,7 +753,7 @@ if (confflags & CONFFLAG_MOH) { if (conf->users == 1) { if (musiconhold == 0) { - ast_moh_start(chan, NULL); + ast_moh_start(chan, conf->musicclass); musiconhold = 1; } } else { @@ -935,7 +937,7 @@ } } if (musiconhold) { - ast_moh_start(chan, NULL); + ast_moh_start(chan, conf->musicclass); } } else if (using_pseudo) { if (f->frametype == AST_FRAME_VOICE) { @@ -1053,7 +1055,7 @@ return ret; } -static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin) +static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, int make, int dynamic, char *dynamic_pin, char *dynamic_musicclass) { struct ast_config *cfg; struct ast_variable *var; @@ -1078,9 +1080,15 @@ /* 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); + if (dynamic_musicclass) + cnf = build_conf(confno, dynamic_pin, dynamic_musicclass, make, dynamic); + else + cnf = build_conf(confno, dynamic_pin, "", make, dynamic); } else { - cnf = build_conf(confno, "", make, dynamic); + if (dynamic_musicclass) + cnf = build_conf(confno, "", dynamic_musicclass, make, dynamic); + else + cnf = build_conf(confno, "", "", make, dynamic); } } else { /* Check the config */ @@ -1092,17 +1100,26 @@ var = ast_variable_browse(cfg, "rooms"); while(var) { if (!strcasecmp(var->name, "conf")) { - /* Separate the PIN */ - char *pin, *conf; + /* Separate the PIN and Music */ + char *pin, *conf, *musicclass; if ((pin = ast_strdupa(var->value))) { conf = strsep(&pin, "|,"); if (!strcasecmp(conf, confno)) { /* Bingo it's a valid conference */ - if (pin) - cnf = build_conf(confno, pin, make, dynamic); - else - cnf = build_conf(confno, "", make, dynamic); + musicclass = pin; + strsep(&musicclass, "|,"); + if (pin) { + if (musicclass) + cnf = build_conf(confno, pin, musicclass, make, dynamic); + else + cnf = build_conf(confno, pin, "", make, dynamic); + } else { + if (musicclass) + cnf = build_conf(confno, "", musicclass, make, dynamic); + else + cnf = build_conf(confno, "", "", make, dynamic); + } break; } } @@ -1141,7 +1158,7 @@ localdata = ast_strdupa(data); LOCAL_USER_ADD(u); confnum = strsep(&localdata,"|"); - conf = find_conf(chan, confnum, 0, 0, NULL); + conf = find_conf(chan, confnum, 0, 0, NULL, NULL); if (conf) count = conf->users; else @@ -1173,6 +1190,7 @@ int dynamic = 0; int empty = 0, empty_no_pin = 0; char *notdata, *info, *inflags = NULL, *inpin = NULL, the_pin[AST_MAX_EXTENSION] = ""; + char *inmusicclass = NULL, the_musicclass[MAX_LANGUAGE] = ""; /* Music class */ if (!data || ast_strlen_zero(data)) { allowretry = 1; @@ -1197,8 +1215,12 @@ inflags = strsep(&info, "|"); if (info) inpin = strsep(&info, "|"); + if (info) + inmusicclass = strsep(&info, "|"); if (inpin) strncpy(the_pin, inpin, sizeof(the_pin) - 1); + if (inmusicclass) + strncpy(the_musicclass, inmusicclass, sizeof(the_musicclass) - 1); if (inflags) { if (strchr(inflags, 'a')) @@ -1356,7 +1378,7 @@ } if (!ast_strlen_zero(confno)) { /* Check the validity of the conference */ - cnf = find_conf(chan, confno, 1, dynamic, the_pin); + cnf = find_conf(chan, confno, 1, dynamic, the_pin, the_musicclass); if (!cnf) { res = ast_streamfile(chan, "conf-invalid", chan->language); if (!res) --- configs/meetme.conf.sample.old 2004-10-03 17:35:47.000000000 -0400 +++ configs/meetme.conf.sample 2004-10-03 19:04:57.000000000 -0400 @@ -4,7 +4,11 @@ ; [rooms] ; -; Usage is conf => confno[,pin] +; Usage is conf => confno[,pin[,musicclass]] ; PIN can be empty +; Dynamicly created conferences override these static conference rooms +; Do not use spaces between arguments + ; -;conf => 1234 +;conf => 1234 +;conf => 1234,,random ;conf => 2345,9938