FreeSWITCH API Documentation
1.7.0
|
Go to the source code of this file.
Data Structures | |
struct | helper |
struct | match_helper |
Macros | |
#define | CMD_BUFLEN 1024 |
#define | CC_NORM 0 |
#define | CC_NEWLINE 1 |
#define | CC_EOF 2 |
#define | CC_ARGHACK 3 |
#define | CC_REFRESH 4 |
#define | CC_CURSOR 5 |
#define | CC_ERROR 6 |
#define | CC_FATAL 7 |
#define | CC_REDISPLAY 8 |
#define | CC_REFRESH_BEEP 9 |
Variables | |
static char * | console_fnkeys [12] |
static int32_t | running = 1 |
struct { | |
switch_hash_t * func_hash | |
switch_mutex_t * func_mutex | |
} | globals |
#define CC_ARGHACK 3 |
Definition at line 53 of file switch_console.c.
#define CC_CURSOR 5 |
Definition at line 55 of file switch_console.c.
#define CC_EOF 2 |
Definition at line 52 of file switch_console.c.
#define CC_ERROR 6 |
Definition at line 56 of file switch_console.c.
Referenced by switch_console_complete().
#define CC_FATAL 7 |
Definition at line 57 of file switch_console.c.
#define CC_NEWLINE 1 |
Definition at line 51 of file switch_console.c.
#define CC_NORM 0 |
Definition at line 50 of file switch_console.c.
#define CC_REDISPLAY 8 |
Definition at line 58 of file switch_console.c.
Referenced by switch_console_complete().
#define CC_REFRESH 4 |
Definition at line 54 of file switch_console.c.
#define CC_REFRESH_BEEP 9 |
Definition at line 59 of file switch_console.c.
#define CMD_BUFLEN 1024 |
Definition at line 38 of file switch_console.c.
Referenced by switch_console_loop().
|
static |
Definition at line 233 of file switch_console.c.
Referenced by switch_console_expand_alias().
|
static |
Definition at line 466 of file switch_console.c.
References cur, switch_console_callback_match::head, helper::hits, helper::last, switch_console_callback_match_node::next, helper::out, helper::partial, helper::stream, switch_console_free_matches(), switch_console_run_complete_func(), switch_copy_string(), switch_safe_free, switch_separate_string(), SWITCH_STATUS_SUCCESS, switch_xml_add_child_d, switch_xml_set_txt_d, switch_console_callback_match_node::val, switch_stream_handle::write_function, helper::xml, helper::xml_off, and zstr.
Referenced by switch_console_complete().
|
static |
Definition at line 90 of file switch_console.c.
References console_fnkeys, switch_xml::next, SWITCH_CHANNEL_LOG, switch_core_permanent_strdup, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TERM, switch_xml_attr_soft(), switch_xml_child(), switch_xml_free(), and switch_xml_open_cfg().
Referenced by switch_console_loop().
|
static |
Definition at line 584 of file switch_console.c.
References match_helper::my_matches, and switch_console_push_match().
Referenced by switch_console_list_available_modules(), and switch_console_list_loaded_modules().
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 * | cursor, | ||
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().
switch_status_t switch_console_list_available_modules | ( | const char * | line, |
const char * | cursor, | ||
switch_console_callback_match_t ** | matches | ||
) |
Definition at line 592 of file switch_console.c.
References switch_directories::mod_dir, modulename_callback(), match_helper::my_matches, SWITCH_GLOBAL_dirs, switch_loadable_module_enumerate_available(), SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_init().
switch_status_t switch_console_list_interfaces | ( | const char * | line, |
const char * | cursor, | ||
switch_console_callback_match_t ** | matches | ||
) |
Definition at line 648 of file switch_console.c.
References SWITCH_STATUS_FALSE.
Referenced by switch_console_init().
switch_status_t switch_console_list_loaded_modules | ( | const char * | line, |
const char * | cursor, | ||
switch_console_callback_match_t ** | matches | ||
) |
Definition at line 608 of file switch_console.c.
References modulename_callback(), match_helper::my_matches, switch_loadable_module_enumerate_loaded(), SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_init().
switch_status_t switch_console_list_uuid | ( | const char * | line, |
const char * | cursor, | ||
switch_console_callback_match_t ** | matches | ||
) |
Definition at line 663 of file switch_console.c.
References match_helper::my_matches, switch_cache_db_execute_sql_callback(), switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, switch_core_db_handle, switch_core_get_switchname(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, uuid_callback(), and zstr.
Referenced by switch_console_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, | ||
... | |||
) |
Definition at line 401 of file switch_console.c.
References SWITCH_CHANNEL_ID_EVENT, SWITCH_CHANNEL_ID_LOG, SWITCH_CHANNEL_ID_LOG_CLEAN, switch_core_data_channel(), switch_cut_path(), switch_event_add_header(), switch_event_add_header_string(), switch_event_create, switch_event_fire, SWITCH_EVENT_LOG, switch_event_running(), switch_micro_time_now(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_SUCCESS, switch_strftime_nocheck(), switch_time_exp_lt(), and switch_vasprintf().
|
static |
Definition at line 313 of file switch_console.c.
References switch_stream_handle::data, switch_assert, switch_console_execute(), switch_core_get_console(), switch_safe_free, SWITCH_STANDARD_STREAM, and SWITCH_STATUS_SUCCESS.
Referenced by switch_console_loop().
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().
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, | ||
... | |||
) |
Definition at line 150 of file switch_console.c.
References buf, SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, switch_log_printf(), switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_vmprintf().
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.
|
static |
Definition at line 654 of file switch_console.c.
References match_helper::my_matches, and switch_console_push_match().
Referenced by switch_console_list_uuid().
|
static |
Definition at line 82 of file switch_console.c.
Referenced by console_xml_config().
switch_hash_t* func_hash |
Definition at line 1656 of file switch_console.c.
switch_mutex_t* func_mutex |
Definition at line 1657 of file switch_console.c.
struct { ... } globals |
|
static |
Definition at line 452 of file switch_console.c.
Referenced by switch_cache_db_execute_sql2str(), switch_console_loop(), switch_ivr_enterprise_originate(), and switch_ivr_menu_execute().