52 .
type =
"rfc3329_store",
59 static const pj_str_t str_security_server = {
"Security-Server", 15 };
63 pjsip_generic_string_hdr *
header;
70 || !
session->inv_session->dlg) {
84 datastore->data = store_data;
87 ast_log(
AST_LOG_WARNING,
"Could not store session data. Still attempting requests, but they might be missing necessary headers.\n");
90 header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_security_server,
NULL);
92 header = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_security_server,
header->
next)) {
112 static const pj_str_t security_verify = {
"Security-Verify", 15 };
113 struct pjsip_generic_string_hdr *hdr =
NULL;
122 hdr = pjsip_msg_find_hdr_by_name(tdata->msg, &security_verify,
NULL);
124 if (contact_status ==
NULL) {
134 store_data = datastore->
data;
188 .
requires =
"res_pjsip,res_pjsip_session",
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_mansession session
#define ast_calloc(num, len)
A wrapper for calloc()
Internal Asterisk hangup causes.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
void ast_sip_unregister_supplement(struct ast_sip_supplement *supplement)
Unregister a an supplement to SIP out of dialog processing.
void ast_sip_register_supplement(struct ast_sip_supplement *supplement)
Register a supplement to SIP out of dialog processing.
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
int ast_sip_str_to_security_mechanism(struct ast_sip_security_mechanism **security_mechanism, const char *value)
Allocate a security mechanism from a string.
@ AST_SIP_SECURITY_NEG_MEDIASEC
struct ast_sip_contact_status * ast_sip_get_contact_status(const struct ast_sip_contact *contact)
Retrieve the current status for a contact.
int ast_sip_add_security_headers(struct ast_sip_security_mechanism_vector *security_mechanisms, const char *header_name, int add_qval, pjsip_tx_data *tdata)
Add security headers to transmission data.
static struct ast_sip_supplement rfc3329_options_supplement
static void rfc3329_options_request(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, struct pjsip_tx_data *tdata)
static const struct ast_datastore_info rfc3329_store_datastore
The channel datastore the module uses to store state.
static struct ast_sip_session_supplement rfc3329_supplement
static void add_outgoing_request_headers(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact, struct pjsip_tx_data *tdata, struct ast_datastore *datastore)
static void rfc3329_incoming_response(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
static void datastore_destroy_cb(void *data)
static void rfc3329_outgoing_request(struct ast_sip_session *session, struct pjsip_tx_data *tdata)
static int load_module(void)
static int unload_module(void)
struct ast_datastore * ast_sip_session_get_datastore(struct ast_sip_session *session, const char *name)
Retrieve a session datastore.
int ast_sip_session_add_datastore(struct ast_sip_session *session, struct ast_datastore *datastore)
Add a datastore to a SIP session.
#define ast_sip_session_register_supplement(supplement)
struct ast_datastore * ast_sip_session_alloc_datastore(const struct ast_datastore_info *info, const char *uid)
Alternative for ast_datastore_alloc()
void ast_sip_session_unregister_supplement(struct ast_sip_session_supplement *supplement)
Unregister a an supplement to SIP session processing.
char * ast_strsep(char **s, const char sep, uint32_t flags)
Act like strsep but ignore separators inside quotes.
char * ast_skip_blanks(const char *str)
Gets a pointer to the first non-whitespace character in a string.
Structure for a data store type.
Structure for a data store object.
An entity with which Asterisk communicates.
enum ast_sip_security_negotiation security_negotiation
struct ast_sip_security_mechanism_vector security_mechanisms
Structure representing a security mechanism as defined in RFC 3329.
A supplement to SIP message processing.
void(* incoming_response)(struct ast_sip_session *session, struct pjsip_rx_data *rdata)
Called on an incoming SIP response This method is always called from a SIP servant thread.
A structure describing a SIP session.
A supplement to SIP message processing.
Private data structure used with the modules's datastore.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.