|
Asterisk - The Open Source Telephony Project GIT-master-4f2b068
|
#include "asterisk.h"#include <pjsip.h>#include <pjsip_ua.h>#include "asterisk/res_pjsip.h"#include "asterisk/res_pjsip_session.h"#include "asterisk/channel.h"#include "asterisk/pbx.h"#include "asterisk/app.h"#include "asterisk/module.h"#include "asterisk/utils.h"
Go to the source code of this file.
Data Structures | |
| struct | hdr_list |
| struct | hdr_list_entry |
| Linked list for accumulating headers. More... | |
| struct | header_data |
| Data structure used for ast_sip_push_task_wait_serializer More... | |
| struct | param_data |
Macros | |
| #define | param_add(pool, list, pname, pvalue) |
Enumerations | |
| enum | param_type { PARAMETER_HEADER , PARAMETER_URI } |
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | add_header (void *obj) |
| static int | add_inheritable_header (struct ast_channel *channel, const char *header_name, const char *header_value) |
| static int | add_param (void *obj) |
| struct ast_module * | AST_MODULE_SELF_SYM (void) |
| static pjsip_hdr * | find_header (struct hdr_list *list, const char *header_name, int header_number) |
| static int | func_read_header (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| Implements PJSIP_HEADER function 'read' callback. | |
| static int | func_read_headers (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| Read list of unique SIP headers. | |
| static int | func_read_param (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| static int | func_response_read_header (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| Implements PJSIP_RESPONSE_HEADER function 'read' callback. | |
| static int | func_response_read_headers (struct ast_channel *chan, const char *function, char *data, char *buf, size_t len) |
| Read list of unique SIP response headers. | |
| static int | func_write_header (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
| Implements PJSIP_HEADER function 'write' callback. | |
| static int | func_write_inheritable_header (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
| Implements PJSIP_INHERITABLE_HEADER function 'write' callback. | |
| static int | func_write_param (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
| static int | incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
| static void | incoming_response (struct ast_sip_session *session, pjsip_rx_data *rdata) |
| static void | inheritable_headers_destroy (void *data) |
| static void * | inheritable_headers_duplicate (void *data) |
| static int | insert_headers (pj_pool_t *pool, struct hdr_list *list, pjsip_msg *msg) |
| static int | load_module (void) |
| static void | outgoing_request (struct ast_sip_session *session, pjsip_tx_data *tdata) |
| static int | read_header (void *obj) |
| static int | read_headers (void *obj) |
| static int | read_param (void *obj) |
| static int | remove_header (void *obj) |
| static int | remove_inheritable_header (struct ast_channel *channel, const char *header_name) |
| static int | unload_module (void) |
| static int | update_header (void *obj) |
| static int | update_inheritable_header (struct ast_channel *channel, const char *header_name, const char *header_value, int header_number) |
| #define param_add | ( | pool, | |
| list, | |||
| pname, | |||
| pvalue | |||
| ) |
| enum param_type |
| Enumerator | |
|---|---|
| PARAMETER_HEADER | |
| PARAMETER_URI | |
Definition at line 1597 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 1847 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 1847 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 760 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_debug, AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_INSERT_TAIL, ast_log, AST_LOG_ERROR, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_datastore(), header_data::channel, hdr_list_entry::hdr, header_data::header_name, header_data::header_value, RAII_VAR, ast_sip_channel_pvt::session, session, session_header_datastore, and ast_datastore_info::type.
Referenced by func_write_header().
|
static |
Definition at line 811 of file res_pjsip_header_funcs.c.
References ast_channel_datastore_add(), ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_datastore_alloc, ast_debug, ast_log, ast_variable_new, ast_datastore::data, DATASTORE_INHERIT_FOREVER, inheritable_header_datastore, ast_datastore::inheritance, LOG_ERROR, ast_variable::next, NULL, and ast_datastore_info::type.
Referenced by func_write_inheritable_header().
|
static |
Definition at line 1665 of file res_pjsip_header_funcs.c.
References ast_debug, ast_log, param_data::channel, LOG_WARNING, param_add, param_data::param_name, param_data::param_value, PARAMETER_URI, param_data::paramtype, S_OR, ast_sip_channel_pvt::session, and session.
Referenced by func_write_param().
| struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1847 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 555 of file res_pjsip_header_funcs.c.
References AST_LIST_TRAVERSE, ast_strlen_zero(), hdr_list_entry::hdr, hdr_list_entry::nextptr, and NULL.
Referenced by update_header().
|
static |
Implements PJSIP_HEADER function 'read' callback.
Valid actions are 'read' and 'remove'.
Definition at line 1237 of file res_pjsip_header_funcs.c.
References args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, header_data::buf, header_data::channel, header_data::header_datastore, header_data::header_name, header_data::header_number, header_data::header_value, len(), header_data::len, LOG_ERROR, NULL, read_header(), remove_header(), ast_sip_session::serializer, ast_sip_channel_pvt::session, and session_header_datastore.
|
static |
Read list of unique SIP headers.
Definition at line 1174 of file res_pjsip_header_funcs.c.
References args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, buf, header_data::buf, header_data::channel, header_data::header_datastore, header_data::header_name, header_data::header_value, len(), header_data::len, LOG_ERROR, NULL, read_headers(), ast_sip_session::serializer, ast_sip_channel_pvt::session, and session_header_datastore.
|
static |
Definition at line 1713 of file res_pjsip_header_funcs.c.
References args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, param_data::buf, param_data::channel, param_data::header_name, len(), param_data::len, LOG_ERROR, LOG_WARNING, NULL, param_data::param_name, PARAMETER_HEADER, PARAMETER_URI, param_data::paramtype, read_param(), ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Implements PJSIP_RESPONSE_HEADER function 'read' callback.
Valid actions are 'read'
Definition at line 1295 of file res_pjsip_header_funcs.c.
References args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, header_data::buf, header_data::channel, header_data::header_datastore, header_data::header_name, header_data::header_number, header_data::header_value, len(), header_data::len, LOG_ERROR, NULL, read_header(), response_header_datastore, ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Read list of unique SIP response headers.
Definition at line 1202 of file res_pjsip_header_funcs.c.
References args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), buf, header_data::buf, header_data::channel, header_data::header_datastore, header_data::header_name, header_data::header_value, len(), header_data::len, LOG_ERROR, NULL, read_headers(), response_header_datastore, ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Implements PJSIP_HEADER function 'write' callback.
Valid actions are 'add', 'update' and 'remove'.
Definition at line 1350 of file res_pjsip_header_funcs.c.
References add_header(), args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), header_data::buf, header_data::channel, header_data::header_datastore, header_data::header_name, header_data::header_number, header_data::header_value, header_data::len, LOG_ERROR, NULL, remove_header(), ast_sip_session::serializer, ast_sip_channel_pvt::session, session_header_datastore, update_header(), and value.
|
static |
Implements PJSIP_INHERITABLE_HEADER function 'write' callback.
Valid actions are 'add', 'update' and 'remove'.
Definition at line 1414 of file res_pjsip_header_funcs.c.
References add_inheritable_header(), args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, AST_STANDARD_APP_ARGS, ast_strlen_zero(), header_data::header_name, header_data::header_number, LOG_ERROR, remove_inheritable_header(), update_inheritable_header(), and value.
|
static |
Definition at line 1763 of file res_pjsip_header_funcs.c.
References add_param(), args, AST_APP_ARG, ast_channel_name(), ast_channel_tech_pvt(), AST_DECLARE_APP_ARGS, ast_log, AST_LOG_ERROR, ast_sip_push_task_wait_serializer, AST_STANDARD_APP_ARGS, ast_strlen_zero(), param_data::channel, param_data::header_name, LOG_ERROR, LOG_WARNING, NULL, param_data::param_name, param_data::param_value, PARAMETER_HEADER, PARAMETER_URI, param_data::paramtype, ast_sip_session::serializer, ast_sip_channel_pvt::session, and value.
|
static |
Definition at line 493 of file res_pjsip_header_funcs.c.
References ao2_cleanup, AST_LIST_HEAD_INIT_NOLOCK, ast_log, AST_LOG_ERROR, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_datastore(), insert_headers(), RAII_VAR, session, session_header_datastore, and ast_datastore_info::type.
|
static |
Definition at line 523 of file res_pjsip_header_funcs.c.
References ao2_cleanup, AST_LIST_HEAD_INIT_NOLOCK, ast_log, AST_LOG_ERROR, ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_datastore(), insert_headers(), RAII_VAR, response_header_datastore, session, status, and ast_datastore_info::type.
|
static |
Definition at line 429 of file res_pjsip_header_funcs.c.
References ast_variables_destroy().
Referenced by remove_inheritable_header(), and update_inheritable_header().
|
static |
Definition at line 420 of file res_pjsip_header_funcs.c.
References ast_variables_dup().
Referenced by outgoing_request().
|
static |
Definition at line 470 of file res_pjsip_header_funcs.c.
References AST_LIST_INSERT_TAIL, hdr_list_entry::hdr, and hdr_list_entry::nextptr.
Referenced by incoming_request(), and incoming_response().
|
static |
Definition at line 1816 of file res_pjsip_header_funcs.c.
References ast_custom_function_register, AST_MODULE_LOAD_SUCCESS, ast_sip_session_register_supplement, header_funcs_supplement, pjsip_header_function, pjsip_header_inherit_function, pjsip_header_param_function, pjsip_headers_function, pjsip_response_header_function, and pjsip_response_headers_function.
|
static |
Definition at line 1498 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ao2_ref, ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, AST_LIST_TRAVERSE, ast_log, ast_sip_add_header(), ast_sip_session_add_datastore(), ast_sip_session_alloc_datastore(), ast_sip_session_get_datastore(), ast_sip_session_remove_datastore(), ast_variables_reverse(), ast_datastore::data, hdr_list_entry::hdr, inheritable_header_datastore, inheritable_headers_duplicate(), ast_datastore::inheritance, LOG_ERROR, ast_variable::next, NULL, RAII_VAR, session, session_header_datastore, ast_datastore_info::type, ast_datastore::uid, and var.
|
static |
Definition at line 677 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_alloca, ast_copy_string(), ast_debug, AST_LIST_TRAVERSE, ast_log, AST_LOG_ERROR, ast_sip_session_get_datastore(), ast_strip(), header_data::buf, header_data::channel, hdr_list_entry::hdr, header_data::header_datastore, header_data::header_name, header_data::header_number, len(), header_data::len, NULL, RAII_VAR, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_read_header(), and func_response_read_header().
|
static |
Definition at line 586 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_alloca, ast_copy_string(), ast_debug, AST_LIST_TRAVERSE, ast_log, AST_LOG_ERROR, AST_LOG_WARNING, ast_sip_session_get_datastore(), ast_strip(), ast_strlen_zero(), header_data::buf, header_data::channel, hdr_list_entry::hdr, header_data::header_datastore, header_data::header_name, len(), header_data::len, NULL, RAII_VAR, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_read_headers(), and func_response_read_headers().
|
static |
Definition at line 1613 of file res_pjsip_header_funcs.c.
References ast_copy_string(), ast_debug, ast_log, param_data::buf, param_data::channel, param_data::len, LOG_ERROR, param_data::param_name, PARAMETER_URI, param_data::paramtype, ast_sip_channel_pvt::session, and session.
Referenced by func_read_param().
|
static |
Definition at line 1015 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_channel_name(), ast_debug, AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, ast_log, AST_LOG_ERROR, ast_sip_session_get_datastore(), header_data::buf, ast_sip_session::channel, header_data::channel, hdr_list_entry::hdr, header_data::header_name, len(), header_data::len, hdr_list_entry::nextptr, RAII_VAR, ast_sip_channel_pvt::session, session_header_datastore, and ast_datastore_info::type.
Referenced by func_read_header(), and func_write_header().
|
static |
Definition at line 1079 of file res_pjsip_header_funcs.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_log, AST_LOG_ERROR, ast_variables_destroy(), ast_datastore::data, inheritable_header_datastore, inheritable_headers_destroy(), len(), match(), ast_variable::next, NULL, and var.
Referenced by func_write_inheritable_header().
|
static |
Definition at line 1829 of file res_pjsip_header_funcs.c.
References ast_custom_function_unregister(), ast_sip_session_unregister_supplement(), header_funcs_supplement, pjsip_header_function, pjsip_header_inherit_function, pjsip_header_param_function, pjsip_headers_function, pjsip_response_header_function, and pjsip_response_headers_function.
|
static |
Definition at line 881 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_channel_name(), ast_debug, ast_log, AST_LOG_ERROR, ast_sip_session_get_datastore(), ast_sip_session::channel, header_data::channel, find_header(), header_data::header_name, header_data::header_number, header_data::header_value, ast_sip_session::inv_session, NULL, RAII_VAR, ast_sip_channel_pvt::session, session_header_datastore, and ast_datastore_info::type.
Referenced by func_write_header().
|
static |
Definition at line 925 of file res_pjsip_header_funcs.c.
References ast_channel_datastore_find(), ast_channel_lock, ast_channel_name(), ast_channel_unlock, ast_debug, ast_log, AST_LOG_ERROR, ast_variable_new, ast_datastore::data, inheritable_header_datastore, inheritable_headers_destroy(), ast_variable::next, NULL, and var.
Referenced by func_write_inheritable_header().
|
static |
Definition at line 1847 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 1847 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 1589 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Datastore for saving inheritable headers (contains hdr_list with ast_malloc'd entries)
Definition at line 441 of file res_pjsip_header_funcs.c.
Referenced by add_inheritable_header(), outgoing_request(), remove_inheritable_header(), and update_inheritable_header().
|
static |
Definition at line 1460 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1466 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1810 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1471 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1476 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 1481 of file res_pjsip_header_funcs.c.
Referenced by load_module(), and unload_module().
|
static |
Datastore for saving response headers.
Definition at line 448 of file res_pjsip_header_funcs.c.
Referenced by func_response_read_header(), func_response_read_headers(), and incoming_response().
|
static |
Datastore for saving headers in session (contains hdr_list, no destroy needed)
Definition at line 435 of file res_pjsip_header_funcs.c.
Referenced by add_header(), func_read_header(), func_read_headers(), func_write_header(), incoming_request(), outgoing_request(), remove_header(), and update_header().