Skip to content

Commit

Permalink
Merge pull request #29 from cdevelop/fix_recordfile_privilege
Browse files Browse the repository at this point in the history
支持配置录音文件默认权限
  • Loading branch information
seven1240 authored Mar 19, 2024
2 parents fd51939 + 55a7a33 commit 069fc3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/switch_ivr_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -2941,6 +2941,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session_event(switch_core_sess
char *file_path = NULL;
char *ext;
char *in_file = NULL, *out_file = NULL;
switch_fileperms_t fileperms = SWITCH_DEFAULT_DIR_PERMS;

if ((p = get_recording_var(channel, vars, "RECORD_HANGUP_ON_ERROR"))) {
hangup_on_error = switch_true(p);
Expand Down Expand Up @@ -3113,8 +3114,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session_event(switch_core_sess
if (*path == '{') {
path = switch_find_end_paren(path, '{', '}') + 1;
}
if ((vval = get_recording_var(channel, vars, "RECORD_DIR_PERMS"))) {
fileperms = strtol(vval, 0, 16);
}


if (switch_dir_make_recursive(path, SWITCH_DEFAULT_DIR_PERMS, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
if (switch_dir_make_recursive(path, fileperms, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error creating %s\n", path);
set_completion_cause(rh, "uri-failure");
switch_goto_status(SWITCH_STATUS_GENERR, err);
Expand Down

0 comments on commit 069fc3c

Please sign in to comment.