*cc.buf = '\0';
memset(&fh, 0, sizeof(fh));
cc.fh = &fh;
- TRY_CODE(switch_ivr_play_file(session, &fh, cbt->file_path, &args));
+ if (switch_file_exists(cbt->file_path, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
+ TRY_CODE(switch_ivr_play_file(session, &fh, cbt->file_path, &args));
+ }
}
if (!*cc.buf && (profile->play_date_announcement == VM_DATE_LAST)) {
switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL);
- if (!zstr(greet_path)) {
+ if (switch_file_exists(greet_path, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
memset(buf, 0, sizeof(buf));
TRY_CODE(switch_ivr_play_file(session, NULL, greet_path, &args));
} else {
- if (!zstr(cbt.name_path)) {
+ if (switch_file_exists(cbt.name_path, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
memset(buf, 0, sizeof(buf));
TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args));
}
switch_status_t status = SWITCH_STATUS_FALSE;
apr_finfo_t info = { 0 };
+ if (zstr(filename)) {
+ return status;
+ }
+
if (!pool) {
switch_core_new_memory_pool(&our_pool);
}
- if (filename) {
- apr_stat(&info, filename, wanted, pool ? pool : our_pool);
- if (info.filetype != APR_NOFILE) {
- status = SWITCH_STATUS_SUCCESS;
- }
+ apr_stat(&info, filename, wanted, pool ? pool : our_pool);
+ if (info.filetype != APR_NOFILE) {
+ status = SWITCH_STATUS_SUCCESS;
}
if (our_pool) {