mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
Issue 9990 - New API ast_mkdir, which creates parent directories as necessary (and is faster than an outcall to mkdir -p)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1146,13 +1146,13 @@ static int setup_privacy_args(struct privacy_args *pa,
|
||||
|
||||
/* make sure the priv-callerintros dir actually exists */
|
||||
snprintf(pa->privintro, sizeof(pa->privintro), "%s/sounds/priv-callerintros", ast_config_AST_DATA_DIR);
|
||||
if (mkdir(pa->privintro, 0755) && errno != EEXIST) {
|
||||
ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno));
|
||||
if ((res = ast_mkdir(pa->privintro, 0755))) {
|
||||
ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(res));
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(pa->privintro,sizeof(pa->privintro), "priv-callerintros/%s", pa->privcid);
|
||||
if (ast_fileexists(pa->privintro,NULL,NULL ) > 0 && strncmp(pa->privcid,"NOCALLERID",10) != 0) {
|
||||
snprintf(pa->privintro, sizeof(pa->privintro), "priv-callerintros/%s", pa->privcid);
|
||||
if (ast_fileexists(pa->privintro, NULL, NULL ) > 0 && strncmp(pa->privcid, "NOCALLERID", 10) != 0) {
|
||||
/* the DELUX version of this code would allow this caller the
|
||||
option to hear and retape their previously recorded intro.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user