|
Asterisk - The Open Source Telephony Project GIT-master-9647a4f
|
Websocket Media Channel. More...
#include "asterisk.h"#include "asterisk/app.h"#include "asterisk/causes.h"#include "asterisk/channel.h"#include "asterisk/codec.h"#include "asterisk/http_websocket.h"#include "asterisk/format_cache.h"#include "asterisk/frame.h"#include "asterisk/json.h"#include "asterisk/lock.h"#include "asterisk/mod_format.h"#include "asterisk/module.h"#include "asterisk/pbx.h"#include "asterisk/uuid.h"#include "asterisk/timing.h"#include "asterisk/translate.h"#include "asterisk/websocket_client.h"#include "asterisk/sorcery.h"
Go to the source code of this file.
Data Structures | |
| struct | instance_proxy |
| struct | webchan_conf_global |
| struct | websocket_pvt |
Macros | |
| #define | _create_event_MEDIA_XOFF(_instance) _create_event_nodata(_instance, "MEDIA_XOFF"); |
| #define | _create_event_MEDIA_XON(_instance) _create_event_nodata(_instance, "MEDIA_XON"); |
| #define | _create_event_QUEUE_DRAINED(_instance) _create_event_nodata(_instance, "QUEUE_DRAINED"); |
| #define | ANSWER_CHANNEL "ANSWER" |
| #define | CONTINUE_MEDIA "CONTINUE_MEDIA" |
| #define | create_event(_instance, _event, ...) _create_event_ ## _event(_instance, ##__VA_ARGS__) |
| Use this macro to create events passing in any event-specific parameters. | |
| #define | FLUSH_MEDIA "FLUSH_MEDIA" |
| #define | GET_DRIVER_STATUS "GET_STATUS" |
| #define | HANGUP_CHANNEL "HANGUP" |
| #define | INCOMING_CONNECTION_ID "INCOMING" |
| #define | MARK_MEDIA "MARK_MEDIA" |
| #define | MAX_TEXT_MESSAGE_LEN MIN(128, (AST_WEBSOCKET_MAX_RX_PAYLOAD_SIZE - 1)) |
| #define | MEDIA_WEBSOCKET_CONNECTION_ID "MEDIA_WEBSOCKET_CONNECTION_ID" |
| #define | MEDIA_WEBSOCKET_OPTIMAL_FRAME_SIZE "MEDIA_WEBSOCKET_OPTIMAL_FRAME_SIZE" |
| #define | PAUSE_MEDIA "PAUSE_MEDIA" |
| #define | QUEUE_LENGTH_MAX 1000 |
| #define | QUEUE_LENGTH_XOFF_LEVEL 900 |
| #define | QUEUE_LENGTH_XON_LEVEL 800 |
| #define | REPORT_QUEUE_DRAINED "REPORT_QUEUE_DRAINED" |
| #define | send_event(_instance, _event, ...) |
| Use this macro to create and send events passing in any event-specific parameters. | |
| #define | START_MEDIA_BUFFERING "START_MEDIA_BUFFERING" |
| #define | STOP_MEDIA_BUFFERING "STOP_MEDIA_BUFFERING" |
Enumerations | |
| enum | { OPT_WS_CODEC = (1 << 0) , OPT_WS_NO_AUTO_ANSWER = (1 << 1) , OPT_WS_URI_PARAM = (1 << 2) , OPT_WS_PASSTHROUGH = (1 << 3) , OPT_WS_MSG_FORMAT = (1 << 4) } |
| enum | { OPT_ARG_WS_CODEC , OPT_ARG_WS_NO_AUTO_ANSWER , OPT_ARG_WS_URI_PARAM , OPT_ARG_WS_PASSTHROUGH , OPT_ARG_WS_MSG_FORMAT , OPT_ARG_ARRAY_SIZE } |
| enum | webchan_control_msg_format { WEBCHAN_CONTROL_MSG_FORMAT_PLAIN = 0 , WEBCHAN_CONTROL_MSG_FORMAT_JSON , WEBCHAN_CONTROL_MSG_FORMAT_INVALID } |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static char * | _create_event_DTMF_END (struct websocket_pvt *instance, const char digit) |
| static char * | _create_event_ERROR (struct websocket_pvt *instance, const char *format,...) |
| static char * | _create_event_MEDIA_BUFFERING_COMPLETED (struct websocket_pvt *instance, const char *id) |
| static char * | _create_event_MEDIA_MARK_PROCESSED (struct websocket_pvt *instance, const char *id) |
| static char * | _create_event_MEDIA_START (struct websocket_pvt *instance) |
| static char * | _create_event_nodata (struct websocket_pvt *instance, char *event) |
| static char * | _create_event_STATUS (struct websocket_pvt *instance) |
| struct ast_module * | AST_MODULE_SELF_SYM (void) |
| static enum webchan_control_msg_format | control_msg_format_from_str (const char *value) |
| static const char * | control_msg_format_to_str (enum webchan_control_msg_format value) |
| static struct ast_frame * | dequeue_frame (struct websocket_pvt *instance) |
| static void * | global_alloc (const char *name) |
| static int | global_apply (const struct ast_sorcery *sorcery, void *obj) |
| static int | global_control_message_format_from_str (const struct aco_option *opt, struct ast_variable *var, void *obj) |
| static int | global_control_message_format_to_str (const void *obj, const intptr_t *args, char **buf) |
| static int | handle_command (struct websocket_pvt *instance, char *buffer) |
| static void | incoming_ws_established_cb (struct ast_websocket *ast_ws_session, struct ast_variable *get_params, struct ast_variable *upgrade_headers) |
| static int | incoming_ws_http_callback (struct ast_tcptls_session_instance *ser, const struct ast_http_uri *urih, const char *uri, enum ast_http_method method, struct ast_variable *get_params, struct ast_variable *headers) |
| static void | instance_proxy_cb (void *weakproxy, void *data) |
| static int | load_config (void) |
| static int | load_module (void) |
| Function called when our module is loaded. | |
| static int | process_binary_message (struct websocket_pvt *instance, char *payload, uint64_t payload_len) |
| static int | process_text_message (struct websocket_pvt *instance, char *payload, uint64_t payload_len) |
| static int | queue_frame_from_buffer (struct websocket_pvt *instance, char *buffer, size_t len) |
| static int | queue_option_frame (struct websocket_pvt *instance, char *buffer) |
| static int | read_from_ws_and_queue (struct websocket_pvt *instance) |
| static void * | read_thread_handler (void *obj) |
| static int | reload_module (void) |
| static void | set_channel_format (struct websocket_pvt *instance, struct ast_format *fmt) |
| static int | set_channel_timer (struct websocket_pvt *instance) |
| static int | set_channel_variables (struct websocket_pvt *instance) |
| static int | set_instance_silence_frame (struct websocket_pvt *instance) |
| static int | set_instance_translator (struct websocket_pvt *instance) |
| static int | unload_module (void) |
| Function called when our module is unloaded. | |
| static int | validate_uri_parameters (const char *uri_params) |
| static int | webchan_call (struct ast_channel *ast, const char *dest, int timeout) |
| static int | webchan_hangup (struct ast_channel *ast) |
| static struct ast_frame * | webchan_read (struct ast_channel *ast) |
| static struct ast_channel * | webchan_request (const char *type, struct ast_format_cap *cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *data, int *cause) |
| static int | webchan_send_dtmf_text (struct ast_channel *ast, char digit, unsigned int duration) |
| static int | webchan_write (struct ast_channel *ast, struct ast_frame *f) |
| Function called when we should write a frame to the channel. | |
| static void | websocket_destructor (void *data) |
| static struct websocket_pvt * | websocket_new (const char *chan_name, const char *connection_id, struct ast_format *fmt) |
Websocket Media Channel.
Definition in file chan_websocket.c.
| #define _create_event_MEDIA_XOFF | ( | _instance | ) | _create_event_nodata(_instance, "MEDIA_XOFF"); |
Definition at line 192 of file chan_websocket.c.
| #define _create_event_MEDIA_XON | ( | _instance | ) | _create_event_nodata(_instance, "MEDIA_XON"); |
Definition at line 191 of file chan_websocket.c.
| #define _create_event_QUEUE_DRAINED | ( | _instance | ) | _create_event_nodata(_instance, "QUEUE_DRAINED"); |
Definition at line 193 of file chan_websocket.c.
| #define ANSWER_CHANNEL "ANSWER" |
Definition at line 111 of file chan_websocket.c.
| #define CONTINUE_MEDIA "CONTINUE_MEDIA" |
Definition at line 120 of file chan_websocket.c.
| #define create_event | ( | _instance, | |
| _event, | |||
| ... | |||
| ) | _create_event_ ## _event(_instance, ##__VA_ARGS__) |
Use this macro to create events passing in any event-specific parameters.
Definition at line 408 of file chan_websocket.c.
| #define FLUSH_MEDIA "FLUSH_MEDIA" |
Definition at line 116 of file chan_websocket.c.
| #define GET_DRIVER_STATUS "GET_STATUS" |
Definition at line 117 of file chan_websocket.c.
| #define HANGUP_CHANNEL "HANGUP" |
Definition at line 112 of file chan_websocket.c.
| #define INCOMING_CONNECTION_ID "INCOMING" |
Definition at line 109 of file chan_websocket.c.
| #define MARK_MEDIA "MARK_MEDIA" |
Definition at line 115 of file chan_websocket.c.
| #define MAX_TEXT_MESSAGE_LEN MIN(128, (AST_WEBSOCKET_MAX_RX_PAYLOAD_SIZE - 1)) |
Definition at line 125 of file chan_websocket.c.
| #define MEDIA_WEBSOCKET_CONNECTION_ID "MEDIA_WEBSOCKET_CONNECTION_ID" |
Definition at line 108 of file chan_websocket.c.
| #define MEDIA_WEBSOCKET_OPTIMAL_FRAME_SIZE "MEDIA_WEBSOCKET_OPTIMAL_FRAME_SIZE" |
Definition at line 107 of file chan_websocket.c.
| #define PAUSE_MEDIA "PAUSE_MEDIA" |
Definition at line 119 of file chan_websocket.c.
| #define QUEUE_LENGTH_MAX 1000 |
Definition at line 122 of file chan_websocket.c.
| #define QUEUE_LENGTH_XOFF_LEVEL 900 |
Definition at line 123 of file chan_websocket.c.
| #define QUEUE_LENGTH_XON_LEVEL 800 |
Definition at line 124 of file chan_websocket.c.
| #define REPORT_QUEUE_DRAINED "REPORT_QUEUE_DRAINED" |
Definition at line 118 of file chan_websocket.c.
| #define send_event | ( | _instance, | |
| _event, | |||
| ... | |||
| ) |
Use this macro to create and send events passing in any event-specific parameters.
Definition at line 415 of file chan_websocket.c.
| #define START_MEDIA_BUFFERING "START_MEDIA_BUFFERING" |
Definition at line 113 of file chan_websocket.c.
| #define STOP_MEDIA_BUFFERING "STOP_MEDIA_BUFFERING" |
Definition at line 114 of file chan_websocket.c.
| anonymous enum |
| Enumerator | |
|---|---|
| OPT_WS_CODEC | |
| OPT_WS_NO_AUTO_ANSWER | |
| OPT_WS_URI_PARAM | |
| OPT_WS_PASSTHROUGH | |
| OPT_WS_MSG_FORMAT | |
Definition at line 1551 of file chan_websocket.c.
| anonymous enum |
| Enumerator | |
|---|---|
| OPT_ARG_WS_CODEC | |
| OPT_ARG_WS_NO_AUTO_ANSWER | |
| OPT_ARG_WS_URI_PARAM | |
| OPT_ARG_WS_PASSTHROUGH | |
| OPT_ARG_WS_MSG_FORMAT | |
| OPT_ARG_ARRAY_SIZE | |
Definition at line 1559 of file chan_websocket.c.
| Enumerator | |
|---|---|
| WEBCHAN_CONTROL_MSG_FORMAT_PLAIN | |
| WEBCHAN_CONTROL_MSG_FORMAT_JSON | |
| WEBCHAN_CONTROL_MSG_FORMAT_INVALID | |
Definition at line 56 of file chan_websocket.c.
|
static |
Definition at line 2136 of file chan_websocket.c.
|
static |
Definition at line 2136 of file chan_websocket.c.
|
static |
Definition at line 301 of file chan_websocket.c.
References ast_asprintf, ast_channel_uniqueid(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), websocket_pvt::channel, websocket_pvt::control_msg_format, digit, NULL, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 369 of file chan_websocket.c.
References ast_asprintf, ast_channel_uniqueid(), ast_free, AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), ast_vasprintf, NULL, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 241 of file chan_websocket.c.
References ast_asprintf, ast_channel_uniqueid(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), websocket_pvt::channel, websocket_pvt::control_msg_format, NULL, S_COR, S_OR, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 271 of file chan_websocket.c.
References ast_asprintf, ast_channel_uniqueid(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), websocket_pvt::channel, websocket_pvt::control_msg_format, NULL, S_COR, S_OR, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 200 of file chan_websocket.c.
References ast_asprintf, ast_channel_name(), ast_channel_uniqueid(), ast_channel_varshead(), ast_format_get_name(), ast_json_channel_vars(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), websocket_pvt::channel, websocket_pvt::connection_id, websocket_pvt::control_msg_format, ast_codec::default_ms, websocket_pvt::native_codec, websocket_pvt::native_format, NULL, websocket_pvt::optimal_frame_size, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 172 of file chan_websocket.c.
References ast_channel_uniqueid(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), ast_strdup, websocket_pvt::channel, websocket_pvt::control_msg_format, NULL, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
|
static |
Definition at line 329 of file chan_websocket.c.
References ast_asprintf, ast_channel_uniqueid(), AST_JSON_COMPACT, ast_json_dump_string_format(), ast_json_pack(), ast_json_unref(), websocket_pvt::bulk_media_in_progress, websocket_pvt::channel, websocket_pvt::control_msg_format, websocket_pvt::frame_queue_length, NULL, websocket_pvt::queue_full, QUEUE_LENGTH_XOFF_LEVEL, QUEUE_LENGTH_XON_LEVEL, websocket_pvt::queue_paused, S_COR, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2136 of file chan_websocket.c.
|
static |
Definition at line 146 of file chan_websocket.c.
References ast_strlen_zero(), msg_format_map, value, WEBCHAN_CONTROL_MSG_FORMAT_INVALID, WEBCHAN_CONTROL_MSG_FORMAT_JSON, and WEBCHAN_CONTROL_MSG_FORMAT_PLAIN.
Referenced by global_control_message_format_from_str(), and webchan_request().
|
static |
Definition at line 159 of file chan_websocket.c.
References ARRAY_IN_BOUNDS, msg_format_map, NULL, and value.
Referenced by global_apply(), and global_control_message_format_to_str().
|
static |
Definition at line 450 of file chan_websocket.c.
References ast_channel_name(), AST_CONTROL_OPTION, ast_debug, AST_FRAME_CONTROL, ast_frame_free(), AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_websocket_write_string(), websocket_pvt::channel, ast_frame::data, websocket_pvt::frame_queue, websocket_pvt::frame_queue_length, ast_frame::frametype, ast_frame_subclass::integer, NULL, ast_frame::ptr, websocket_pvt::queue_full, QUEUE_LENGTH_XON_LEVEL, websocket_pvt::queue_paused, websocket_pvt::report_queue_drained, SCOPED_LOCK, send_event, ast_frame::subclass, and websocket_pvt::websocket.
Referenced by webchan_read().
|
static |
Definition at line 2001 of file chan_websocket.c.
References ast_sorcery_generic_alloc(), and NULL.
Referenced by load_config().
|
static |
Definition at line 2013 of file chan_websocket.c.
References ast_debug, webchan_conf_global::control_msg_format, and control_msg_format_to_str().
Referenced by load_config().
|
static |
Definition at line 1975 of file chan_websocket.c.
References ast_log, webchan_conf_global::control_msg_format, control_msg_format_from_str(), LOG_ERROR, var, and WEBCHAN_CONTROL_MSG_FORMAT_INVALID.
|
static |
Definition at line 1992 of file chan_websocket.c.
References ast_strdup, buf, webchan_conf_global::control_msg_format, and control_msg_format_to_str().
|
static |
Definition at line 726 of file chan_websocket.c.
References ANSWER_CHANNEL, ast_channel_name(), AST_CONTROL_ANSWER, AST_CONTROL_HANGUP, ast_debug, ast_free, ast_frfree, ast_json_load_buf(), ast_json_object_string_get, ast_json_unref(), AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_log, ast_queue_control(), ast_strings_equal(), websocket_pvt::bulk_media_in_progress, websocket_pvt::channel, CONTINUE_MEDIA, websocket_pvt::control_msg_format, create_event, ast_frame::data, FLUSH_MEDIA, websocket_pvt::frame_queue, websocket_pvt::frame_queue_length, GET_DRIVER_STATUS, HANGUP_CHANNEL, id, websocket_pvt::leftover_data, websocket_pvt::leftover_len, LOG_WARNING, MARK_MEDIA, NULL, websocket_pvt::passthrough, PAUSE_MEDIA, queue_frame_from_buffer(), queue_option_frame(), websocket_pvt::queue_paused, RAII_VAR, websocket_pvt::report_queue_drained, REPORT_QUEUE_DRAINED, SCOPED_LOCK, send_event, START_MEDIA_BUFFERING, STOP_MEDIA_BUFFERING, and WEBCHAN_CONTROL_MSG_FORMAT_JSON.
Referenced by process_text_message().
|
static |
Definition at line 1819 of file chan_websocket.c.
References ao2_bump, ao2_cleanup, ao2_weakproxy_find, AST_CONTROL_HANGUP, ast_debug, ast_log, ast_queue_control(), ast_variable_find_in_list(), ast_websocket_close(), ast_websocket_fd(), ast_websocket_unref(), websocket_pvt::channel, websocket_pvt::connection_id, errno, instances, LOG_WARNING, ast_variable::name, ast_variable::next, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, RAII_VAR, read_thread_handler(), ast_variable::value, and websocket_pvt::websocket.
Referenced by load_module().
|
static |
Definition at line 1887 of file chan_websocket.c.
References ao2_cleanup, ao2_weakproxy_find, ast_channel_name(), ast_debug, ast_http_error(), ast_log, ast_variable_list_append, ast_variable_new, ast_variables_destroy(), ast_websocket_uri_cb(), ast_ws_server, ast_http_uri::data, instances, LOG_WARNING, method, ast_variable::name, ast_variable::next, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, RAII_VAR, and ast_variable::value.
|
static |
Definition at line 1321 of file chan_websocket.c.
References ao2_unlink, ast_debug, instance_proxy::connection_id, and instances.
Referenced by websocket_new().
|
static |
Definition at line 2023 of file chan_websocket.c.
References ast_debug, ast_log, ast_sorcery_apply_default, ast_sorcery_load(), ast_sorcery_object_field_register_nodoc, ast_sorcery_object_register, ast_sorcery_open, ast_sorcery_register_cust, ast_sorcery_unref, global, global_alloc(), global_apply(), LOG_ERROR, NULL, OPT_NOOP_T, and sorcery.
Referenced by load_module().
|
static |
Function called when our module is loaded.
Definition at line 2079 of file chan_websocket.c.
References AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_container_alloc_hash, AO2_CONTAINER_ALLOC_OPT_DUPS_REPLACE, ast_channel_register(), ast_format_cap_alloc, ast_format_cap_append_by_type(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_http_uri_link(), ast_log, AST_MEDIA_TYPE_UNKNOWN, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_websocket_server_add_protocol2(), ast_websocket_server_create(), ast_websocket_sub_protocol_alloc(), ast_ws_server, ast_channel_tech::capabilities, http_uri, incoming_ws_established_cb(), instances, load_config(), LOG_ERROR, LOG_WARNING, ast_websocket_protocol::session_established, unload_module(), and websocket_tech.
|
static |
Definition at line 932 of file chan_websocket.c.
References ast_channel_name(), ast_debug, AST_LIST_LOCK, AST_LIST_UNLOCK, websocket_pvt::bulk_media_in_progress, websocket_pvt::bytes_read, websocket_pvt::channel, websocket_pvt::frame_queue, websocket_pvt::frame_queue_length, websocket_pvt::leftover_data, websocket_pvt::leftover_len, MIN, NULL, websocket_pvt::optimal_frame_size, websocket_pvt::passthrough, queue_frame_from_buffer(), QUEUE_LENGTH_MAX, and SCOPED_LOCK.
Referenced by read_from_ws_and_queue().
|
static |
Definition at line 899 of file chan_websocket.c.
References ast_alloca, ast_channel_name(), ast_debug, ast_log, ast_strip(), websocket_pvt::channel, handle_command(), LOG_WARNING, and MAX_TEXT_MESSAGE_LEN.
Referenced by read_from_ws_and_queue().
|
static |
Definition at line 655 of file chan_websocket.c.
References ast_channel_name(), ast_debug, AST_FRAME_SET_BUFFER, AST_FRAME_VOICE, ast_frisolate, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_log, websocket_pvt::channel, ast_frame::datalen, ast_frame_subclass::format, websocket_pvt::frame_queue, websocket_pvt::frame_queue_length, ast_frame::frametype, len(), LOG_WARNING, websocket_pvt::native_codec, websocket_pvt::native_format, NULL, websocket_pvt::queue_full, QUEUE_LENGTH_XOFF_LEVEL, ast_frame::samples, ast_codec::samples_count, SCOPED_LOCK, send_event, and ast_frame::subclass.
Referenced by handle_command(), and process_binary_message().
|
static |
Definition at line 690 of file chan_websocket.c.
References ast_channel_name(), AST_CONTROL_OPTION, ast_debug, AST_FRAME_CONTROL, AST_FRAME_SET_BUFFER, ast_frisolate, AST_LIST_INSERT_TAIL, AST_LIST_LOCK, AST_LIST_UNLOCK, ast_log, websocket_pvt::channel, websocket_pvt::frame_queue, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, and ast_frame::subclass.
Referenced by handle_command().
|
static |
Definition at line 1057 of file chan_websocket.c.
References ao2_lock, ao2_unlock, ast_channel_name(), ast_debug, ast_log, ast_wait_for_input(), ast_websocket_fd(), AST_WEBSOCKET_OPCODE_BINARY, AST_WEBSOCKET_OPCODE_CLOSE, AST_WEBSOCKET_OPCODE_TEXT, ast_websocket_read(), websocket_pvt::channel, errno, LOG_WARNING, NULL, process_binary_message(), process_text_message(), and websocket_pvt::websocket.
Referenced by read_thread_handler().
|
static |
Definition at line 1129 of file chan_websocket.c.
References ao2_cleanup, ast_channel_name(), AST_CONTROL_ANSWER, AST_CONTROL_HANGUP, ast_debug, ast_queue_control(), NULL, RAII_VAR, read_from_ws_and_queue(), and send_event.
Referenced by incoming_ws_established_cb(), and webchan_call().
|
static |
Definition at line 2070 of file chan_websocket.c.
References ast_debug, ast_sorcery_reload(), and sorcery.
|
static |
Definition at line 433 of file chan_websocket.c.
References ast_channel_rawreadformat(), ast_channel_readformat(), ast_channel_set_rawreadformat(), ast_debug, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), ast_set_read_format(), and websocket_pvt::channel.
Referenced by webchan_read().
|
static |
Definition at line 1486 of file chan_websocket.c.
References ast_channel_name(), ast_channel_set_fd(), ast_debug, ast_format_get_default_ms(), ast_timer_fd(), ast_timer_open(), ast_timer_set_rate(), websocket_pvt::channel, websocket_pvt::native_format, and websocket_pvt::timer.
Referenced by webchan_request().
|
static |
Definition at line 1507 of file chan_websocket.c.
References ast_asprintf, ast_free, websocket_pvt::channel, websocket_pvt::connection_id, MEDIA_WEBSOCKET_CONNECTION_ID, MEDIA_WEBSOCKET_OPTIMAL_FRAME_SIZE, NULL, websocket_pvt::optimal_frame_size, and pbx_builtin_setvar_helper().
Referenced by webchan_request().
|
static |
Definition at line 1463 of file chan_websocket.c.
References ast_calloc, AST_FRAME_VOICE, ast_frame::data, ast_frame::datalen, ast_codec::default_ms, ast_frame_subclass::format, ast_frame::frametype, ast_frame::mallocd, ast_codec::minimum_bytes, ast_codec::minimum_ms, ast_frame::offset, ast_frame::ptr, ast_frame::samples, websocket_pvt::silence, websocket_pvt::slin_codec, websocket_pvt::slin_format, ast_frame::src, and ast_frame::subclass.
Referenced by webchan_request().
|
static |
Definition at line 1432 of file chan_websocket.c.
References ao2_bump, ast_channel_name(), ast_debug, ast_format_cache_get_slin_by_rate(), ast_format_cache_is_slinear(), ast_format_get_codec(), ast_format_get_default_ms(), ast_format_get_name(), ast_format_get_sample_rate(), ast_log, ast_translator_build_path(), websocket_pvt::channel, LOG_ERROR, websocket_pvt::native_codec, websocket_pvt::native_format, ast_codec::sample_rate, websocket_pvt::slin_codec, websocket_pvt::slin_format, and websocket_pvt::translator.
Referenced by webchan_request().
|
static |
Function called when our module is unloaded.
Definition at line 2051 of file chan_websocket.c.
References ao2_cleanup, ast_channel_unregister(), ast_http_uri_unlink(), ast_sorcery_unref, ast_ws_server, ast_channel_tech::capabilities, http_uri, instances, NULL, sorcery, and websocket_tech.
Referenced by load_module().
|
static |
Definition at line 1524 of file chan_websocket.c.
References ast_strdupa, ast_strsep(), ast_uri_verify_encoded(), NULL, and websocket_pvt::uri_params.
Referenced by webchan_request().
|
static |
Definition at line 1197 of file chan_websocket.c.
References ao2_bump, ao2_cleanup, ast_channel_name(), ast_channel_tech_pvt(), ast_debug, ast_log, ast_pthread_create_detached_background, ast_strlen_zero(), ast_websocket_client_add_uri_params(), ast_websocket_client_connect(), ast_websocket_fd(), ast_websocket_result_to_str(), AST_WS_TYPE_SERVER, websocket_pvt::channel, websocket_pvt::client, websocket_pvt::connection_id, errno, LOG_WARNING, NULL, websocket_pvt::outbound_read_thread, read_thread_handler(), result, websocket_pvt::type, websocket_pvt::uri_params, websocket_pvt::websocket, and WS_OK.
|
static |
Definition at line 1768 of file chan_websocket.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_channel_name(), ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), ast_debug, ast_websocket_close(), ast_websocket_unref(), websocket_pvt::connection_id, NULL, and websocket_pvt::websocket.
|
static |
Definition at line 555 of file chan_websocket.c.
References ast_calloc, ast_channel_name(), ast_channel_tech_pvt(), ast_debug, ast_frame_free(), ast_frdup, ast_free, AST_FRIENDLY_OFFSET, ast_log, AST_MALLOCD_DATA, ast_timer_ack(), ast_timer_get_event(), AST_TIMING_EVENT_EXPIRED, ast_translate(), ast_frame::data, ast_frame::datalen, dequeue_frame(), LOG_WARNING, ast_frame::mallocd, websocket_pvt::native_format, NULL, ast_frame::offset, websocket_pvt::optimal_frame_size, websocket_pvt::passthrough, ast_frame::ptr, ast_frame::samples, set_channel_format(), websocket_pvt::silence, websocket_pvt::slin_format, websocket_pvt::timer, and websocket_pvt::translator.
|
static |
Definition at line 1576 of file chan_websocket.c.
References ao2_bump, ao2_cleanup, args, AST_APP_ARG, ast_app_parse_options(), AST_CAUSE_FAILURE, ast_channel_alloc, ast_channel_name(), ast_channel_nativeformats_set(), ast_channel_set_rawreadformat(), ast_channel_set_rawwriteformat(), ast_channel_set_readformat(), ast_channel_set_writeformat(), ast_channel_tech_pvt_set(), ast_channel_tech_set(), ast_channel_unlock, ast_debug, AST_DECLARE_APP_ARGS, ast_format_cache_get, ast_format_cap_alloc, ast_format_cap_append, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_format(), ast_format_get_name(), ast_log, AST_NONSTANDARD_APP_ARGS, ast_sorcery_retrieve_by_id(), AST_STATE_DOWN, ast_strdup, ast_strdupa, ast_strings_equal(), ast_strlen_zero(), ast_test_flag, control_msg_format_from_str(), INCOMING_CONNECTION_ID, LOG_ERROR, LOG_WARNING, NULL, OPT_ARG_ARRAY_SIZE, OPT_ARG_WS_CODEC, OPT_ARG_WS_MSG_FORMAT, OPT_ARG_WS_URI_PARAM, OPT_WS_CODEC, OPT_WS_MSG_FORMAT, OPT_WS_NO_AUTO_ANSWER, OPT_WS_PASSTHROUGH, OPT_WS_URI_PARAM, options, RAII_VAR, set_channel_timer(), set_channel_variables(), set_instance_silence_frame(), set_instance_translator(), sorcery, ast_assigned_ids::uniqueid, validate_uri_parameters(), WEBCHAN_CONTROL_MSG_FORMAT_INVALID, WEBCHAN_CONTROL_MSG_FORMAT_PLAIN, websocket_new(), websocket_options, and websocket_tech.
|
static |
Definition at line 1799 of file chan_websocket.c.
References ast_channel_tech_pvt(), digit, and send_event.
|
static |
Function called when we should write a frame to the channel.
Definition at line 1161 of file chan_websocket.c.
References ast_channel_name(), ast_channel_tech_pvt(), ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), AST_FRAME_CNG, AST_FRAME_VOICE, ast_log, AST_WEBSOCKET_OPCODE_BINARY, ast_websocket_write(), ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, LOG_WARNING, websocket_pvt::native_format, ast_frame::ptr, ast_frame::subclass, and websocket_pvt::websocket.
|
static |
Definition at line 1256 of file chan_websocket.c.
References ao2_cleanup, ast_channel_unref, ast_debug, ast_free, ast_frfree, AST_LIST_LOCK, AST_LIST_REMOVE_HEAD, AST_LIST_UNLOCK, ast_timer_close(), ast_translator_free_path(), ast_websocket_unref(), websocket_pvt::channel, websocket_pvt::client, websocket_pvt::connection_id, ast_frame::data, websocket_pvt::frame_queue, websocket_pvt::leftover_data, websocket_pvt::native_codec, websocket_pvt::native_format, NULL, ast_frame::ptr, websocket_pvt::silence, websocket_pvt::slin_codec, websocket_pvt::slin_format, websocket_pvt::timer, websocket_pvt::translator, websocket_pvt::uri_params, and websocket_pvt::websocket.
Referenced by websocket_new().
|
static |
Definition at line 1328 of file chan_websocket.c.
References ao2_alloc, ao2_bump, ao2_cleanup, ao2_link_flags, ao2_weakproxy_alloc, ao2_weakproxy_set_object, ao2_weakproxy_subscribe(), ast_calloc, ast_debug, ast_format_get_codec(), ast_format_get_default_ms(), ast_format_get_minimum_bytes(), ast_format_get_minimum_ms(), ast_format_get_name(), ast_format_get_sample_rate(), AST_LIST_HEAD_INIT, ast_log, ast_strings_equal(), ast_uuid_generate_str(), AST_UUID_STR_LEN, ast_websocket_client_retrieve_by_id(), AST_WS_TYPE_CLIENT, AST_WS_TYPE_SERVER, websocket_pvt::connection_id, INCOMING_CONNECTION_ID, instance_proxy_cb(), instances, LOG_ERROR, NULL, OBJ_NOLOCK, RAII_VAR, SCOPED_AO2WRLOCK, uuid(), and websocket_destructor().
Referenced by webchan_request().
|
static |
Definition at line 2136 of file chan_websocket.c.
|
static |
Definition at line 2136 of file chan_websocket.c.
|
static |
Definition at line 73 of file chan_websocket.c.
Referenced by incoming_ws_http_callback(), load_module(), and unload_module().
|
static |
Definition at line 1961 of file chan_websocket.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 75 of file chan_websocket.c.
Referenced by incoming_ws_established_cb(), incoming_ws_http_callback(), instance_proxy_cb(), load_module(), unload_module(), and websocket_new().
|
static |
Definition at line 62 of file chan_websocket.c.
Referenced by control_msg_format_from_str(), and control_msg_format_to_str().
|
static |
Definition at line 54 of file chan_websocket.c.
Referenced by __ast_sorcery_apply_config(), __ast_sorcery_apply_default(), __ast_sorcery_apply_wizard_mapping(), __ast_sorcery_insert_wizard_mapping(), __ast_sorcery_object_field_register(), __ast_sorcery_object_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_object_type_remove_wizard(), __ast_sorcery_open(), __ast_sorcery_remove_wizard_mapping(), alloc_and_initialize_sorcery(), alloc_and_initialize_sorcery(), alloc_and_initialize_sorcery(), apply_list_configuration(), as_config_load(), as_config_reload(), ast_ari_asterisk_delete_object(), ast_ari_asterisk_get_object(), ast_ari_asterisk_update_object(), ast_sip_destroy_sorcery_global(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_domain_alias(), ast_sip_initialize_sorcery_global(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), ast_sorcery_alloc(), ast_sorcery_copy(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_diff(), ast_sorcery_force_reload(), ast_sorcery_force_reload_object(), ast_sorcery_get_module(), ast_sorcery_get_object_type(), ast_sorcery_get_wizard_mapping(), ast_sorcery_get_wizard_mapping_count(), ast_sorcery_instance_observer_add(), ast_sorcery_instance_observer_remove(), ast_sorcery_is_stale(), ast_sorcery_load(), ast_sorcery_load_object(), ast_sorcery_object_fields_register(), ast_sorcery_object_set_congestion_levels(), ast_sorcery_object_set_copy_handler(), ast_sorcery_object_set_diff_handler(), ast_sorcery_object_unregister(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_sorcery_ref(), ast_sorcery_reload(), ast_sorcery_reload_object(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_id(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), bucket_file_wizard_create(), bucket_file_wizard_delete(), bucket_file_wizard_is_stale(), bucket_file_wizard_retrieve(), bucket_file_wizard_update(), bucket_http_wizard_retrieve_id(), bucket_wizard_create(), bucket_wizard_delete(), bucket_wizard_is_stale(), bucket_wizard_retrieve(), can_reuse_registration(), create_object(), deinitialize_sorcery(), deinitialize_sorcery(), global_loaded_observer(), handle_aor(), handle_auth(), handle_auths(), handle_endpoint(), handle_export_primitives(), handle_identify(), handle_phoneprov(), handle_registrations(), instance_created_observer(), instance_destroying_observer(), load_config(), load_module(), memory_cache_full_update(), memory_cache_populate(), memory_cache_stale_check(), memory_cache_stale_check_object(), memory_cache_stale_update_full(), memory_cache_stale_update_object(), mock_retrieve_id(), object_type_loaded_observer(), object_type_registered_observer(), profile_load(), profile_reload(), reload_module(), return_sorcery_object(), sorcery_astdb_create(), sorcery_astdb_filter_objectset(), sorcery_astdb_retrieve_fields(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_multiple(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sorcery_astdb_update(), sorcery_config_internal_load(), sorcery_config_load(), sorcery_config_reload(), sorcery_config_retrieve_fields(), sorcery_config_retrieve_multiple(), sorcery_config_retrieve_prefix(), sorcery_config_retrieve_regex(), sorcery_destructor(), sorcery_function_read(), sorcery_is_configuration_met(), sorcery_is_explicit_name_met(), sorcery_memory_cache_create(), sorcery_memory_cache_load(), sorcery_memory_cache_retrieve_fields(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cache_retrieve_multiple(), sorcery_memory_cache_retrieve_prefix(), sorcery_memory_cache_retrieve_regex(), sorcery_memory_cached_object_alloc(), sorcery_memory_retrieve_fields(), sorcery_memory_retrieve_multiple(), sorcery_memory_retrieve_prefix(), sorcery_memory_retrieve_regex(), sorcery_realtime_create(), sorcery_realtime_filter_objectset(), sorcery_realtime_retrieve_fields(), sorcery_realtime_retrieve_id(), sorcery_realtime_retrieve_multiple(), sorcery_realtime_retrieve_prefix(), sorcery_realtime_retrieve_regex(), sorcery_realtime_update(), sorcery_reloadable(), sorcery_test_retrieve_id(), sorcery_wizard_load(), stale_cache_update_task_data_alloc(), stale_update_task_data_alloc(), tn_config_load(), tn_config_reload(), transport_apply(), unload_module(), vs_config_load(), vs_config_reload(), webchan_request(), and wizard_apply_handler().
|
static |
Definition at line 1574 of file chan_websocket.c.
Referenced by webchan_request().
|
static |
Definition at line 135 of file chan_websocket.c.
Referenced by load_module(), unload_module(), and webchan_request().