FreeSWITCH API Documentation
1.7.0
|
Simple Console. More...
#include <switch.h>
Go to the source code of this file.
Macros | |
#define | SWITCH_CMD_CHUNK_LEN 1024 |
#define | SWITCH_STANDARD_STREAM(s) |
Simple Console.
This module implements a basic console i/o and by basic I mean, um yeah, basic Right now the primary function of this portion of the program is to keep it from exiting.
Definition in file switch_console.h.
#define SWITCH_CMD_CHUNK_LEN 1024 |
Definition at line 45 of file switch_console.h.
#define SWITCH_STANDARD_STREAM | ( | s | ) |
Definition at line 46 of file switch_console.h.
Referenced by api_hook(), do_api_on(), API::execute(), API::executeString(), parse_presence_data_cols(), preprocess_exec_set(), record_callback(), Stream::Stream(), switch_channel_build_param_string(), switch_channel_expand_variables_check(), switch_channel_get_cap_string(), switch_channel_get_flag_string(), switch_channel_set_timestamps(), switch_console_complete(), switch_console_process(), switch_console_set_complete(), switch_core_init_and_modload(), switch_event_build_param_string(), switch_event_expand_headers_check(), switch_ivr_record_file(), switch_nat_republish(), switch_nat_status(), and switch_say_file_handle_create().
switch_status_t switch_console_add_complete_func | ( | const char * | name, |
switch_console_complete_callback_t | cb | ||
) |
Definition at line 1676 of file switch_console.c.
References globals, switch_core_hash_insert, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_console_init().
unsigned char switch_console_complete | ( | const char * | line, |
const char * | last_word, | ||
FILE * | console_out, | ||
switch_stream_handle_t * | stream, | ||
switch_xml_t | xml | ||
) |
Definition at line 699 of file switch_console.c.
References buf, CC_ERROR, CC_REDISPLAY, comp_callback(), switch_stream_handle::data, end_of_p, helper::hits, helper::last, helper::len, helper::out, helper::partial, SCDB_TYPE_CORE_DB, helper::stream, switch_assert, switch_cache_db_execute_sql_callback(), switch_cache_db_get_type(), switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, switch_core_db_handle, switch_core_get_hostname(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), switch_safe_free, switch_separate_string(), SWITCH_STANDARD_STREAM, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_xml_add_child_d, switch_xml_set_attr_d_buf, switch_xml_set_txt_d, helper::words, switch_stream_handle::write_function, helper::xml, helper::xml_off, and zstr.
switch_status_t switch_console_del_complete_func | ( | const char * | name | ) |
Definition at line 1687 of file switch_console.c.
References globals, switch_core_hash_insert, switch_mutex_lock(), and switch_mutex_unlock().
switch_status_t switch_console_execute | ( | char * | xcmd, |
int | rec, | ||
switch_stream_handle_t * | istream | ||
) |
Definition at line 347 of file switch_console.c.
References switch_api_execute(), SWITCH_CHANNEL_LOG, switch_console_expand_alias(), SWITCH_LOG_CRIT, switch_log_printf(), switch_safe_free, switch_separate_string_string(), and SWITCH_STATUS_FALSE.
Referenced by switch_console_process(), and switch_core_init_and_modload().
char* switch_console_expand_alias | ( | char * | cmd, |
char * | arg | ||
) |
Definition at line 240 of file switch_console.c.
References alias_callback(), SCDB_TYPE_CORE_DB, SCF_USE_SQL, switch_cache_db_execute_sql_callback(), switch_cache_db_get_type(), switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, switch_core_db_handle, switch_core_flags(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), switch_safe_free, and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_execute().
void switch_console_free_matches | ( | switch_console_callback_match_t ** | matches | ) |
Definition at line 1698 of file switch_console.c.
References cur, switch_console_callback_match::dynamic, switch_console_callback_match::head, switch_console_callback_match_node::next, and switch_console_callback_match_node::val.
Referenced by comp_callback().
switch_status_t switch_console_init | ( | switch_memory_pool_t * | pool | ) |
Definition at line 1660 of file switch_console.c.
References globals, switch_console_add_complete_func(), switch_console_list_available_modules(), switch_console_list_interfaces(), switch_console_list_loaded_modules(), switch_console_list_uuid(), switch_core_hash_init, switch_mutex_init(), SWITCH_MUTEX_NESTED, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_init().
void switch_console_loop | ( | void | ) |
A simple comand loop that reads input from the terminal.
Definition at line 1552 of file switch_console.c.
References CMD_BUFLEN, console_xml_config(), memset(), running, SCSC_CHECK_RUNNING, SWITCH_CHANNEL_LOG_CLEAN, switch_console_process(), switch_core_get_switchname(), switch_core_session_ctl(), SWITCH_LOG_CONSOLE, and switch_log_printf().
Referenced by fs_console_loop(), and switch_core_runtime_loop().
void switch_console_printf | ( | switch_text_channel_t | channel, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | fmt, | ||
... | |||
) |
A method akin to printf that allows you to redirect output to a specific console "channel".
void switch_console_push_match | ( | switch_console_callback_match_t ** | matches, |
const char * | new_val | ||
) |
Definition at line 1791 of file switch_console.c.
References switch_zmalloc, and switch_console_callback_match_node::val.
Referenced by modulename_callback(), switch_console_push_match_unique(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_event_get_custom_events(), and uuid_callback().
void switch_console_push_match_unique | ( | switch_console_callback_match_t ** | matches, |
const char * | new_val | ||
) |
Definition at line 1777 of file switch_console.c.
References switch_console_callback_match_node::next, switch_console_push_match(), and switch_console_callback_match_node::val.
switch_status_t switch_console_run_complete_func | ( | const char * | func, |
const char * | line, | ||
const char * | last_word, | ||
switch_console_callback_match_t ** | matches | ||
) |
Definition at line 1814 of file switch_console.c.
References globals, switch_console_sort_matches(), switch_core_hash_find(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by comp_callback().
void switch_console_save_history | ( | void | ) |
Definition at line 972 of file switch_console.c.
References SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, and switch_log_printf().
Referenced by switch_core_session_ctl().
switch_status_t switch_console_shutdown | ( | void | ) |
Definition at line 1671 of file switch_console.c.
References globals, and switch_core_hash_destroy().
Referenced by switch_core_destroy().
void switch_console_sort_matches | ( | switch_console_callback_match_t * | matches | ) |
Definition at line 1719 of file switch_console.c.
References if(), switch_console_callback_match_node::next, and switch_assert.
Referenced by switch_console_run_complete_func().
void switch_status_t switch_console_stream_raw_write | ( | switch_stream_handle_t * | handle, |
uint8_t * | data, | ||
switch_size_t | datalen | ||
) |
Definition at line 126 of file switch_console.c.
References SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_console_stream_write | ( | switch_stream_handle_t * | handle, |
const char * | fmt, | ||
... | |||
) |
A method akin to printf for dealing with api streams.
switch_status_t switch_status_t switch_stream_write_file_contents | ( | switch_stream_handle_t * | stream, |
const char * | path | ||
) |
Definition at line 206 of file switch_console.c.
References switch_directories::conf_dir, switch_fp_read_dline(), SWITCH_GLOBAL_dirs, switch_is_file_path(), switch_mprintf(), SWITCH_PATH_SEPARATOR, switch_safe_free, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.