switch_status_t ret = SWITCH_STATUS_SUCCESS;
char *convert_cmd = profile->convert_cmd;
char *convert_ext = profile->convert_ext;
- int del_file = 0;
-
if (!params) {
switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS);
switch_safe_free(headers);
}
}
-
- if (!insert_db) {
- del_file = 1;
- }
}
if (session) {
failed:
- if (del_file && file_path && switch_file_exists(file_path, pool)) {
+ if (!insert_db && file_path && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) {
if (unlink(file_path) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", file_path);
}