]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Create the directory where name recordings will go if it does not exist.
authorJoshua Colp <jcolp@digium.com>
Thu, 10 Apr 2008 15:09:04 +0000 (15:09 +0000)
committerJoshua Colp <jcolp@digium.com>
Thu, 10 Apr 2008 15:09:04 +0000 (15:09 +0000)
(closes issue #12311)
Reported by: rkeene
Patches:
      12311-mkdir.diff uploaded by qwell (license 4)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_meetme.c

index 3a7d923c7b5a67379e20faff4ad9b3be8ff9e1db..847cb4256c2df1b0119d88b9f7762c905f3ae7cc 100644 (file)
@@ -1482,8 +1482,17 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
        ast_mutex_unlock(&conf->playlock);
 
        if (!(confflags & CONFFLAG_QUIET) && ((confflags & CONFFLAG_INTROUSER) || (confflags & CONFFLAG_INTROUSERNOREVIEW))) {
+               char destdir[PATH_MAX];
+
+               snprintf(destdir, sizeof(destdir), "%s/meetme", ast_config_AST_SPOOL_DIR);
+
+               if (mkdir(destdir, 0777) && errno != EEXIST) {
+                       ast_log(LOG_WARNING, "mkdir '%s' failed: %s\n", destdir, strerror(errno));
+                       goto outrun;
+               }
+
                snprintf(user->namerecloc, sizeof(user->namerecloc),
-                        "%s/meetme/meetme-username-%s-%d", ast_config_AST_SPOOL_DIR,
+                        "%s/meetme-username-%s-%d", destdir,
                         conf->confno, user->user_no);
                if (confflags & CONFFLAG_INTROUSERNOREVIEW)
                        res = ast_play_and_record(chan, "vm-rec-name", user->namerecloc, 10, "sln", &duration, 128, 0, NULL);