Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 179055) +++ apps/app_meetme.c (working copy) @@ -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] = ""; @@ -3355,6 +3357,7 @@ char adminopts[OPTIONS_LEN]; struct ast_tm tm, etm; struct timeval endtime = { .tv_sec = 0 }; + const char *var2; if (rt_schedule) { now = ast_tvnow(); @@ -3420,6 +3423,10 @@ 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, "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); @@ -3438,9 +3445,33 @@ 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 (ast_strlen_zero(recordingfilename)) { //If the recordingfilename in the database is empty, use the channel definition or use the default. + ast_channel_lock(chan); + if ((var2 = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE"))) { + cnf->recordingfilename = ast_strdup(var2); + } + ast_channel_unlock(chan); + if (!cnf->recordingfilename) { + snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", cnf->confno, chan->uniqueid); + cnf->recordingfilename = ast_strdup(recordingtmp); + } + } + if (ast_strlen_zero(cnf->recordingformat)) {//If the recording format is empty, use the wav as default + ast_channel_lock(chan); + if ((var2 = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT"))) { + cnf->recordingformat = ast_strdup(var2); + } + ast_channel_unlock(chan); + if (!cnf->recordingformat) { + 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); + } } } @@ -3816,6 +3847,7 @@ } } /* Run the conference */ + 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 {