From: Hunyadvári Péter Date: Tue, 20 Mar 2018 11:46:54 +0000 (+0100) Subject: FS-11046: [mod_dptools] Better logging for rename_function X-Git-Tag: v1.8.1~3^2~231^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74f47cb0eddf42bcf37c5b8fef225f95f51cabc6;p=thirdparty%2Ffreeswitch.git FS-11046: [mod_dptools] Better logging for rename_function --- diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 184b73e393..812e56a3f1 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -657,10 +657,15 @@ SWITCH_STANDARD_APP(rename_function) if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data)) && switch_split(lbuf, ' ', argv) == 2) { - switch_file_rename(argv[0], argv[1], switch_core_session_get_pool(session)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s RENAME: %s %s\n", switch_channel_get_name(switch_core_session_get_channel(session)), argv[0], argv[1]); + if (switch_file_rename(argv[0], argv[1], switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Can't rename %s to %s\n", + switch_channel_get_name(switch_core_session_get_channel(session)), argv[0], argv[1]); + } + } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", RENAME_SYNTAX); }