提交 7eba3f2b authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3927 --resolve

上级 ba1db5b6
......@@ -5312,6 +5312,27 @@ SWITCH_STANDARD_API(log_function)
return SWITCH_STATUS_SUCCESS;
}
SWITCH_STANDARD_API(file_exists_function)
{
if (!zstr(cmd)) {
switch_memory_pool_t *pool;
switch_core_new_memory_pool(&pool);
if (switch_file_exists(cmd, pool) == SWITCH_STATUS_SUCCESS) {
stream->write_function(stream, "true");
} else {
stream->write_function(stream, "false");
}
switch_core_destroy_memory_pool(&pool);
} else {
stream->write_function(stream, "false");
}
return SWITCH_STATUS_SUCCESS;
}
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
{
switch_api_interface_t *commands_api_interface;
......@@ -5436,6 +5457,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
SWITCH_ADD_API(commands_api_interface, "xml_flush_cache", "clear xml cache", xml_flush_function, "<id> <key> <val>");
SWITCH_ADD_API(commands_api_interface, "xml_locate", "find some xml", xml_locate_function, "[root | <section> <tag> <tag_attr_name> <tag_attr_val>]");
SWITCH_ADD_API(commands_api_interface, "xml_wrap", "Wrap another api command in xml", xml_wrap_api_function, "<command> <args>");
SWITCH_ADD_API(commands_api_interface, "file_exists", "check if a file exists on server", file_exists_function, "<file>");
switch_console_set_complete("add alias add");
......@@ -5577,6 +5599,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
switch_console_set_complete("add version");
switch_console_set_complete("add uuid_warning ::console::list_uuid");
switch_console_set_complete("add ...");
switch_console_set_complete("add file_exists");
/* indicate that the module should continue to be loaded */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论