RTS API Documentation
1.10.11
|
Core Library. More...
#include <switch.h>
Go to the source code of this file.
Data Structures | |
struct | switch_core_time_duration |
struct | switch_app_log |
struct | switch_thread_data_s |
struct | switch_hold_record_s |
struct | device_uuid_node_s |
struct | switch_device_stats_s |
struct | switch_device_record_s |
struct | dtls_fp_s |
struct | switch_core_session_message |
A message object designed to allow unlike technologies to exchange data. More... | |
struct | switch_core_thread_session |
A generic object to pass as a thread's session object to allow mutiple arguements and a pool. More... | |
union | switch_cache_db_native_handle_t |
struct | switch_cache_db_core_db_options_t |
struct | switch_cache_db_odbc_options_t |
struct | switch_cache_db_database_interface_options_t |
union | switch_cache_db_connection_options_t |
Typedefs | |
typedef struct switch_thread_data_s | switch_thread_data_t |
typedef struct switch_hold_record_s | switch_hold_record_t |
typedef struct device_uuid_node_s | switch_device_node_t |
typedef struct switch_device_stats_s | switch_device_stats_t |
typedef struct switch_device_record_s | switch_device_record_t |
typedef void(* | switch_device_state_function_t) (switch_core_session_t *session, switch_channel_callstate_t callstate, switch_device_record_t *drec) |
typedef struct dtls_fp_s | dtls_fingerprint_t |
typedef int(* | switch_core_db_event_callback_func_t) (void *pArg, switch_event_t *event) |
typedef struct switch_cache_db_handle | switch_cache_db_handle_t |
Enumerations | |
enum | dtls_type_t { DTLS_TYPE_CLIENT = (1 << 0), DTLS_TYPE_SERVER = (1 << 1), DTLS_TYPE_RTP = (1 << 2), DTLS_TYPE_RTCP = (1 << 3) } |
enum | dtls_state_t { DS_OFF, DS_HANDSHAKE, DS_SETUP, DS_READY, DS_FAIL, DS_INVALID } |
enum | switch_hup_type_t { SHT_NONE = 0, SHT_UNANSWERED = (1 << 0), SHT_ANSWERED = (1 << 1) } |
enum | cache_db_flag_t { CDF_INUSE = (1 << 0), CDF_PRUNE = (1 << 1), CDF_NONEXPIRING = (1 << 2) } |
enum | switch_cache_db_handle_type_t { SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_DATABASE_INTERFACE } |
Core Library.
This module is the main core library and is the intended location of all fundamental operations.
Definition in file switch_core.h.
#define CACHE_DB_LEN 256 |
Definition at line 2555 of file switch_core.h.
Referenced by _switch_cache_db_get_db_handle(), and switch_cache_db_status().
#define DTLS_SRTP_FNAME "dtls-srtp" |
Definition at line 148 of file switch_core.h.
Referenced by generate_local_fingerprint(), switch_core_media_init(), and switch_rtp_add_dtls().
#define MAX_FPLEN 64 |
Definition at line 149 of file switch_core.h.
Referenced by switch_core_cert_expand_fingerprint(), and switch_core_cert_verify().
#define MAX_FPSTRLEN 192 |
Definition at line 150 of file switch_core.h.
#define MESSAGE_STAMP_FFL | ( | _m | ) | _m->_file = __FILE__; _m->_func = __SWITCH_FUNC__; _m->_line = __LINE__ |
Definition at line 175 of file switch_core.h.
Referenced by hanguphook(), send_display(), switch_channel_perform_audio_sync(), and switch_channel_perform_video_sync().
#define MESSAGE_STRING_ARG_MAX 10 |
Definition at line 177 of file switch_core.h.
Referenced by switch_core_session_free_message().
#define switch_cache_db_get_db_handle | ( | _a, | |
_b, | |||
_c | |||
) | _switch_cache_db_get_db_handle(_a, _b, _c, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2653 of file switch_core.h.
#define switch_cache_db_get_db_handle_dsn | ( | _a, | |
_b | |||
) | _switch_cache_db_get_db_handle_dsn(_a, _b, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2659 of file switch_core.h.
Referenced by sql_in_thread(), switch_sql_queue_manager_push_confirm(), and switch_user_sql_thread().
#define switch_cache_db_persistant_execute_trans | ( | _d, | |
_s, | |||
_r | |||
) | switch_cache_db_persistant_execute_trans_full(_d, _s, _r, NULL, NULL, NULL, NULL) |
Definition at line 2741 of file switch_core.h.
#define switch_core_db_handle | ( | _a | ) | _switch_core_db_handle(_a, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2729 of file switch_core.h.
Referenced by switch_console_complete(), switch_console_expand_alias(), switch_console_list_uuid(), switch_console_set_alias(), switch_core_recovery_flush(), switch_core_recovery_recover(), and switch_core_sqldb_start().
#define switch_core_session_force_request_video_refresh | ( | _s | ) | _switch_core_session_request_video_refresh(_s, 1, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2882 of file switch_core.h.
#define switch_core_session_request_video_refresh | ( | _s | ) | _switch_core_session_request_video_refresh(_s, 0, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2881 of file switch_core.h.
Referenced by check_jitter(), do_flush(), dtls_state_ready(), eavesdrop_callback(), jb_next_packet_by_seq(), process_rtcp_report(), read_rtp_packet(), record_callback(), rtp_common_write(), switch_channel_perform_video_sync(), switch_channel_set_flag_value(), switch_core_media_set_video_file(), switch_core_media_toggle_hold(), switch_core_session_execute_application_get_flags(), switch_core_session_passthru(), switch_core_session_read_video_frame(), switch_core_session_send_and_request_video_refresh(), switch_core_session_stop_media(), switch_core_session_video_reinit(), switch_core_session_video_reset(), switch_core_session_wait_for_video_input_params(), switch_ivr_eavesdrop_session(), switch_ivr_record_file_event(), switch_jb_get_packet(), switch_jb_reset(), switch_rtp_set_video_buffer_size(), text_bridge_thread(), video_helper_thread(), and video_write_thread().
#define SWITCH_MAX_CORE_THREAD_SESSION_OBJS 128 |
Definition at line 47 of file switch_core.h.
#define SWITCH_MAX_STREAMS 128 |
Definition at line 48 of file switch_core.h.
#define switch_sql_queue_manager_init | ( | _q, | |
_n, | |||
_d, | |||
_m, | |||
_p1, | |||
_p2, | |||
_ip1, | |||
_ip2 | |||
) | switch_sql_queue_manager_init_name(__FILE__, _q, _n, _d, _m, _p1, _p2, _ip1, _ip2) |
Definition at line 2850 of file switch_core.h.
typedef struct dtls_fp_s dtls_fingerprint_t |
typedef struct switch_cache_db_handle switch_cache_db_handle_t |
Definition at line 2600 of file switch_core.h.
typedef int(* switch_core_db_event_callback_func_t) (void *pArg, switch_event_t *event) |
Definition at line 2553 of file switch_core.h.
typedef struct device_uuid_node_s switch_device_node_t |
typedef struct switch_device_record_s switch_device_record_t |
typedef void(* switch_device_state_function_t) (switch_core_session_t *session, switch_channel_callstate_t callstate, switch_device_record_t *drec) |
Definition at line 145 of file switch_core.h.
typedef struct switch_device_stats_s switch_device_stats_t |
typedef struct switch_hold_record_s switch_hold_record_t |
typedef struct switch_thread_data_s switch_thread_data_t |
enum cache_db_flag_t |
Enumerator | |
---|---|
CDF_INUSE | |
CDF_PRUNE | |
CDF_NONEXPIRING |
Definition at line 2556 of file switch_core.h.
enum dtls_state_t |
Enumerator | |
---|---|
DS_OFF | |
DS_HANDSHAKE | |
DS_SETUP | |
DS_READY | |
DS_FAIL | |
DS_INVALID |
Definition at line 166 of file switch_core.h.
enum dtls_type_t |
Enumerator | |
---|---|
DTLS_TYPE_CLIENT | |
DTLS_TYPE_SERVER | |
DTLS_TYPE_RTP | |
DTLS_TYPE_RTCP |
Definition at line 159 of file switch_core.h.
Enumerator | |
---|---|
SCDB_TYPE_CORE_DB | |
SCDB_TYPE_ODBC | |
SCDB_TYPE_DATABASE_INTERFACE |
Definition at line 2562 of file switch_core.h.
switch_status_t _switch_cache_db_get_db_handle | ( | switch_cache_db_handle_t ** | dbh, |
switch_cache_db_handle_type_t | type, | ||
switch_cache_db_connection_options_t * | connection_options, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Gets a new cached handle from the pool, potentially creating a new connection. The connection is bound to the thread until it (the thread) terminates unless you dismiss rather than release.
[out] | dbh | The handle |
[in] | type | - ODBC or SQLLITE |
[in] | connection_options | (userid, password, etc) |
Definition at line 507 of file switch_core_sqldb.c.
References add_handle(), CACHE_DB_LEN, switch_database_interface_handle::connection_options, switch_cache_db_database_interface_options_t::connection_string, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_connection_options_t::core_db_options, create_handle(), switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, switch_cache_db_connection_options_t::database_interface_options, switch_runtime::db_handle_timeout, switch_cache_db_core_db_options_t::db_path, destroy_handle(), switch_cache_db_odbc_options_t::dsn, get_handle(), switch_coredb_handle::handle, switch_database_interface::handle_new, switch_coredb_handle::in_memory, switch_cache_db_core_db_options_t::in_memory, switch_cache_db_handle::last_used, switch_cache_db_database_interface_options_t::make_module_no_unloadable, switch_runtime::max_db_handles, switch_loadable_module_interface::module_name, switch_cache_db_handle::name, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, switch_cache_db_connection_options_t::odbc_options, switch_cache_db_database_interface_options_t::original_dsn, switch_database_interface::parent, switch_cache_db_odbc_options_t::pass, switch_cache_db_handle::pool, switch_cache_db_database_interface_options_t::prefix, PROTECT_INTERFACE, runtime, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, sql_manager, switch_cache_db_type_name(), SWITCH_CHANNEL_ID_LOG, SWITCH_CHANNEL_LOG, switch_core_alloc, switch_core_db_close(), switch_core_db_open_file(), switch_core_db_open_in_memory(), switch_epoch_time_now(), switch_loadable_module_protect(), SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG10, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_odbc_available(), switch_odbc_handle_connect(), switch_odbc_handle_destroy(), switch_odbc_handle_new(), SWITCH_ODBC_SUCCESS, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_self(), SWITCH_TRUE, switch_yield, switch_cache_db_handle::type, UNPROTECT_INTERFACE, and switch_cache_db_odbc_options_t::user.
Referenced by _switch_cache_db_get_db_handle_dsn_ex(), and switch_cache_db_type_name().
switch_status_t _switch_cache_db_get_db_handle_dsn | ( | switch_cache_db_handle_t ** | dbh, |
const char * | dsn, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 427 of file switch_core_sqldb.c.
References _switch_cache_db_get_db_handle_dsn_ex(), and SWITCH_FALSE.
switch_status_t _switch_cache_db_get_db_handle_dsn_ex | ( | switch_cache_db_handle_t ** | dbh, |
const char * | dsn, | ||
switch_bool_t | make_module_no_unloadable, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 433 of file switch_core_sqldb.c.
References _switch_cache_db_get_db_handle(), switch_cache_db_database_interface_options_t::connection_string, switch_cache_db_connection_options_t::core_db_options, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_connection_options_t::database_interface_options, switch_cache_db_core_db_options_t::db_path, switch_cache_db_odbc_options_t::dsn, switch_cache_db_core_db_options_t::in_memory, switch_cache_db_database_interface_options_t::make_module_no_unloadable, MIN, switch_cache_db_connection_options_t::odbc_options, switch_cache_db_database_interface_options_t::original_dsn, switch_cache_db_odbc_options_t::pass, switch_cache_db_database_interface_options_t::prefix, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, switch_loadable_module_get_database_interface(), switch_set_string, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, switch_cache_db_handle::type, UNPROTECT_INTERFACE, and switch_cache_db_odbc_options_t::user.
Referenced by _switch_cache_db_get_db_handle_dsn(), and _switch_core_db_handle().
switch_status_t _switch_core_db_handle | ( | switch_cache_db_handle_t ** | dbh, |
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Open the default system database.
Definition at line 235 of file switch_core_sqldb.c.
References _switch_cache_db_get_db_handle_dsn_ex(), switch_runtime::dbname, switch_runtime::odbc_dsn, runtime, sql_manager, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and zstr.
switch_status_t _switch_core_session_request_video_refresh | ( | switch_core_session_t * | session, |
int | force, | ||
const char * | file, | ||
const char * | func, | ||
int | line | ||
) |
Definition at line 14529 of file switch_core_media.c.
References switch_core_session_message::_file, switch_core_session_message::_func, switch_core_session_message::_line, CF_VIDEO, switch_core_session::channel, switch_core_session_message::from, switch_media_handle_s::last_video_refresh_req, switch_core_session::media_handle, switch_core_session_message::message_id, switch_core_session_message::numeric_arg, switch_assert, switch_channel_get_name(), SWITCH_CHANNEL_ID_LOG, switch_channel_media_up, switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_get_uuid(), switch_core_session_receive_message, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, switch_micro_time_now(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and VIDEO_REFRESH_FREQ.
int switch_cache_db_affected_rows | ( | switch_cache_db_handle_t * | dbh | ) |
Get the affected rows of the last performed query.
[in] | dbh | The handle |
[out] | the | number of affected rows |
Definition at line 815 of file switch_core_sqldb.c.
References switch_database_interface::affected_rows, switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, switch_coredb_handle::handle, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, switch_core_db_changes(), switch_odbc_handle_affected_rows(), and switch_cache_db_handle::type.
switch_status_t switch_cache_db_create_schema | ( | switch_cache_db_handle_t * | dbh, |
char * | sql, | ||
char ** | err | ||
) |
Executes the create schema sql.
[in] | dbh | The handle |
[in] | sql | - sql to run |
[out] | err | - Error if it exists |
Definition at line 1394 of file switch_core_sqldb.c.
References runtime, SCF_AUTO_SCHEMAS, switch_assert, switch_cache_db_execute_sql(), SWITCH_STATUS_SUCCESS, and switch_test_flag.
Referenced by switch_core_sqldb_start().
void switch_cache_db_database_interface_flush_handles | ( | switch_database_interface_t * | database_interface | ) |
Definition at line 148 of file switch_core_sqldb.c.
References switch_database_interface_handle::connection_options, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, del_handle(), destroy_handle(), switch_database_interface::handle_destroy, switch_cache_db_handle::mutex, switch_cache_db_handle::name, switch_cache_db_handle::native_handle, switch_cache_db_handle::next, SCDB_TYPE_DATABASE_INTERFACE, sql_manager, SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, switch_log_printf(), switch_mutex_lock(), switch_mutex_trylock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, and switch_cache_db_handle::type.
Referenced by switch_loadable_module_unprocess().
void switch_cache_db_dismiss_db_handle | ( | switch_cache_db_handle_t ** | dbh | ) |
Returns the handle to the pool, immediately available for other threads to use.
[in] | The | handle |
Definition at line 379 of file switch_core_sqldb.c.
References switch_cache_db_release_db_handle().
Referenced by switch_cache_db_type_name().
switch_status_t switch_cache_db_execute_sql | ( | switch_cache_db_handle_t * | dbh, |
char * | sql, | ||
char ** | err | ||
) |
Executes the sql.
[in] | dbh | The handle |
[in] | sql | - sql to run |
[out] | err | - Error if it exists |
Definition at line 799 of file switch_core_sqldb.c.
References switch_cache_db_execute_sql_chunked(), SWITCH_STATUS_FALSE, and switch_cache_db_handle::type.
Referenced by do_flush(), do_trans(), switch_cache_db_create_schema(), switch_cache_db_persistant_execute_trans_full(), switch_cache_db_test_reactive_ex(), switch_core_recovery_flush(), switch_core_recovery_recover(), switch_core_sqldb_start(), switch_sql_queue_manager_push_confirm(), and switch_user_sql_thread().
char* switch_cache_db_execute_sql2str | ( | switch_cache_db_handle_t * | dbh, |
char * | sql, | ||
char * | str, | ||
size_t | len, | ||
char ** | err | ||
) |
Executes the sql and returns the result as a string.
[in] | dbh | The handle |
[in] | sql | - sql to run |
[out] | str | - buffer for result |
[in] | len | - length of str buffer |
[out] | err | - Error if it exists |
Definition at line 864 of file switch_core_sqldb.c.
References switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, switch_database_interface::exec_string, switch_coredb_handle::handle, memset(), switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, running, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SWITCH_CHANNEL_LOG, switch_cond_next(), switch_copy_string(), SWITCH_CORE_DB_BUSY, switch_core_db_column_count(), switch_core_db_column_text(), switch_core_db_finalize(), switch_core_db_prepare(), SWITCH_CORE_DB_ROW, switch_core_db_step(), SWITCH_LOG_ERROR, switch_log_printf(), switch_odbc_handle_exec_string(), SWITCH_ODBC_SUCCESS, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_cache_db_handle::type.
switch_status_t switch_cache_db_execute_sql_callback | ( | switch_cache_db_handle_t * | dbh, |
const char * | sql, | ||
switch_core_db_callback_func_t | callback, | ||
void * | pdata, | ||
char ** | err | ||
) |
Executes the sql and uses callback for row-by-row processing.
[in] | dbh | The handle |
[in] | sql | - sql to run |
[in] | callback | - function pointer to callback |
[in] | pdata | - data to pass to callback |
[out] | err | - Error if it exists |
Definition at line 1285 of file switch_core_sqldb.c.
References switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, database_interface_handle_callback_exec, switch_coredb_handle::handle, switch_cache_db_handle::last_used, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SQL_CACHE_TIMEOUT, SWITCH_CHANNEL_LOG, SWITCH_CORE_DB_ABORT, switch_core_db_exec(), switch_core_db_free(), SWITCH_CORE_DB_OK, switch_epoch_time_now(), SWITCH_LOG_ERROR, switch_log_printf(), switch_odbc_handle_callback_exec, SWITCH_ODBC_SUCCESS, switch_snprintfv(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_cache_db_handle::type.
Referenced by sql_in_thread(), switch_console_complete(), switch_console_expand_alias(), switch_console_list_uuid(), and switch_core_recovery_recover().
switch_status_t switch_cache_db_execute_sql_callback_err | ( | switch_cache_db_handle_t * | dbh, |
const char * | sql, | ||
switch_core_db_callback_func_t | callback, | ||
switch_core_db_err_callback_func_t | err_callback, | ||
void * | pdata, | ||
char ** | err | ||
) |
Executes the sql and uses callback for row-by-row processing.
[in] | dbh | The handle |
[in] | sql | - sql to run |
[in] | callback | - function pointer to callback |
[in] | err_callback | - function pointer to callback when error occurs |
[in] | pdata | - data to pass to callback |
[out] | err | - Error if it exists |
Definition at line 1333 of file switch_core_sqldb.c.
References switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, database_interface_handle_callback_exec, switch_coredb_handle::handle, switch_cache_db_handle::last_used, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, helper::pdata, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SQL_CACHE_TIMEOUT, SWITCH_CHANNEL_LOG, SWITCH_CORE_DB_ABORT, switch_core_db_exec(), switch_core_db_free(), SWITCH_CORE_DB_OK, switch_epoch_time_now(), SWITCH_LOG_ERROR, switch_log_printf(), switch_odbc_handle_callback_exec, SWITCH_ODBC_SUCCESS, switch_snprintfv(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_cache_db_handle::type.
Referenced by sql_in_thread().
switch_status_t switch_cache_db_execute_sql_event_callback | ( | switch_cache_db_handle_t * | dbh, |
const char * | sql, | ||
switch_core_db_event_callback_func_t | callback, | ||
void * | pdata, | ||
char ** | err | ||
) |
Definition at line 1165 of file switch_core_sqldb.c.
References helper::callback, switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, database_interface_handle_callback_exec, switch_coredb_handle::handle, helper_callback(), switch_cache_db_handle::last_used, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, helper::pdata, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SQL_CACHE_TIMEOUT, SWITCH_CHANNEL_LOG, SWITCH_CORE_DB_ABORT, switch_core_db_exec(), switch_core_db_free(), SWITCH_CORE_DB_OK, switch_epoch_time_now(), SWITCH_LOG_ERROR, switch_log_printf(), switch_odbc_handle_callback_exec, SWITCH_ODBC_SUCCESS, switch_snprintfv(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_cache_db_handle::type.
Referenced by sql_in_thread().
void switch_cache_db_flush_handles | ( | void | ) |
Definition at line 343 of file switch_core_sqldb.c.
References SQL_CACHE_TIMEOUT, sql_close(), and switch_epoch_time_now().
Referenced by switch_core_session_ctl(), and switch_core_sqldb_stop().
switch_cache_db_handle_type_t switch_cache_db_get_type | ( | switch_cache_db_handle_t * | dbh | ) |
Definition at line 338 of file switch_core_sqldb.c.
References switch_cache_db_handle::type.
Referenced by switch_cache_db_type_name(), switch_console_complete(), switch_console_expand_alias(), and switch_console_set_alias().
int switch_cache_db_load_extension | ( | switch_cache_db_handle_t * | dbh, |
const char * | extension | ||
) |
load an external extension to db
[in] | dbh | The handle |
[out] | the | path to the extension |
Definition at line 840 of file switch_core_sqldb.c.
References switch_cache_db_native_handle_t::core_db_dbh, switch_coredb_handle::handle, switch_cache_db_handle::native_handle, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SWITCH_CHANNEL_LOG, switch_core_db_load_extension(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), and switch_cache_db_handle::type.
switch_status_t switch_cache_db_persistant_execute | ( | switch_cache_db_handle_t * | dbh, |
const char * | sql, | ||
uint32_t | retries | ||
) |
Definition at line 924 of file switch_core_sqldb.c.
References switch_cache_db_execute_sql_real(), SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, switch_log_printf(), switch_safe_free, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_yield.
Referenced by switch_console_set_alias().
switch_status_t switch_cache_db_persistant_execute_trans_full | ( | switch_cache_db_handle_t * | dbh, |
char * | sql, | ||
uint32_t | retries, | ||
const char * | pre_trans_execute, | ||
const char * | post_trans_execute, | ||
const char * | inner_pre_trans_execute, | ||
const char * | inner_post_trans_execute | ||
) |
Definition at line 958 of file switch_core_sqldb.c.
References switch_database_interface::commit, switch_database_interface_handle::connection_options, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, switch_database_interface::sql_set_auto_commit_attr, switch_cache_db_execute_sql(), switch_cache_db_execute_sql_real(), SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_odbc_SQLEndTran(), switch_odbc_SQLSetAutoCommitAttr(), SWITCH_ODBC_SUCCESS, switch_safe_free, switch_snprintfv(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, switch_cache_db_handle::type, and zstr.
void switch_cache_db_release_db_handle | ( | switch_cache_db_handle_t ** | dbh | ) |
Returns the handle to the pool, handle is NOT available to other threads until the allocating thread actually terminates.
[in] | The | handle |
Definition at line 349 of file switch_core_sqldb.c.
References switch_database_interface::flush, SCDB_TYPE_DATABASE_INTERFACE, sql_manager, switch_epoch_time_now(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by sql_in_thread(), switch_cache_db_dismiss_db_handle(), switch_cache_db_type_name(), switch_console_complete(), switch_console_expand_alias(), switch_console_list_uuid(), switch_console_set_alias(), switch_core_recovery_flush(), switch_core_recovery_recover(), switch_core_sqldb_start(), switch_sql_queue_manager_push_confirm(), and switch_user_sql_thread().
void switch_cache_db_status | ( | switch_stream_handle_t * | stream | ) |
Provides some feedback as to the status of the db connection pool.
[in] | stream | stream for status |
Definition at line 3935 of file switch_core_sqldb.c.
References CACHE_DB_LEN, CDF_NONEXPIRING, count, switch_cache_db_handle::creator, dbh, switch_cache_db_handle::last_used, switch_cache_db_handle::last_user, memset(), switch_cache_db_handle::mutex, switch_cache_db_handle::name, switch_cache_db_handle::next, sql_manager, switch_cache_db_type_name(), switch_epoch_time_now(), SWITCH_FALSE, switch_mutex_lock(), switch_mutex_trylock(), switch_mutex_unlock(), SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, switch_cache_db_handle::total_used_count, switch_cache_db_handle::type, switch_cache_db_handle::use_count, and switch_stream_handle::write_function.
switch_bool_t switch_cache_db_test_reactive | ( | switch_cache_db_handle_t * | dbh, |
const char * | test_sql, | ||
const char * | drop_sql, | ||
const char * | reactive_sql | ||
) |
Performs test_sql and if it fails performs drop_sql and reactive_sql.
If auto-clear-sql is disabled, then this function will do nothing and it is assumed that the queries are not needed. If auto-create-schemas is disabled, then just test_sql is executed, but drop_sql and reactive_sql are not.
Otherwise, test_sql gets executed. If that succeeds, then there is nothing to do. Otherwise drop_sql is executed (its result is ignored) and then finally reactive_sql is executed.
Definition at line 1422 of file switch_core_sqldb.c.
References switch_cache_db_test_reactive_ex().
Referenced by switch_core_sqldb_start().
switch_bool_t switch_cache_db_test_reactive_ex | ( | switch_cache_db_handle_t * | db, |
const char * | test_sql, | ||
const char * | drop_sql, | ||
const char * | reactive_sql, | ||
const char * | row_size_limited_reactive_sql | ||
) |
Definition at line 1428 of file switch_core_sqldb.c.
References switch_database_interface_handle::connection_options, switch_cache_db_native_handle_t::core_db_dbh, switch_cache_db_database_interface_options_t::database_interface, switch_cache_db_native_handle_t::database_interface_dbh, database_interface_handle_exec, switch_coredb_handle::handle, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, runtime, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, SCF_AUTO_SCHEMAS, SCF_CLEAR_SQL, switch_assert, switch_cache_db_execute_sql(), SWITCH_CHANNEL_LOG, switch_core_db_exec(), switch_core_db_free(), SWITCH_DATABASE_FLAG_ROW_SIZE_LIMIT, SWITCH_FALSE, SWITCH_LOG_DEBUG, switch_log_printf(), switch_odbc_handle_exec(), SWITCH_ODBC_SUCCESS, switch_snprintfv(), SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, and switch_cache_db_handle::type.
Referenced by switch_cache_db_test_reactive(), and switch_core_sqldb_start().
|
inlinestatic |
Definition at line 2602 of file switch_core.h.
References _switch_cache_db_get_db_handle(), dbh, SCDB_TYPE_CORE_DB, SCDB_TYPE_DATABASE_INTERFACE, SCDB_TYPE_ODBC, switch_cache_db_dismiss_db_handle(), switch_cache_db_get_type(), switch_cache_db_release_db_handle(), SWITCH_DECLARE, and switch_cache_db_handle::type.
Referenced by _switch_cache_db_get_db_handle(), and switch_cache_db_status().
void switch_close_extra_files | ( | int * | keep, |
int | keep_ttl | ||
) |
Definition at line 3244 of file switch_core.c.
References system_thread_handle::cmd, SWITCH_DECLARE, switch_fork(), switch_max_file_desc(), switch_system_fork(), and switch_system_thread().
Referenced by preprocess_exec(), and switch_system_fork().
switch_status_t switch_core_add_registration | ( | const char * | user, |
const char * | realm, | ||
const char * | token, | ||
const char * | url, | ||
uint32_t | expires, | ||
const char * | network_ip, | ||
const char * | network_port, | ||
const char * | network_proto, | ||
const char * | metadata | ||
) |
Add user registration.
[in] | user | |
[in] | realm | |
[in] | token | |
[in] | url | - a freeswitch dial string |
[in] | expires | |
[in] | network_ip | |
[in] | network_port | |
[in] | network_proto | - one of tls, tcp, udp |
[in] | metadata | - generic metadata supplied by module |
[out] | err | - Error if it exists |
Definition at line 3465 of file switch_core_sqldb.c.
References switch_runtime::multiple_registrations, runtime, SCF_USE_SQL, db_job::sql, sql_manager, switch_core_get_switchname(), SWITCH_FALSE, switch_mprintf(), switch_sql_queue_manager_push(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_test_flag, and zstr.
void switch_core_autobind_cpu | ( | void | ) |
Definition at line 7098 of file switch_core_media.c.
References core_video_globals_s::cpu_count, next_cpu(), and switch_core_thread_set_cpu_affinity().
Referenced by video_helper_thread().
const char* switch_core_banner | ( | void | ) |
int switch_core_cert_expand_fingerprint | ( | dtls_fingerprint_t * | fp, |
const char * | str | ||
) |
Definition at line 162 of file switch_core_cert.c.
References dtls_fp_s::data, and MAX_FPLEN.
Referenced by switch_rtp_add_dtls().
int switch_core_cert_gen_fingerprint | ( | const char * | prefix, |
dtls_fingerprint_t * | fp | ||
) |
Definition at line 199 of file switch_core_cert.c.
References switch_directories::certs_dir, mkcert(), SWITCH_CHANNEL_LOG, switch_core_cert_extract_fingerprint(), switch_file_exists(), SWITCH_GLOBAL_dirs, SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), SWITCH_PATH_SEPARATOR, and SWITCH_STATUS_SUCCESS.
Referenced by generate_local_fingerprint().
int switch_core_cert_verify | ( | dtls_fingerprint_t * | fp | ) |
Definition at line 143 of file switch_core_cert.c.
References dtls_fp_s::data, MAX_FPLEN, and dtls_fp_s::str.
Referenced by do_dtls(), and dtls_state_setup().
switch_status_t switch_core_check_core_db_dsn | ( | void | ) |
Returns error if no suitable database interface found to serve core db dsn.
Definition at line 422 of file switch_core_sqldb.c.
References switch_runtime::odbc_dsn, runtime, and switch_database_available().
Referenced by switch_core_sqldb_init().
switch_bool_t switch_core_check_dtls_pem | ( | const char * | file | ) |
Definition at line 338 of file switch_core_cert.c.
References switch_directories::certs_dir, SWITCH_CHANNEL_LOG, SWITCH_FALSE, switch_file_exists(), SWITCH_GLOBAL_dirs, switch_is_file_path(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mprintf(), SWITCH_PATH_SEPARATOR, switch_safe_free, SWITCH_STATUS_SUCCESS, and SWITCH_TRUE.
Referenced by switch_core_media_init().
switch_cache_db_handle_type_t switch_core_dbtype | ( | void | ) |
Definition at line 3350 of file switch_core_sqldb.c.
References SCDB_TYPE_CORE_DB, sql_manager, switch_mutex_lock(), switch_mutex_unlock(), and switch_cache_db_handle::type.
Referenced by switch_console_set_complete().
uint32_t switch_core_debug_level | ( | void | ) |
switch_status_t switch_core_del_registration | ( | const char * | user, |
const char * | realm, | ||
const char * | token | ||
) |
Delete user registration.
[in] | user | |
[in] | realm | |
[in] | token | |
[out] | err | - Error if it exists |
Definition at line 3520 of file switch_core_sqldb.c.
References switch_runtime::multiple_registrations, runtime, SCF_USE_SQL, db_job::sql, sql_manager, switch_core_get_switchname(), SWITCH_FALSE, switch_mprintf(), switch_sql_queue_manager_push(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, and zstr.
switch_status_t switch_core_expire_registration | ( | int | force | ) |
Expire user registrations.
[in] | force | delete all registrations |
[out] | err | - Error if it exists |
Definition at line 3541 of file switch_core_sqldb.c.
References runtime, SCF_USE_SQL, db_job::sql, sql_manager, switch_core_get_switchname(), switch_epoch_time_now(), SWITCH_FALSE, switch_mprintf(), switch_sql_queue_manager_push(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_test_flag.
Referenced by switch_core_sql_db_thread().
int switch_core_gen_certs | ( | const char * | prefix | ) |
Definition at line 250 of file switch_core_cert.c.
References switch_directories::certs_dir, mkcert(), SWITCH_CHANNEL_LOG, switch_file_exists(), SWITCH_GLOBAL_dirs, switch_is_file_path(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), SWITCH_PATH_SEPARATOR, switch_safe_free, SWITCH_STATUS_SUCCESS, and switch_stristr().
Referenced by load_config(), and switch_core_media_init().
void switch_core_gen_encoded_silence | ( | unsigned char * | data, |
const switch_codec_implementation_t * | read_impl, | ||
switch_size_t | len | ||
) |
Definition at line 39 of file switch_core_io.c.
References switch_codec_implementation::ianacode, switch_codec_implementation::iananame, memset(), and switch_stristr().
Referenced by record_callback(), and switch_core_session_read_frame().
const char* switch_core_get_event_channel_key_separator | ( | void | ) |
Definition at line 3592 of file switch_core.c.
References switch_runtime::event_channel_key_separator.
Referenced by ecd_deliver().
uint16_t switch_core_get_rtp_port_range_end_port | ( | void | ) |
Get RTP port range end value.
[in] | void | |
[out] | RTP | port range end value |
Definition at line 3581 of file switch_core.c.
References switch_rtp_set_end_port().
uint16_t switch_core_get_rtp_port_range_start_port | ( | void | ) |
Get RTP port range start value.
[in] | void | |
[out] | RTP | port range start value |
Definition at line 3570 of file switch_core.c.
References switch_rtp_set_start_port().
switch_status_t switch_core_get_stacksizes | ( | switch_size_t * | cur, |
switch_size_t * | max | ||
) |
Definition at line 3512 of file switch_core.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
uint32_t switch_core_max_audio_channels | ( | uint32_t | limit | ) |
Definition at line 2642 of file switch_core.c.
References switch_runtime::max_audio_channels.
Referenced by switch_core_media_negotiate_sdp(), switch_core_perform_file_open(), and switch_load_core_config().
void switch_core_recovery_flush | ( | const char * | technology, |
const char * | profile_name | ||
) |
Definition at line 3133 of file switch_core_sqldb.c.
References dbh, db_job::sql, switch_cache_db_execute_sql(), switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, switch_core_db_handle, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mprintf(), switch_safe_free, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by switch_core_session_ctl().
int switch_core_recovery_recover | ( | const char * | technology, |
const char * | profile_name | ||
) |
Definition at line 3270 of file switch_core_sqldb.c.
References dbh, recover_callback(), db_job::sql, sql_manager, switch_cache_db_execute_sql(), switch_cache_db_execute_sql_callback(), switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, switch_core_db_handle, switch_core_get_uuid(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mprintf(), switch_safe_free, SWITCH_STATUS_SUCCESS, and zstr.
Referenced by switch_core_session_ctl().
void switch_core_recovery_track | ( | switch_core_session_t * | session | ) |
Definition at line 3415 of file switch_core_sqldb.c.
References CF_ANSWERED, CF_RECOVERING, CF_TRACKABLE, CF_TRACKED, CS_SOFT_EXECUTE, switch_core_session::endpoint_interface, switch_endpoint_interface::interface_name, db_job::sql, sql_manager, switch_channel_get_state(), switch_channel_get_variable_dup(), switch_channel_set_flag, switch_channel_test_flag(), switch_core_get_switchname(), switch_core_get_uuid(), switch_core_session_get_channel(), switch_core_session_get_uuid(), SWITCH_FALSE, switch_ivr_generate_xml_cdr(), switch_mprintf(), switch_safe_free, switch_sql_queue_manager_push(), SWITCH_STATUS_SUCCESS, switch_str_nil, switch_xml_free(), and switch_xml_toxml_nolock.
Referenced by switch_channel_clear_flag(), switch_channel_perform_mark_answered(), switch_core_media_activate_rtp(), and switch_core_session_perform_receive_message().
void switch_core_recovery_untrack | ( | switch_core_session_t * | session, |
switch_bool_t | force | ||
) |
Definition at line 3377 of file switch_core_sqldb.c.
References CF_ANSWERED, CF_RECOVERING, CF_TRACKABLE, CF_TRACKED, CS_SOFT_EXECUTE, db_job::sql, sql_manager, switch_channel_clear_flag(), switch_channel_get_state(), switch_channel_test_flag(), switch_core_get_uuid(), switch_core_session_get_channel(), switch_core_session_get_uuid(), SWITCH_FALSE, switch_mprintf(), and switch_sql_queue_manager_push().
Referenced by switch_core_standard_on_hangup().
void switch_core_session_debug_pool | ( | switch_stream_handle_t * | stream | ) |
Definition at line 3122 of file switch_core_session.c.
References switch_session_manager::busy, switch_session_manager::running, session_manager, and switch_stream_handle::write_function.
switch_bool_t switch_core_session_in_thread | ( | switch_core_session_t * | session | ) |
Definition at line 1712 of file switch_core_session.c.
References SWITCH_FALSE, switch_thread_equal(), switch_thread_self(), SWITCH_TRUE, and switch_core_session::thread_id.
Referenced by switch_channel_perform_answer(), switch_channel_set_direction(), switch_channel_state_change_pending(), switch_ivr_3p_nomedia(), switch_ivr_nomedia(), and switch_ivr_parse_signal_data().
switch_status_t switch_core_session_override_io_routines | ( | switch_core_session_t * | session, |
switch_io_routines_t * | ior | ||
) |
Definition at line 3142 of file switch_core_session.c.
References CC_IO_OVERRIDE, switch_core_session::channel, switch_core_session::endpoint_interface, switch_core_session::io_override, switch_channel_test_cap(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_core_session_send_and_request_video_refresh | ( | switch_core_session_t * | session | ) |
Definition at line 14568 of file switch_core_media.c.
References CF_VIDEO, switch_core_session::channel, switch_channel_test_flag(), switch_core_media_gen_key_frame, switch_core_session_request_video_refresh, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_video_reinit().
switch_status_t switch_core_session_start_text_thread | ( | switch_core_session_t * | session | ) |
Definition at line 7396 of file switch_core_media.c.
References CF_HAS_TEXT, switch_core_session::channel, media_helper::cond, media_helper::cond_mutex, switch_media_handle_s::control_mutex, switch_rtp_engine_s::cur_payload_map, switch_media_handle_s::engines, switch_core_session::media_handle, switch_rtp_engine_s::media_thread, switch_rtp_engine_s::mh, core_video_globals_s::pool, payload_map_s::pt, media_helper::ready, switch_rtp_engine_s::rtp_session, media_helper::session, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_cond_next(), switch_core_session_get_name, switch_core_session_get_pool(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_MEDIA_TYPE_TEXT, switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), switch_rtp_set_default_payload(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTIMPL, SWITCH_STATUS_SUCCESS, switch_thread_cond_create(), switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), and text_helper_thread().
Referenced by switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_start_engine_function(), and switch_core_session_set_text_read_callback().
int32_t switch_core_sessions_peak | ( | void | ) |
int32_t switch_core_sessions_peak_fivemin | ( | void | ) |
void switch_core_set_signal_handlers | ( | void | ) |
Definition at line 2579 of file switch_core.c.
References handle_SIGHUP().
Referenced by switch_core_init_and_modload(), switch_loadable_module_load_file(), and switch_system_fork().
int32_t switch_core_sps | ( | void | ) |
int32_t switch_core_sps_last | ( | void | ) |
int32_t switch_core_sps_peak | ( | void | ) |
int32_t switch_core_sps_peak_fivemin | ( | void | ) |
void switch_core_sql_exec | ( | const char * | sql | ) |
Definition at line 3363 of file switch_core_sqldb.c.
References runtime, SCF_USE_SQL, sql_manager, switch_sql_queue_manager_push(), switch_test_flag, and SWITCH_TRUE.
Referenced by switch_console_set_complete().
switch_status_t switch_core_thread_set_cpu_affinity | ( | int | cpu | ) |
Definition at line 1763 of file switch_core.c.
References SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_autobind_cpu(), and SWITCH_MODULE_RUNTIME_FUNCTION().
switch_status_t switch_database_available | ( | char * | dsn | ) |
Returns error if no suitable database interface found for a dsn.
Definition at line 388 of file switch_core_sqldb.c.
References MIN, switch_loadable_module_get_database_interface(), switch_odbc_available(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and UNPROTECT_INTERFACE.
Referenced by switch_core_check_core_db_dsn().
uint32_t switch_default_ptime | ( | const char * | name, |
uint32_t | number | ||
) |
Definition at line 2022 of file switch_core.c.
References switch_runtime::ptimes, and switch_core_hash_find().
Referenced by add_audio_codec(), switch_core_media_negotiate_sdp(), switch_loadable_module_get_codecs(), and switch_loadable_module_get_codecs_sorted().
uint32_t switch_default_rate | ( | const char * | name, |
uint32_t | number | ||
) |
Definition at line 2033 of file switch_core.c.
Referenced by switch_loadable_module_get_codecs_sorted().
pid_t switch_fork | ( | void | ) |
Definition at line 3282 of file switch_core.c.
References set_low_priority().
Referenced by daemonize(), preprocess_exec(), switch_close_extra_files(), and switch_system_fork().
int switch_max_file_desc | ( | void | ) |
Definition at line 3228 of file switch_core.c.
Referenced by switch_close_extra_files().
|
inlinestatic |
Definition at line 233 of file switch_core.h.
References switch_assert.
Referenced by preprocess(), switch_jwt_sign(), switch_jwt_verify(), switch_xml_add_child(), switch_xml_char_content(), switch_xml_decode(), switch_xml_internal_dtd(), switch_xml_locate_language(), switch_xml_new(), switch_xml_parse_fd(), switch_xml_parse_file_simple(), switch_xml_parse_fp(), switch_xml_parse_str(), switch_xml_proc_inst(), switch_xml_set_attr(), switch_xml_str2utf8(), switch_xml_tohtml_ex(), switch_xml_toxml_ex(), and switch_xml_toxml_nolock_ex().
|
inlinestatic |
Definition at line 240 of file switch_core.h.
References switch_assert, switch_core_screen_size(), switch_core_session_disable_heartbeat(), switch_core_session_enable_heartbeat(), switch_core_session_sched_heartbeat(), switch_core_session_unsched_heartbeat(), and SWITCH_DECLARE.
Referenced by preprocess(), switch_xml_ampencode(), switch_xml_char_content(), switch_xml_decode(), switch_xml_internal_dtd(), switch_xml_locate_language(), switch_xml_parse_fp(), switch_xml_parse_str(), switch_xml_proc_inst(), switch_xml_set_attr(), switch_xml_str2utf8(), switch_xml_toxml_buf_ex(), and switch_xml_toxml_r().
void switch_os_yield | ( | void | ) |
Definition at line 142 of file switch_time.c.
Referenced by switch_cond_next(), switch_core_session_read_frame(), switch_event_channel_deliver_thread(), switch_event_dispatch_thread(), SWITCH_MODULE_RUNTIME_FUNCTION(), and timer_next().
void switch_say_file | ( | switch_say_file_handle_t * | sh, |
const char * | fmt, | ||
... | |||
) |
Definition at line 3196 of file switch_loadable_module.c.
References buf, switch_say_file_handle::cnt, switch_say_file_handle::ext, switch_say_file_handle::stream, switch_vsnprintf(), and switch_stream_handle::write_function.
switch_status_t switch_say_file_handle_create | ( | switch_say_file_handle_t ** | sh, |
const char * | ext, | ||
switch_event_t ** | var_event | ||
) |
Definition at line 3173 of file switch_loadable_module.c.
References memset(), switch_assert, SWITCH_STANDARD_STREAM, SWITCH_STATUS_SUCCESS, and zstr.
void switch_say_file_handle_destroy | ( | switch_say_file_handle_t ** | sh | ) |
Definition at line 3159 of file switch_loadable_module.c.
References switch_assert, switch_event_destroy(), and switch_safe_free.
char* switch_say_file_handle_detach_path | ( | switch_say_file_handle_t * | sh | ) |
Definition at line 3148 of file switch_loadable_module.c.
References switch_stream_handle::data, path, switch_say_file_handle::stream, and switch_assert.
char* switch_say_file_handle_get_path | ( | switch_say_file_handle_t * | sh | ) |
Definition at line 3143 of file switch_loadable_module.c.
References switch_stream_handle::data, and switch_say_file_handle::stream.
char* switch_say_file_handle_get_variable | ( | switch_say_file_handle_t * | sh, |
const char * | var | ||
) |
Definition at line 3131 of file switch_loadable_module.c.
References switch_say_file_handle::param_event, and switch_event_get_header.
int switch_spawn | ( | const char * | cmd, |
switch_bool_t | wait | ||
) |
Definition at line 3507 of file switch_core.c.
References SWITCH_FALSE, and switch_stream_spawn().
switch_status_t switch_sql_queue_manager_destroy | ( | switch_sql_queue_manager_t ** | qmp | ) |
Definition at line 1858 of file switch_core_sqldb.c.
References do_flush(), switch_sql_queue_manager::name, switch_sql_queue_manager::numq, switch_cache_db_handle::pool, switch_sql_queue_manager::pool, qm, switch_assert, SWITCH_CHANNEL_LOG, switch_core_destroy_memory_pool, SWITCH_LOG_DEBUG, SWITCH_LOG_INFO, switch_log_printf(), switch_sql_queue_manager_stop(), SWITCH_STATUS_NOOP, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_sqldb_stop_thread().
void switch_sql_queue_manager_execute_sql_callback | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
switch_core_db_callback_func_t | callback, | ||
void * | pdata | ||
) |
Definition at line 1700 of file switch_core_sqldb.c.
References new_job(), and switch_thread_pool_launch_thread().
void switch_sql_queue_manager_execute_sql_callback_err | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
switch_core_db_callback_func_t | callback, | ||
switch_core_db_err_callback_func_t | err_callback, | ||
void * | pdata | ||
) |
Definition at line 1710 of file switch_core_sqldb.c.
References new_job(), and switch_thread_pool_launch_thread().
void switch_sql_queue_manager_execute_sql_event_callback | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
switch_core_db_event_callback_func_t | callback, | ||
void * | pdata | ||
) |
Definition at line 1721 of file switch_core_sqldb.c.
References new_job(), and switch_thread_pool_launch_thread().
void switch_sql_queue_manager_execute_sql_event_callback_err | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
switch_core_db_event_callback_func_t | callback, | ||
switch_core_db_err_callback_func_t | err_callback, | ||
void * | pdata | ||
) |
Definition at line 1731 of file switch_core_sqldb.c.
References new_job(), and switch_thread_pool_launch_thread().
switch_status_t switch_sql_queue_manager_init_name | ( | const char * | name, |
switch_sql_queue_manager_t ** | qmp, | ||
uint32_t | numq, | ||
const char * | dsn, | ||
uint32_t | max_trans, | ||
const char * | pre_trans_execute, | ||
const char * | post_trans_execute, | ||
const char * | inner_pre_trans_execute, | ||
const char * | inner_post_trans_execute | ||
) |
Definition at line 2006 of file switch_core_sqldb.c.
References switch_sql_queue_manager::cond, switch_sql_queue_manager::cond2_mutex, switch_sql_queue_manager::cond_mutex, switch_sql_queue_manager::dsn, switch_sql_queue_manager::inner_post_trans_execute, switch_sql_queue_manager::inner_pre_trans_execute, switch_sql_queue_manager::max_trans, switch_sql_queue_manager::mutex, switch_sql_queue_manager::name, switch_sql_queue_manager::numq, switch_cache_db_handle::pool, switch_sql_queue_manager::pool, switch_sql_queue_manager::post_trans_execute, switch_sql_queue_manager::pre_trans_execute, switch_sql_queue_manager::pre_written, qm, switch_sql_queue_manager::sql_queue, switch_core_alloc, switch_core_new_memory_pool, switch_core_strdup, switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_queue_create(), SWITCH_SQL_QUEUE_LEN, SWITCH_STATUS_SUCCESS, switch_thread_cond_create(), and switch_sql_queue_manager::written.
Referenced by switch_core_sqldb_start_thread().
void switch_sql_queue_manager_pause | ( | switch_sql_queue_manager_t * | qm, |
switch_bool_t | flush | ||
) |
Definition at line 1773 of file switch_core_sqldb.c.
References do_flush(), switch_sql_queue_manager::mutex, switch_sql_queue_manager::numq, switch_sql_queue_manager::paused, switch_mutex_lock(), and switch_mutex_unlock().
switch_status_t switch_sql_queue_manager_push | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
uint32_t | pos, | ||
switch_bool_t | dup | ||
) |
Definition at line 1890 of file switch_core_sqldb.c.
References switch_sql_queue_manager::mutex, switch_sql_queue_manager::numq, qm_wake(), sql_manager, switch_sql_queue_manager::sql_queue, SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypush(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, and switch_sql_queue_manager::thread_running.
Referenced by core_event_handler(), switch_core_add_registration(), switch_core_del_registration(), switch_core_expire_registration(), switch_core_recovery_track(), switch_core_recovery_untrack(), and switch_core_sql_exec().
switch_status_t switch_sql_queue_manager_push_confirm | ( | switch_sql_queue_manager_t * | qm, |
const char * | sql, | ||
uint32_t | pos, | ||
switch_bool_t | dup | ||
) |
Definition at line 1932 of file switch_core_sqldb.c.
References switch_sql_queue_manager::confirm, dbh, switch_sql_queue_manager::dsn, switch_sql_queue_manager::mutex, switch_sql_queue_manager::numq, switch_sql_queue_manager::pre_written, qm_wake(), sql_manager, switch_sql_queue_manager::sql_queue, switch_cache_db_execute_sql(), switch_cache_db_get_db_handle_dsn, switch_cache_db_release_db_handle(), SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_push(), switch_sql_queue_manager_size(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, switch_sql_queue_manager::thread_running, and switch_sql_queue_manager::written.
void switch_sql_queue_manager_resume | ( | switch_sql_queue_manager_t * | qm | ) |
Definition at line 1763 of file switch_core_sqldb.c.
References switch_sql_queue_manager::mutex, switch_sql_queue_manager::paused, qm_wake(), switch_mutex_lock(), and switch_mutex_unlock().
int switch_sql_queue_manager_size | ( | switch_sql_queue_manager_t * | qm, |
uint32_t | index | ||
) |
Definition at line 1789 of file switch_core_sqldb.c.
References switch_sql_queue_manager::mutex, switch_sql_queue_manager::sql_queue, switch_mutex_lock(), switch_mutex_unlock(), and switch_queue_size().
Referenced by switch_sql_queue_manager_push_confirm().
switch_status_t switch_sql_queue_manager_start | ( | switch_sql_queue_manager_t * | qm | ) |
Definition at line 1835 of file switch_core_sqldb.c.
References switch_sql_queue_manager::event_db, switch_sql_queue_manager::name, switch_sql_queue_manager::pool, SWITCH_CHANNEL_LOG, switch_cond_next(), SWITCH_LOG_INFO, switch_log_printf(), SWITCH_PRI_NORMAL, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_priority_set(), switch_threadattr_stacksize_set(), switch_user_sql_thread(), switch_sql_queue_manager::thread, switch_sql_queue_manager::thread_initiated, and switch_sql_queue_manager::thread_running.
Referenced by switch_core_sqldb_start_thread().
switch_status_t switch_sql_queue_manager_stop | ( | switch_sql_queue_manager_t * | qm | ) |
Definition at line 1802 of file switch_core_sqldb.c.
References switch_sql_queue_manager::name, switch_sql_queue_manager::numq, qm_wake(), switch_sql_queue_manager::sql_queue, SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, switch_log_printf(), switch_queue_interrupt_all(), switch_queue_push(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_join(), switch_yield, switch_sql_queue_manager::thread, and switch_sql_queue_manager::thread_running.
Referenced by switch_sql_queue_manager_destroy().
int switch_stream_spawn | ( | const char * | cmd, |
switch_bool_t | shell, | ||
switch_bool_t | wait, | ||
switch_stream_handle_t * | stream | ||
) |
Definition at line 3372 of file switch_core.c.
References buffer, memset(), switch_stream_handle::raw_write_function, SWITCH_CHANNEL_LOG, switch_core_get_variable(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_safe_free, switch_separate_string(), and zstr.
Referenced by switch_spawn(), switch_stream_system(), and switch_system().
int switch_stream_system_fork | ( | const char * | cmd, |
switch_stream_handle_t * | stream | ||
) |
Definition at line 3363 of file switch_core.c.
References switch_stream_system().
const char* switch_version_full | ( | void | ) |
Definition at line 53 of file switch_version.c.
References switch_version_full_str.
Referenced by main(), send_heartbeat(), and switch_core_init_and_modload().
const char* switch_version_full_human | ( | void | ) |
Definition at line 54 of file switch_version.c.
References switch_version_full_human_str.
const char* switch_version_major | ( | void | ) |
const char* switch_version_micro | ( | void | ) |
const char* switch_version_minor | ( | void | ) |
const char* switch_version_revision | ( | void | ) |
const char* switch_version_revision_human | ( | void | ) |
Definition at line 52 of file switch_version.c.
References switch_version_revision_human_str.
Referenced by ice_out(), main(), and switch_core_init_and_modload().