FreeSWITCH API Documentation
1.7.0
|
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_pgsql_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) } |
enum | switch_cache_db_handle_type_t { SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL } |
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 2440 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 146 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 147 of file switch_core.h.
Referenced by switch_core_cert_expand_fingerprint(), and switch_core_cert_verify().
#define MAX_FPSTRLEN 192 |
Definition at line 148 of file switch_core.h.
#define MESSAGE_STAMP_FFL | ( | _m | ) | _m->_file = __FILE__; _m->_func = __SWITCH_FUNC__; _m->_line = __LINE__ |
Definition at line 173 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 175 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 2532 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 2536 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 2616 of file switch_core.h.
#define switch_core_db_handle | ( | _a | ) | _switch_core_db_handle(_a, __FILE__, __SWITCH_FUNC__, __LINE__) |
Definition at line 2606 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_MAX_CORE_THREAD_SESSION_OBJS 128 |
Definition at line 46 of file switch_core.h.
#define SWITCH_MAX_STREAMS 128 |
Definition at line 47 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 2706 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 2479 of file switch_core.h.
typedef int(* switch_core_db_event_callback_func_t)(void *pArg, switch_event_t *event) |
Definition at line 2438 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 143 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 |
Definition at line 2441 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 164 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 157 of file switch_core.h.
Enumerator | |
---|---|
SCDB_TYPE_CORE_DB | |
SCDB_TYPE_ODBC | |
SCDB_TYPE_PGSQL |
Definition at line 2446 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 384 of file switch_core_sqldb.c.
References add_handle(), CACHE_DB_LEN, switch_cache_db_native_handle_t::core_db_dbh, create_handle(), switch_runtime::db_handle_timeout, get_handle(), switch_cache_db_handle::last_used, switch_runtime::max_db_handles, switch_cache_db_handle::name, switch_cache_db_handle::native_handle, switch_cache_db_native_handle_t::odbc_dbh, switch_cache_db_native_handle_t::pgsql_dbh, runtime, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, sql_manager, switch_cache_db_type_name(), SWITCH_CHANNEL_ID_LOG, SWITCH_CHANNEL_LOG, switch_core_db_open_file(), switch_epoch_time_now(), 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_pgsql_available(), switch_pgsql_handle_connect(), switch_pgsql_handle_destroy(), switch_pgsql_handle_new(), SWITCH_PGSQL_SUCCESS, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_self(), switch_yield, and switch_cache_db_handle::type.
Referenced by _switch_cache_db_get_db_handle_dsn().
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 335 of file switch_core_sqldb.c.
References _switch_cache_db_get_db_handle(), switch_cache_db_connection_options_t::core_db_options, switch_cache_db_core_db_options_t::db_path, switch_cache_db_odbc_options_t::dsn, switch_cache_db_pgsql_options_t::dsn, switch_cache_db_connection_options_t::odbc_options, switch_cache_db_odbc_options_t::pass, switch_cache_db_connection_options_t::pgsql_options, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, switch_set_string, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_cache_db_odbc_options_t::user.
Referenced by _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 184 of file switch_core_sqldb.c.
References _switch_cache_db_get_db_handle_dsn(), switch_runtime::dbname, switch_runtime::odbc_dsn, runtime, sql_manager, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and zstr.
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 688 of file switch_core_sqldb.c.
References SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, switch_core_db_changes(), switch_odbc_handle_affected_rows(), and switch_pgsql_handle_affected_rows().
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 1271 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_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 329 of file switch_core_sqldb.c.
References switch_cache_db_release_db_handle().
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 666 of file switch_core_sqldb.c.
References io_mutex, switch_cache_db_execute_sql_chunked(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_FALSE.
Referenced by do_flush(), do_trans(), switch_cache_db_create_schema(), switch_cache_db_persistant_execute_trans_full(), switch_cache_db_test_reactive(), 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 734 of file switch_core_sqldb.c.
References io_mutex, memset(), running, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_mutex_lock(), switch_mutex_unlock(), switch_odbc_handle_exec_string(), switch_pgsql_handle_exec_string, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 1161 of file switch_core_sqldb.c.
References io_mutex, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_mutex_lock(), switch_mutex_unlock(), switch_odbc_handle_callback_exec, switch_pgsql_handle_callback_exec, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 1210 of file switch_core_sqldb.c.
References io_mutex, helper::pdata, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_mutex_lock(), switch_mutex_unlock(), switch_odbc_handle_callback_exec, switch_pgsql_handle_callback_exec, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 1042 of file switch_core_sqldb.c.
References helper::callback, helper_callback(), io_mutex, helper::pdata, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_mutex_lock(), switch_mutex_unlock(), switch_odbc_handle_callback_exec, switch_pgsql_handle_callback_exec, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by sql_in_thread().
void switch_cache_db_flush_handles | ( | void | ) |
Definition at line 291 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 286 of file switch_core_sqldb.c.
Referenced by 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 710 of file switch_core_sqldb.c.
References SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, SWITCH_CHANNEL_LOG, switch_core_db_load_extension(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, and switch_log_printf().
switch_status_t switch_cache_db_persistant_execute | ( | switch_cache_db_handle_t * | dbh, |
const char * | sql, | ||
uint32_t | retries | ||
) |
Definition at line 801 of file switch_core_sqldb.c.
References io_mutex, switch_cache_db_execute_sql_real(), SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), 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 839 of file switch_core_sqldb.c.
References io_mutex, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_mutex_lock(), switch_mutex_unlock(), switch_odbc_SQLEndTran(), switch_odbc_SQLSetAutoCommitAttr(), SWITCH_ODBC_SUCCESS, switch_pgsql_finish_results, switch_pgsql_SQLEndTran(), switch_pgsql_SQLSetAutoCommitAttr(), SWITCH_PGSQL_SUCCESS, switch_safe_free, switch_snprintfv(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, 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 297 of file switch_core_sqldb.c.
References SCDB_TYPE_PGSQL, sql_manager, switch_epoch_time_now(), switch_mutex_lock(), switch_mutex_unlock(), and switch_pgsql_flush().
Referenced by sql_in_thread(), switch_cache_db_dismiss_db_handle(), 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 3716 of file switch_core_sqldb.c.
References CACHE_DB_LEN, 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_TRUE, switch_cache_db_handle::total_used_count, switch_cache_db_handle::type, and switch_cache_db_handle::use_count.
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 1299 of file switch_core_sqldb.c.
References io_mutex, runtime, SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, SCDB_TYPE_PGSQL, 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_FALSE, SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_odbc_handle_exec(), SWITCH_ODBC_SUCCESS, switch_pgsql_handle_exec, SWITCH_PGSQL_SUCCESS, SWITCH_STATUS_SUCCESS, switch_test_flag, and SWITCH_TRUE.
Referenced by switch_core_sqldb_start().
|
inlinestatic |
Definition at line 2481 of file switch_core.h.
References SCDB_TYPE_CORE_DB, SCDB_TYPE_ODBC, and SCDB_TYPE_PGSQL.
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 3096 of file switch_core.c.
References skip(), and switch_max_file_desc().
Referenced by preprocess_exec(), switch_stream_system_fork(), 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 3244 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 5330 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 152 of file switch_core_cert.c.
References MAX_FPLEN.
Referenced by switch_rtp_add_dtls().
int switch_core_cert_gen_fingerprint | ( | const char * | prefix, |
dtls_fingerprint_t * | fp | ||
) |
Definition at line 189 of file switch_core_cert.c.
References switch_directories::certs_dir, 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 133 of file switch_core_cert.c.
References MAX_FPLEN.
Referenced by dtls_state_setup().
switch_cache_db_handle_type_t switch_core_dbtype | ( | void | ) |
Definition at line 3129 of file switch_core_sqldb.c.
References SCDB_TYPE_CORE_DB, sql_manager, switch_mutex_lock(), and switch_mutex_unlock().
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 3299 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 3320 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 240 of file switch_core_cert.c.
References switch_directories::certs_dir, mkcert(), switch_file_exists(), SWITCH_GLOBAL_dirs, switch_is_file_path(), switch_mprintf(), SWITCH_PATH_SEPARATOR, switch_safe_free, SWITCH_STATUS_SUCCESS, and switch_stristr().
Referenced by 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 memset(), and switch_stristr().
Referenced by record_callback(), and switch_core_session_read_frame().
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 3295 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 3284 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 3249 of file switch_core.c.
References memset(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
void switch_core_recovery_flush | ( | const char * | technology, |
const char * | profile_name | ||
) |
Definition at line 2915 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 3049 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 3194 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_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 3156 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 2927 of file switch_core_session.c.
References switch_session_manager::busy, switch_session_manager::running, and session_manager.
switch_bool_t switch_core_session_in_thread | ( | switch_core_session_t * | session | ) |
Definition at line 1614 of file switch_core_session.c.
References SWITCH_FALSE, switch_thread_equal(), switch_thread_self(), and SWITCH_TRUE.
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_request_video_refresh | ( | switch_core_session_t * | session | ) |
Definition at line 10911 of file switch_core_media.c.
References CF_VIDEO, switch_core_session_message::from, switch_media_handle_s::last_video_refresh_req, switch_core_session_message::message_id, switch_assert, switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_receive_message, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, switch_micro_time_now(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and VIDEO_REFRESH_FREQ.
Referenced by do_flush(), dtls_state_ready(), eavesdrop_callback(), jb_frame_inc_line(), jb_next_packet_by_seq(), read_rtp_packet(), switch_channel_perform_video_sync(), switch_channel_set_flag_value(), switch_core_session_execute_application_get_flags(), 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(), switch_jb_get_packet(), switch_jb_put_packet(), switch_jb_reset(), switch_rtp_set_video_buffer_size(), and video_helper_thread().
switch_status_t switch_core_session_send_and_request_video_refresh | ( | switch_core_session_t * | session | ) |
Definition at line 10941 of file switch_core_media.c.
References CF_VIDEO, 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().
void switch_core_set_signal_handlers | ( | void | ) |
Definition at line 2494 of file switch_core.c.
References handle_SIGHUP().
Referenced by switch_core_init_and_modload(), switch_loadable_module_load_file(), and switch_system_fork().
void switch_core_sql_exec | ( | const char * | sql | ) |
Definition at line 3142 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 1723 of file switch_core.c.
References SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_autobind_cpu(), and SWITCH_MODULE_RUNTIME_FUNCTION().
uint32_t switch_default_ptime | ( | const char * | name, |
uint32_t | number | ||
) |
Definition at line 2026 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 2037 of file switch_core.c.
Referenced by switch_loadable_module_get_codecs_sorted().
pid_t switch_fork | ( | void | ) |
Definition at line 3134 of file switch_core.c.
References set_low_priority().
Referenced by daemonize(), preprocess_exec(), switch_stream_system_fork(), and switch_system_fork().
switch_call_direction_t switch_ice_direction | ( | switch_core_session_t * | session | ) |
Definition at line 3165 of file switch_core_media.c.
References CF_3PCC, CF_AVPF, CF_RECOVERING, CF_REINVITE, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), and switch_channel_test_flag().
Referenced by check_ice(), and switch_core_media_activate_rtp().
int switch_max_file_desc | ( | void | ) |
Definition at line 3080 of file switch_core.c.
Referenced by switch_close_extra_files().
|
inlinestatic |
Definition at line 231 of file switch_core.h.
References switch_assert.
Referenced by preprocess(), switch_xml_add_child(), switch_xml_char_content(), switch_xml_decode(), switch_xml_internal_dtd(), 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(), switch_xml_toxml(), switch_xml_toxml_nolock(), and switch_xml_user_cache().
|
inlinestatic |
Definition at line 238 of file switch_core.h.
References switch_assert.
Referenced by preprocess(), switch_xml_ampencode(), switch_xml_char_content(), switch_xml_decode(), switch_xml_internal_dtd(), switch_xml_parse_fp(), switch_xml_parse_str(), switch_xml_proc_inst(), switch_xml_set_attr(), switch_xml_str2utf8(), switch_xml_toxml_buf(), and switch_xml_toxml_r().
|
inlinestatic |
Definition at line 245 of file switch_core.h.
References switch_assert.
Referenced by preprocess_glob(), switch_xml_locate_user_merged(), switch_xml_parse_str_dynamic(), switch_xml_proc_inst(), and switch_xml_set_attr().
void switch_os_yield | ( | void | ) |
Definition at line 141 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 2780 of file switch_loadable_module.c.
References buf, and switch_vsnprintf().
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 2757 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 2743 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 2732 of file switch_loadable_module.c.
References switch_assert.
char* switch_say_file_handle_get_path | ( | switch_say_file_handle_t * | sh | ) |
Definition at line 2727 of file switch_loadable_module.c.
char* switch_say_file_handle_get_variable | ( | switch_say_file_handle_t * | sh, |
const char * | var | ||
) |
Definition at line 2715 of file switch_loadable_module.c.
References switch_event_get_header.
switch_status_t switch_sql_queue_manager_destroy | ( | switch_sql_queue_manager_t ** | qmp | ) |
Definition at line 1704 of file switch_core_sqldb.c.
References do_flush(), switch_sql_queue_manager::name, switch_sql_queue_manager::numq, pool, switch_sql_queue_manager::pool, qm, switch_assert, SWITCH_CHANNEL_LOG, switch_core_destroy_memory_pool, SWITCH_LOG_INFO, switch_log_printf(), switch_sql_queue_manager_stop(), 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 1553 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 1563 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 1574 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 1584 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 1847 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, 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 1626 of file switch_core_sqldb.c.
References do_flush(), 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 1731 of file switch_core_sqldb.c.
References qm_wake(), sql_manager, SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypush(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_yield.
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 1773 of file switch_core_sqldb.c.
References dbh, qm_wake(), sql_manager, 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, and switch_yield.
void switch_sql_queue_manager_resume | ( | switch_sql_queue_manager_t * | qm | ) |
Definition at line 1616 of file switch_core_sqldb.c.
References 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 1642 of file switch_core_sqldb.c.
References 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 1688 of file switch_core_sqldb.c.
References apr_threadattr_t::pool, SWITCH_CHANNEL_LOG, 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(), and switch_user_sql_thread().
Referenced by switch_core_sqldb_start_thread().
switch_status_t switch_sql_queue_manager_stop | ( | switch_sql_queue_manager_t * | qm | ) |
Definition at line 1655 of file switch_core_sqldb.c.
References qm_wake(), 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(), and switch_yield.
Referenced by switch_sql_queue_manager_destroy().
int switch_stream_system_fork | ( | const char * | cmd, |
switch_stream_handle_t * | stream | ||
) |
Definition at line 3206 of file switch_core.c.
References switch_close_extra_files(), switch_fork(), switch_system(), and SWITCH_TRUE.
Referenced by preprocess_exec_set(), and 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().