Asterisk - The Open Source Telephony Project GIT-master-d856a3e
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_ua.h>
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/callerid.h"
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/strings.h"
Go to the source code of this file.
Data Structures | |
struct | reasons |
Diversion header reasons. More... | |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | add_diversion_header (pjsip_tx_data *tdata, struct ast_party_redirecting *data) |
static void | add_history_info_header (pjsip_tx_data *tdata, struct ast_party_redirecting *data) |
static int | add_supported (pjsip_tx_data *tdata) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static enum AST_REDIRECTING_REASON | cause_to_reason (const unsigned long cause) |
static void | copy_redirecting_id (struct ast_party_id *dst, const struct ast_party_id *src, struct ast_set_party_id *update) |
static int | diversion_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | diversion_incoming_response (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | diversion_outgoing_request (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static void | diversion_outgoing_response (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static pjsip_fromto_hdr * | get_diversion_header (pjsip_rx_data *rdata) |
static pjsip_fromto_hdr * | get_history_info_header (pjsip_rx_data *rdata, const unsigned int first) |
static void | get_redirecting_add_diversion (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static int | load_module (void) |
static const unsigned int | reason_code_to_cause (const struct ast_party_redirecting_reason *reason) |
static const char * | reason_code_to_str (const struct ast_party_redirecting_reason *reason) |
static void | set_redirecting (struct ast_sip_session *session, pjsip_fromto_hdr *from_info, pjsip_name_addr *to_info) |
static void | set_redirecting_id (pjsip_name_addr *name_addr, struct ast_party_id *data, struct ast_set_party_id *update) |
static void | set_redirecting_reason (pjsip_fromto_hdr *from_info, pjsip_name_addr *to_info, struct ast_party_redirecting_reason *data) |
static void | set_redirecting_reason_by_cause (pjsip_name_addr *name_addr, struct ast_party_redirecting_reason *data) |
static void | set_redirecting_value (char **dst, const pj_str_t *src) |
static int | sip_is_token (const char *str) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Add Diversion Header Support" , .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 = AST_BUILDOPT_SUM, .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 pj_str_t | diversion_name = { "Diversion", 9 } |
static struct ast_sip_session_supplement | diversion_supplement |
static pj_str_t | HISTINFO_SUPPORTED_NAME = { "histinfo", 8 } |
static const pj_str_t | history_info_name = { "History-Info", 12 } |
static const struct reasons | reason_table [] |
|
static |
Definition at line 728 of file res_pjsip_diversion.c.
|
static |
Definition at line 728 of file res_pjsip_diversion.c.
|
static |
Definition at line 504 of file res_pjsip_diversion.c.
References ast_sip_pjsip_uri_get_username(), ast_strlen_zero(), diversion_name, ast_party_redirecting::from, id, NULL, ast_party_redirecting::reason, reason_code_to_str(), sip_is_token(), and ast_party_redirecting::to.
Referenced by get_redirecting_add_diversion().
|
static |
Definition at line 570 of file res_pjsip_diversion.c.
References ast_strlen_zero(), ast_party_redirecting::from, history_info_name, ast_party_id::name, NULL, ast_party_id::number, ast_party_redirecting::reason, reason_code_to_cause(), ast_party_name::str, ast_party_number::str, ast_party_redirecting::to, and ast_party_number::valid.
Referenced by get_redirecting_add_diversion().
|
static |
Definition at line 120 of file res_pjsip_diversion.c.
References HISTINFO_SUPPORTED_NAME, and NULL.
Referenced by get_redirecting_add_diversion().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 728 of file res_pjsip_diversion.c.
|
static |
Definition at line 102 of file res_pjsip_diversion.c.
References AST_REDIRECTING_REASON_DEFLECTION, AST_REDIRECTING_REASON_NO_ANSWER, AST_REDIRECTING_REASON_UNAVAILABLE, AST_REDIRECTING_REASON_UNCONDITIONAL, AST_REDIRECTING_REASON_UNKNOWN, and AST_REDIRECTING_REASON_USER_BUSY.
Referenced by set_redirecting_reason_by_cause().
|
static |
Definition at line 312 of file res_pjsip_diversion.c.
References ast_party_id_copy(), ast_party_id::name, ast_party_id::number, update(), ast_party_name::valid, and ast_party_number::valid.
Referenced by set_redirecting().
|
static |
Definition at line 427 of file res_pjsip_diversion.c.
References get_diversion_header(), get_history_info_header(), session, and set_redirecting().
|
static |
Definition at line 450 of file res_pjsip_diversion.c.
References get_diversion_header(), get_history_info_header(), NULL, session, set_redirecting(), and status.
|
static |
Definition at line 673 of file res_pjsip_diversion.c.
References get_redirecting_add_diversion(), and session.
|
static |
Definition at line 685 of file res_pjsip_diversion.c.
References get_redirecting_add_diversion(), session, and status.
|
static |
Definition at line 190 of file res_pjsip_diversion.c.
References diversion_name, NULL, and value.
Referenced by diversion_incoming_request(), and diversion_incoming_response().
|
static |
Definition at line 215 of file res_pjsip_diversion.c.
References first, history_info_name, NULL, and value.
Referenced by diversion_incoming_request(), and diversion_incoming_response().
|
static |
Definition at line 649 of file res_pjsip_diversion.c.
References add_diversion_header(), add_history_info_header(), add_supported(), ast_channel_redirecting(), and session.
Referenced by diversion_outgoing_request(), and diversion_outgoing_response().
|
static |
Definition at line 707 of file res_pjsip_diversion.c.
References AST_MODULE_LOAD_SUCCESS, ast_module_shutdown_ref, ast_sip_session_register_supplement, diversion_supplement, and ast_module_info::self.
|
static |
Definition at line 175 of file res_pjsip_diversion.c.
References ARRAY_LEN, reasons::cause, ast_party_redirecting_reason::code, and reason_table.
Referenced by add_history_info_header().
|
static |
Definition at line 155 of file res_pjsip_diversion.c.
References ARRAY_LEN, ast_strlen_zero(), ast_party_redirecting_reason::code, reason_table, ast_party_redirecting_reason::str, and reasons::text.
Referenced by add_diversion_header().
|
static |
Definition at line 386 of file res_pjsip_diversion.c.
References ast_channel_queue_redirecting_update(), ast_channel_set_redirecting(), ast_party_redirecting_free(), ast_party_redirecting_init(), AST_REDIRECTING_REASON_UNKNOWN, ast_set_party_id_all(), ast_party_redirecting_reason::code, copy_redirecting_id(), ast_party_redirecting::count, ast_party_redirecting::from, ast_party_redirecting::reason, session, set_redirecting_id(), set_redirecting_reason(), ast_party_redirecting::to, and update().
Referenced by diversion_incoming_request(), and diversion_incoming_response().
|
static |
Definition at line 273 of file res_pjsip_diversion.c.
References ast_party_id::name, ast_party_id::number, set_redirecting_value(), ast_party_name::str, ast_party_number::str, update(), ast_party_name::valid, and ast_party_number::valid.
Referenced by set_redirecting().
|
static |
Definition at line 351 of file res_pjsip_diversion.c.
References ast_free, ast_redirecting_reason_parse(), AST_REDIRECTING_REASON_UNKNOWN, ast_strdup, ast_strdupa, ast_strip_quoted(), ast_party_redirecting_reason::code, set_redirecting_reason_by_cause(), set_redirecting_value(), and ast_party_redirecting_reason::str.
Referenced by set_redirecting().
|
static |
Definition at line 326 of file res_pjsip_diversion.c.
References ast_free, ast_sip_is_allowed_uri(), ast_sip_pjsip_uri_get_other_param(), ast_strdup, cause_to_reason(), ast_party_redirecting_reason::code, NULL, and ast_party_redirecting_reason::str.
Referenced by set_redirecting_reason().
|
static |
Definition at line 264 of file res_pjsip_diversion.c.
References ast_copy_pj_str(), ast_free, and ast_malloc.
Referenced by set_redirecting_id(), and set_redirecting_reason().
|
static |
Definition at line 53 of file res_pjsip_diversion.c.
References ast_strlen_zero(), and str.
Referenced by add_diversion_header().
|
static |
Definition at line 716 of file res_pjsip_diversion.c.
References ast_sip_session_unregister_supplement(), and diversion_supplement.
|
static |
Definition at line 728 of file res_pjsip_diversion.c.
|
static |
Definition at line 728 of file res_pjsip_diversion.c.
|
static |
Definition at line 38 of file res_pjsip_diversion.c.
Referenced by add_diversion_header(), and get_diversion_header().
|
static |
Definition at line 695 of file res_pjsip_diversion.c.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 40 of file res_pjsip_diversion.c.
Referenced by add_supported().
|
static |
Definition at line 39 of file res_pjsip_diversion.c.
Referenced by add_history_info_header(), and get_history_info_header().
|
static |
Referenced by reason_code_to_cause(), and reason_code_to_str().