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/module.h"
#include "asterisk/callerid.h"
#include "asterisk/conversions.h"
Go to the source code of this file.
Macros | |
#define | MAX_OLI_DIGITS 2 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | add_id_headers (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
static void | add_pai_header (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
static void | add_party_param (pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_sip_session *session) |
static void | add_privacy_header (pjsip_tx_data *tdata, const struct ast_party_id *id) |
static void | add_privacy_params (pjsip_tx_data *tdata, pjsip_fromto_hdr *hdr, const struct ast_party_id *id) |
static void | add_rpid_header (const struct ast_sip_session *session, pjsip_tx_data *tdata, const struct ast_party_id *id) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | caller_id_incoming_request (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | caller_id_incoming_response (struct ast_sip_session *session, pjsip_rx_data *rdata) |
static void | caller_id_outgoing_request (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static void | caller_id_outgoing_response (struct ast_sip_session *session, pjsip_tx_data *tdata) |
static pjsip_fromto_hdr * | create_new_id_hdr (const pj_str_t *hdr_name, pjsip_fromto_hdr *base, pjsip_tx_data *tdata, const struct ast_party_id *id) |
static pjsip_fromto_hdr * | get_id_header (pjsip_rx_data *rdata, const pj_str_t *header_name) |
static int | load_module (void) |
static void | queue_connected_line_update (struct ast_sip_session *session, const struct ast_party_id *id) |
static int | set_id_from_from (struct pjsip_rx_data *rdata, struct ast_party_id *id) |
static void | set_id_from_hdr (pjsip_fromto_hdr *hdr, struct ast_party_id *id) |
static int | set_id_from_oli (pjsip_rx_data *rdata, int *ani2) |
static int | set_id_from_pai (pjsip_rx_data *rdata, struct ast_party_id *id) |
static int | set_id_from_rpid (pjsip_rx_data *rdata, struct ast_party_id *id) |
static int | should_queue_connected_line_update (const struct ast_sip_session *session, const struct ast_party_id *id) |
static int | unload_module (void) |
static void | update_incoming_connected_line (struct ast_sip_session *session, pjsip_rx_data *rdata) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "PJSIP Caller ID 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 = "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 struct ast_sip_session_supplement | caller_id_supplement |
#define MAX_OLI_DIGITS 2 |
Referenced by set_id_from_oli().
|
static |
Definition at line 861 of file res_pjsip_caller_id.c.
|
static |
Definition at line 861 of file res_pjsip_caller_id.c.
|
static |
Definition at line 756 of file res_pjsip_caller_id.c.
References add_pai_header(), add_rpid_header(), ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_party_id::number, ast_sip_endpoint_id_configuration::send_pai, ast_sip_endpoint_id_configuration::send_rpid, ast_sip_endpoint_id_configuration::trust_outbound, and ast_party_number::valid.
Referenced by caller_id_outgoing_request(), and caller_id_outgoing_response().
|
static |
Definition at line 563 of file res_pjsip_caller_id.c.
References add_privacy_header(), ast_sip_modify_id_header(), create_new_id_hdr(), NULL, and ast_sip_session::saved_from_hdr.
Referenced by add_id_headers().
|
static |
Definition at line 616 of file res_pjsip_caller_id.c.
References ast_sip_session::inv_session.
Referenced by add_rpid_header().
|
static |
Definition at line 538 of file res_pjsip_caller_id.c.
References ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_RESTRICTION, and NULL.
Referenced by add_pai_header().
|
static |
Definition at line 647 of file res_pjsip_caller_id.c.
References ast_party_id_presentation(), AST_PRES_ALLOWED, AST_PRES_NUMBER_TYPE, AST_PRES_RESTRICTION, and AST_PRES_USER_NUMBER_PASSED_SCREEN.
Referenced by add_rpid_header().
|
static |
Definition at line 699 of file res_pjsip_caller_id.c.
References add_party_param(), add_privacy_params(), ast_sip_modify_id_header(), create_new_id_hdr(), NULL, and ast_sip_session::saved_from_hdr.
Referenced by add_id_headers().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 861 of file res_pjsip_caller_id.c.
|
static |
Definition at line 428 of file res_pjsip_caller_id.c.
References ast_sip_session::ani2, ast_free, ast_party_id_copy(), ast_strdup, ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_session::id, ast_sip_endpoint::id, ast_party_id::number, ast_sip_endpoint_id_configuration::self, set_id_from_from(), set_id_from_oli(), set_id_from_pai(), set_id_from_rpid(), ast_party_id::tag, ast_sip_endpoint_id_configuration::trust_inbound, update_incoming_connected_line(), and ast_party_number::valid.
|
static |
Definition at line 471 of file res_pjsip_caller_id.c.
References ast_sip_session::channel, and update_incoming_connected_line().
|
static |
Definition at line 782 of file res_pjsip_caller_id.c.
References add_id_headers(), ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), and ast_sip_session::channel.
|
static |
Definition at line 810 of file res_pjsip_caller_id.c.
References add_id_headers(), ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_endpoint::id, ast_sip_session::inv_session, and ast_sip_endpoint_id_configuration::send_connected_line.
|
static |
Definition at line 488 of file res_pjsip_caller_id.c.
References ast_alloca, ast_escape_quoted(), ast_strlen_zero, ast_party_id::name, NULL, ast_party_id::number, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.
Referenced by add_pai_header(), and add_rpid_header().
|
static |
Definition at line 98 of file res_pjsip_caller_id.c.
References ast_log, LOG_WARNING, and NULL.
Referenced by set_id_from_oli(), set_id_from_pai(), and set_id_from_rpid().
|
static |
Definition at line 842 of file res_pjsip_caller_id.c.
References AST_MODULE_LOAD_SUCCESS, ast_module_shutdown_ref, and ast_sip_session_register_supplement.
Referenced by unload_module().
|
static |
Definition at line 362 of file res_pjsip_caller_id.c.
References ast_party_caller::ani, ast_party_caller::ani2, ast_channel_caller(), ast_channel_queue_connected_line_update(), ast_channel_set_caller_event(), AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER, ast_party_caller_init(), ast_party_connected_line_init(), ast_party_id_copy(), ast_sip_session::channel, ast_sip_session::endpoint, ast_sip_session::id, ast_party_caller::id, ast_party_connected_line::id, ast_sip_endpoint::id, id, NULL, ast_sip_endpoint_id_configuration::self, ast_party_connected_line::source, and ast_party_id::tag.
Referenced by update_incoming_connected_line().
|
static |
Definition at line 284 of file res_pjsip_caller_id.c.
References ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.
Referenced by caller_id_incoming_request().
|
static |
Definition at line 44 of file res_pjsip_caller_id.c.
References AST_CHANNEL_NAME, ast_copy_pj_str(), ast_free, ast_strdup, ast_strlen_zero, cid_name, cid_num, ast_party_id::name, ast_party_id::number, ast_party_name::str, and ast_party_number::str.
Referenced by set_id_from_from(), set_id_from_pai(), and set_id_from_rpid().
|
static |
Definition at line 153 of file res_pjsip_caller_id.c.
References ast_copy_pj_str(), ast_str_to_int(), get_id_header(), and MAX_OLI_DIGITS.
Referenced by caller_id_incoming_request().
|
static |
Definition at line 191 of file res_pjsip_caller_id.c.
References AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED, AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED, get_id_header(), NULL, ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.
Referenced by caller_id_incoming_request(), and update_incoming_connected_line().
|
static |
Definition at line 232 of file res_pjsip_caller_id.c.
References AST_PRES_ALLOWED, AST_PRES_RESTRICTED, AST_PRES_USER_NUMBER_PASSED_SCREEN, AST_PRES_USER_NUMBER_UNSCREENED, get_id_header(), ast_party_id::number, set_id_from_hdr(), and ast_party_number::valid.
Referenced by caller_id_incoming_request(), and update_incoming_connected_line().
|
static |
Definition at line 316 of file res_pjsip_caller_id.c.
References ast_strlen_zero, ast_sip_session::id, ast_party_id::name, ast_party_id::number, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.
Referenced by update_incoming_connected_line().
|
static |
Definition at line 849 of file res_pjsip_caller_id.c.
References 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 398 of file res_pjsip_caller_id.c.
References ast_party_id_free(), ast_party_id_init(), ast_sip_session::endpoint, ast_sip_endpoint::id, queue_connected_line_update(), set_id_from_pai(), set_id_from_rpid(), should_queue_connected_line_update(), ast_sip_endpoint_id_configuration::trust_connected_line, and ast_sip_endpoint_id_configuration::trust_inbound.
Referenced by caller_id_incoming_request(), and caller_id_incoming_response().
|
static |
Definition at line 861 of file res_pjsip_caller_id.c.
|
static |
Definition at line 861 of file res_pjsip_caller_id.c.
|
static |
Definition at line 833 of file res_pjsip_caller_id.c.