diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-05 06:39:43 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-05 06:39:43 +0000 |
commit | 4289ad18c32166ce2ab3417b68842c2af968c527 (patch) | |
tree | c933bd94a9af652b9d38c904e128ce3c1dfe8fd1 /apps | |
parent | a0ab5e9b80c9c1ea7e41e5a82705ff72da5b072f (diff) |
Merged revisions 38928 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r38928 | russell | 2006-08-05 02:37:59 -0400 (Sat, 05 Aug 2006) | 3 lines
make sure the priv-callerintros directory exists before trying to create a file
there (issue #7659, patch by hads, with some modifications by me)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38929 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_dial.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index 24fe9b7e0..99392abbc 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <stdio.h> #include <sys/time.h> #include <sys/signal.h> +#include <sys/stat.h> #include <netinet/in.h> #include "asterisk/lock.h" @@ -1001,7 +1002,13 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags unless it is already there-- this should be done before the call is actually dialed */ - /* make sure the priv-callerintros dir exists? */ + /* make sure the priv-callerintros dir actually exists */ + snprintf(privintro, sizeof(privintro), "%s/sounds/priv-callerintros", ast_config_AST_DATA_DIR); + if (mkdir(privintro, 0755) && errno != EEXIST) { + ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno)); + res = -1; + goto out; + } snprintf(privintro,sizeof(privintro), "priv-callerintros/%s", privcid); if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) { |