Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include "asterisk/callerid.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/module.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/res_stir_shaken.h"
Go to the source code of this file.
Macros | |
#define | _TRACE_PREFIX_ "pjss",__LINE__, "" |
#define | AST_BUILDOPT_SUM "" |
#define | response_to_str(_code) |
#define | SIP_RESPONSE_CODE_BAD_IDENTITY_INFO_STR "Bad Identity Info" |
#define | SIP_RESPONSE_CODE_INTERNAL_ERROR_STR "Internal Error" |
#define | SIP_RESPONSE_CODE_INVALID_IDENTITY_HEADER_STR "Invalid Identity Header" |
#define | SIP_RESPONSE_CODE_OK_STR "OK" |
#define | SIP_RESPONSE_CODE_STALE_DATE_STR "Stale Date" |
#define | SIP_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL_STR "Unsupported Credential" |
#define | SIP_RESPONSE_CODE_USE_IDENTITY_HEADER_STR "Use Identity Header" |
#define | SIP_RESPONSE_CODE_USE_SUPPORTED_PASSPORT_FORMAT_STR "Use Supported PASSporT Format" |
#define | translate_code(_vs_rc, _sip_rc) |
Enumerations | |
enum | process_failure_rc { PROCESS_FAILURE_CONTINUE = 0 , PROCESS_FAILURE_REJECT , PROCESS_FAILURE_SYSTEM_FAILURE } |
enum | sip_response_code { SIP_RESPONSE_CODE_OK = 200 , SIP_RESPONSE_CODE_STALE_DATE = 403 , SIP_RESPONSE_CODE_USE_IDENTITY_HEADER = 428 , SIP_RESPONSE_CODE_BAD_IDENTITY_INFO = 436 , SIP_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL = 437 , SIP_RESPONSE_CODE_INVALID_IDENTITY_HEADER = 438 , SIP_RESPONSE_CODE_USE_SUPPORTED_PASSPORT_FORMAT = 428 , SIP_RESPONSE_CODE_INTERNAL_ERROR = 500 } |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "PJSIP STIR/SHAKEN Module for Asterisk" , .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 = "" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .requires = "res_pjsip,res_pjsip_session,res_stir_shaken", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const pj_str_t | date_hdr_str = { "Date", 4 } |
static const pj_str_t | identity_hdr_str = { "Identity", 8 } |
static struct ast_sip_session_supplement | stir_shaken_supplement |
#define _TRACE_PREFIX_ "pjss",__LINE__, "" |
Definition at line 29 of file res_pjsip_stir_shaken.c.
#define AST_BUILDOPT_SUM "" |
Definition at line 492 of file res_pjsip_stir_shaken.c.
#define response_to_str | ( | _code | ) |
Definition at line 64 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_BAD_IDENTITY_INFO_STR "Bad Identity Info" |
Definition at line 59 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_INTERNAL_ERROR_STR "Internal Error" |
Definition at line 62 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_INVALID_IDENTITY_HEADER_STR "Invalid Identity Header" |
Definition at line 61 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_OK_STR "OK" |
Definition at line 54 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_STALE_DATE_STR "Stale Date" |
Definition at line 56 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL_STR "Unsupported Credential" |
Definition at line 60 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_USE_IDENTITY_HEADER_STR "Use Identity Header" |
Definition at line 57 of file res_pjsip_stir_shaken.c.
#define SIP_RESPONSE_CODE_USE_SUPPORTED_PASSPORT_FORMAT_STR "Use Supported PASSporT Format" |
Definition at line 58 of file res_pjsip_stir_shaken.c.
#define translate_code | ( | _vs_rc, | |
_sip_rc | |||
) |
Definition at line 83 of file res_pjsip_stir_shaken.c.
enum process_failure_rc |
Enumerator | |
---|---|
PROCESS_FAILURE_CONTINUE | |
PROCESS_FAILURE_REJECT | |
PROCESS_FAILURE_SYSTEM_FAILURE |
Definition at line 136 of file res_pjsip_stir_shaken.c.
enum sip_response_code |
Definition at line 43 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 500 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 500 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 368 of file res_pjsip_stir_shaken.c.
References ast_sip_add_date_header(), ast_sip_session_get_name(), date_hdr_str, NULL, SCOPE_ENTER, SCOPE_EXIT_RTN, and session.
Referenced by stir_shaken_outgoing_request().
|
static |
Definition at line 304 of file res_pjsip_stir_shaken.c.
References AST_RTP_DTLS_HASH_SHA256, ast_rtp_instance_get_dtls(), ast_sip_session_get_name(), ast_stir_shaken_as_ctx_add_fingerprint(), ast_stir_shaken_as_ctx_wants_fingerprints(), ast_trace, AST_VECTOR_GET, AST_VECTOR_SIZE, d, NULL, ast_sip_session_media::rtp, SCOPE_ENTER, SCOPE_EXIT_RTN, session, and ast_sip_session_media_state::sessions.
Referenced by stir_shaken_outgoing_request().
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 500 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 339 of file res_pjsip_stir_shaken.c.
References ast_copy_pj_str(), ast_malloc, NULL, SCOPE_ENTER, and SCOPE_EXIT_RTN_VALUE.
Referenced by stir_shaken_outgoing_request().
|
static |
Definition at line 485 of file res_pjsip_stir_shaken.c.
References AST_MODULE_LOAD_SUCCESS, ast_sip_session_register_supplement, and stir_shaken_supplement.
|
static |
Definition at line 149 of file res_pjsip_stir_shaken.c.
References ast_sip_session_add_reason_header(), ast_sip_session_get_name(), ast_stir_shaken_add_result_to_channel(), ast_stir_shaken_vs_ctx_set_response_code(), ast_stir_shaken_vs_get_failure_action(), ast_stir_shaken_vs_get_use_rfc9410_responses(), PROCESS_FAILURE_CONTINUE, PROCESS_FAILURE_REJECT, PROCESS_FAILURE_SYSTEM_FAILURE, reject_incoming_call(), SCOPE_ENTER, SCOPE_EXIT_RTN_VALUE, session, sip_response_code_to_str(), stir_shaken_failure_action_CONTINUE_RETURN_REASON, stir_shaken_failure_action_REJECT_REQUEST, and vs_code_to_sip_code().
Referenced by stir_shaken_incoming_request().
|
static |
Definition at line 142 of file res_pjsip_stir_shaken.c.
References ast_hangup(), ast_sip_session_terminate(), and session.
Referenced by process_failure(), and stir_shaken_incoming_request().
|
static |
Definition at line 68 of file res_pjsip_stir_shaken.c.
References response_to_str, SIP_RESPONSE_CODE_BAD_IDENTITY_INFO, SIP_RESPONSE_CODE_INVALID_IDENTITY_HEADER, SIP_RESPONSE_CODE_OK, SIP_RESPONSE_CODE_STALE_DATE, SIP_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL, and SIP_RESPONSE_CODE_USE_IDENTITY_HEADER.
Referenced by process_failure().
|
static |
Definition at line 200 of file res_pjsip_stir_shaken.c.
References ao2_cleanup, ast_free, ast_sip_rdata_get_header_value(), ast_sip_session_get_name(), ast_stir_shaken_add_result_to_channel(), ast_stir_shaken_vs_ctx_add_date_hdr(), ast_stir_shaken_vs_ctx_add_identity_hdr(), ast_stir_shaken_vs_ctx_create(), AST_STIR_SHAKEN_VS_DISABLED, AST_STIR_SHAKEN_VS_NO_DATE_HDR, AST_STIR_SHAKEN_VS_NO_IDENTITY_HDR, AST_STIR_SHAKEN_VS_SUCCESS, ast_stir_shaken_vs_verify(), ast_strlen_zero(), date_hdr_str, identity_hdr_str, LOG_ERROR, NULL, process_failure(), PROCESS_FAILURE_CONTINUE, RAII_VAR, reject_incoming_call(), SCOPE_ENTER, SCOPE_EXIT_LOG_RTN_VALUE, SCOPE_EXIT_RTN_VALUE, and session.
|
static |
Definition at line 383 of file res_pjsip_stir_shaken.c.
References add_date_header(), add_fingerprints_if_present(), ao2_cleanup, ast_channel_connected_effective_id(), ast_channel_lock, ast_channel_unlock, ast_free, ast_party_id_copy(), ast_party_id_free(), ast_party_id_init(), ast_sip_can_present_connected_id(), ast_sip_session_get_name(), ast_stir_shaken_as_ctx_create(), AST_STIR_SHAKEN_AS_DISABLED, AST_STIR_SHAKEN_AS_SUCCESS, ast_stir_shaken_attest(), ast_trace, ast_stir_shaken_as_ctx::dest_tn, get_dest_tn(), identity_hdr_str, LOG_ERROR, NULL, ast_party_id::number, SCOPE_ENTER, SCOPE_EXIT_LOG, SCOPE_EXIT_LOG_RTN, SCOPE_EXIT_RTN, session, and ast_party_number::str.
|
static |
Definition at line 479 of file res_pjsip_stir_shaken.c.
References ast_sip_session_unregister_supplement(), and stir_shaken_supplement.
|
static |
Definition at line 87 of file res_pjsip_stir_shaken.c.
References SUCCESS, and translate_code.
Referenced by process_failure().
|
static |
Definition at line 500 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 500 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 40 of file res_pjsip_stir_shaken.c.
Referenced by add_date_header(), and stir_shaken_incoming_request().
|
static |
Definition at line 39 of file res_pjsip_stir_shaken.c.
Referenced by stir_shaken_incoming_request(), and stir_shaken_outgoing_request().
|
static |
Definition at line 472 of file res_pjsip_stir_shaken.c.
Referenced by load_module(), and unload_module().