Asterisk - The Open Source Telephony Project
18.5.0
|
#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... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_header (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 function 'read' callback. More... | |
static int | func_write_header (struct ast_channel *chan, const char *cmd, char *data, const char *value) |
Implements function 'write' callback. More... | |
static int | incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
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 | remove_header (void *obj) |
static int | unload_module (void) |
static int | update_header (void *obj) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Header Functions" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_APP_DEPEND, .requires = "res_pjsip,res_pjsip_session", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const struct ast_datastore_info | header_datastore |
Datastore for saving headers. More... | |
static struct ast_sip_session_supplement | header_funcs_supplement |
static struct ast_custom_function | pjsip_header_function |
|
static |
Definition at line 624 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 624 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 315 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, ast_sip_session::inv_session, hdr_list_entry::nextptr, pool, RAII_VAR, session, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_write_header().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 624 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 222 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 read_header(), and update_header().
|
static |
Implements function 'read' callback.
Valid actions are 'read' and 'remove'.
Definition at line 442 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_name, header_data::header_number, header_data::header_value, header_data::len, len(), LOG_ERROR, NULL, read_header(), remove_header(), ast_sip_session::serializer, and ast_sip_channel_pvt::session.
|
static |
Implements function 'write' callback.
Valid actions are 'add', 'update' and 'remove'.
Definition at line 501 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_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, update_header(), and value.
|
static |
Definition at line 196 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(), ast_sip_session::inv_session, pool, RAII_VAR, and ast_datastore_info::type.
|
static |
Definition at line 173 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().
|
static |
Definition at line 603 of file res_pjsip_header_funcs.c.
References ast_custom_function_register, AST_MODULE_LOAD_SUCCESS, and ast_sip_session_register_supplement.
Referenced by unload_module().
|
static |
Definition at line 576 of file res_pjsip_header_funcs.c.
References ao2_cleanup, AST_LIST_TRAVERSE, ast_sip_session_get_datastore(), ast_sip_session_remove_datastore(), hdr_list_entry::hdr, ast_sip_session::inv_session, hdr_list_entry::nextptr, pool, RAII_VAR, and ast_datastore_info::type.
|
static |
Definition at line 254 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_alloca, ast_copy_string(), ast_debug, ast_log, AST_LOG_ERROR, ast_sip_session_get_datastore(), ast_strip(), header_data::buf, header_data::channel, find_header(), hdr_list_entry::hdr, header_data::header_name, header_data::header_number, header_data::len, NULL, RAII_VAR, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_read_header().
|
static |
Definition at line 398 of file res_pjsip_header_funcs.c.
References ao2_cleanup, 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, header_data::channel, hdr_list_entry::hdr, header_data::header_name, header_data::len, len(), hdr_list_entry::nextptr, RAII_VAR, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_read_header(), and func_write_header().
|
static |
Definition at line 611 of file res_pjsip_header_funcs.c.
References ast_custom_function_unregister(), AST_MODFLAG_LOAD_ORDER, AST_MODPRI_APP_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_sip_session_unregister_supplement(), ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 364 of file res_pjsip_header_funcs.c.
References ao2_cleanup, ast_log, AST_LOG_ERROR, ast_sip_session_get_datastore(), header_data::channel, find_header(), hdr_list_entry::hdr, header_data::header_name, header_data::header_number, header_data::header_value, NULL, RAII_VAR, ast_sip_channel_pvt::session, and ast_datastore_info::type.
Referenced by func_write_header().
|
static |
Definition at line 624 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 624 of file res_pjsip_header_funcs.c.
|
static |
Datastore for saving headers.
Definition at line 152 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 596 of file res_pjsip_header_funcs.c.
|
static |
Definition at line 558 of file res_pjsip_header_funcs.c.