--- ../asterisk/apps/app_meetme.c 2009-02-26 21:08:36.000000000 -0600 +++ apps/app_meetme.c 2009-02-27 12:33:59.000000000 -0600 @@ -494,7 +494,7 @@ /*! If set, user will be ask record name on entry of conference */ CONFFLAG_INTROUSER = (1 << 13), /*! If set, the MeetMe will be recorded */ - CONFFLAG_RECORDCONF = (1<< 14), + CONFFLAG_RECORDCONF = (1 << 14), /*! If set, the user will be monitored if the user is talking or not */ CONFFLAG_MONITORTALKER = (1 << 15), CONFFLAG_DYNAMIC = (1 << 16), @@ -1794,7 +1794,7 @@ { int res = 0; int confno_int = 0; - + AST_LIST_LOCK(&confs); if (ast_atomic_dec_and_test(&conf->refcount)) { /* Take the conference room number out of an inuse state */ @@ -3347,6 +3347,8 @@ char *pin = NULL, *pinadmin = NULL; /* For temp use */ int maxusers = 0; struct timeval now; + char recordingfilename[100] = ""; + char recordingformat[4] = ""; char currenttime[19] = ""; char eatime[19] = ""; char bookid[19] = ""; @@ -3395,7 +3397,7 @@ } else { var = ast_load_realtime("meetme", "confno", confno, NULL); } - + if (!var) return NULL; @@ -3420,14 +3422,22 @@ maxusers = atoi(var->value); } else if (!strcasecmp(var->name, "adminopts")) { ast_copy_string(adminopts, var->value, sizeof(char[OPTIONS_LEN])); - } else if (!strcasecmp(var->name, "endtime")) { + } + else if (!strcasecmp(var->name, "recordingfilename")) { + ast_copy_string(recordingfilename, var->value, sizeof(recordingfilename)); + } + else if (!strcasecmp(var->name, "recordingformat")) { + ast_copy_string(recordingformat, var->value, sizeof(recordingformat)); + } + else if (!strcasecmp(var->name, "endtime")) { struct ast_tm endtime_tm; ast_strptime(var->value, "%Y-%m-%d %H:%M:%S", &endtime_tm); endtime = ast_mktime(&endtime_tm, NULL); } } - ast_variables_destroy(origvar); + + ast_variables_destroy(origvar); cnf = build_conf(confno, pin ? pin : "", pinadmin ? pinadmin : "", make, dynamic, refcount, chan); @@ -3438,10 +3448,39 @@ cnf->useropts = ast_strdup(useropts); cnf->adminopts = ast_strdup(adminopts); cnf->bookid = ast_strdup(bookid); - snprintf(recordingtmp, sizeof(recordingtmp), "%s/meetme/meetme-conf-rec-%s-%s", ast_config_AST_SPOOL_DIR, confno, bookid); - cnf->recordingfilename = ast_strdup(recordingtmp); - cnf->recordingformat = ast_strdup("wav"); - } + cnf->recordingfilename = ast_strdup(recordingfilename); + cnf->recordingformat = ast_strdup(recordingformat); + + + if(strchr(cnf->useropts,'r')){ + if (strlen(recordingfilename) <= 1) { //If the recordingfilename in the database is empty, use the channel definition or use the default. + const char *var2; + if ((var2 = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE"))) { + cnf->recordingfilename = ast_strdup(var2); + } + if ((var2 = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT"))) { + cnf->recordingformat = ast_strdup(var2); + } + if (!cnf->recordingfilename) { + snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", cnf->confno, chan->uniqueid); + cnf->recordingfilename = ast_strdup(recordingtmp); + } + if (!cnf->recordingformat) { + cnf->recordingformat = ast_strdup("wav"); + } + } + if (strlen(cnf->recordingformat) <= 1) {//If the recording format is empty, use the wav as default + const char *var2; + if ((var2 = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT"))) { + cnf->recordingformat = ast_strdup(var2); + } + else { cnf->recordingformat = ast_strdup("wav"); + } + } +ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n", cnf->confno, cnf->recordingfilename, cnf->recordingformat); +} + +} } if (cnf) { @@ -3768,7 +3807,7 @@ int too_early = 0; cnf = find_conf_realtime(chan, confno, 1, dynamic, - the_pin, sizeof(the_pin), 1, &confflags,&too_early); + the_pin, sizeof(the_pin), 1, &confflags, &too_early); if (rt_schedule && too_early) allowretry = 0; } @@ -3816,7 +3855,10 @@ } } /* Run the conference */ - res = conf_run(chan, cnf, confflags.flags, optargs); + ast_verb(4, "Starting recording of MeetMe Conference %s into file %s.%s.\n", + cnf->confno, cnf->recordingfilename, cnf->recordingformat); + + res = conf_run(chan, cnf, confflags.flags, optargs); break; } else { /* Pin invalid */