Asterisk - The Open Source Telephony Project GIT-master-b023714
|
#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_ANONYMITY_DISALLOWED_STR "Anonymity Disallowed" |
#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 | 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_ANONYMITY_DISALLOWED = 433 , SIP_RESPONSE_CODE_BAD_IDENTITY_INFO = 436 , SIP_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL = 437 , SIP_RESPONSE_CODE_INVALID_IDENTITY_HEADER = 438 , 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 = ASTERISK_GPL_KEY , .buildopt_sum = AST_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 494 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_ANONYMITY_DISALLOWED_STR "Anonymity Disallowed" |
Definition at line 58 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 translate_code | ( | _vs_rc, | |
_sip_rc | |||
) |
Definition at line 84 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 138 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 502 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 502 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 370 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 306 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 502 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 341 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 487 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 151 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 144 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_ANONYMITY_DISALLOWED, 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 202 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_get_caller_id(), AST_STIR_SHAKEN_VS_INVALID_OR_NO_CID, 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 385 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 481 of file res_pjsip_stir_shaken.c.
References ast_sip_session_unregister_supplement(), and stir_shaken_supplement.
|
static |
Definition at line 88 of file res_pjsip_stir_shaken.c.
References SUCCESS, and translate_code.
Referenced by process_failure().
|
static |
Definition at line 502 of file res_pjsip_stir_shaken.c.
|
static |
Definition at line 502 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 474 of file res_pjsip_stir_shaken.c.
Referenced by load_module(), and unload_module().