Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjsip/sip_transaction.h>
#include <pj/timer.h>
#include <pjlib.h>
#include "asterisk/stringfields.h"
#include "asterisk/netsock2.h"
#include "asterisk/linkedlists.h"
#include "asterisk/channel.h"
#include "asterisk/sorcery.h"
#include "asterisk/dnsmgr.h"
#include "asterisk/endpoints.h"
#include "asterisk/udptl.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/vector.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/stasis_endpoints.h"
#include "asterisk/stream.h"
Go to the source code of this file.
Data Structures | |
struct | ast_sip_ami |
AMI variable container. More... | |
struct | ast_sip_aor |
A SIP address of record. More... | |
struct | ast_sip_auth |
struct | ast_sip_auth_objects_vector |
struct | ast_sip_auth_vector |
struct | ast_sip_authenticator |
An interchangeable way of handling digest authentication for SIP. More... | |
struct | ast_sip_body |
SIP body description. More... | |
struct | ast_sip_contact |
Contact associated with an address of record. More... | |
struct | ast_sip_contact_status |
A contact's status. More... | |
struct | ast_sip_contact_wrapper |
A wrapper for contact that adds the aor_id and a consistent contact id. Used by ast_sip_for_each_contact. More... | |
struct | ast_sip_direct_media_configuration |
Direct media options for SIP endpoints. More... | |
struct | ast_sip_domain_alias |
struct | ast_sip_endpoint |
An entity with which Asterisk communicates. More... | |
struct | ast_sip_endpoint_extensions |
Endpoint configuration for SIP extensions. More... | |
struct | ast_sip_endpoint_formatter |
An entity responsible formatting endpoint information. More... | |
struct | ast_sip_endpoint_id_configuration |
Party identification options for endpoints. More... | |
struct | ast_sip_endpoint_identifier |
An entity responsible for identifying the source of a SIP message. More... | |
struct | ast_sip_endpoint_info_configuration |
Endpoint configuration options for INFO packages. More... | |
struct | ast_sip_endpoint_media_configuration |
Media configuration for SIP endpoints. More... | |
struct | ast_sip_endpoint_nat_configuration |
NAT configuration options for endpoints. More... | |
struct | ast_sip_endpoint_pickup_configuration |
Call pickup configuration options for endpoints. More... | |
struct | ast_sip_endpoint_subscription_configuration |
Endpoint subscription configuration. More... | |
struct | ast_sip_identify_by_vector |
struct | ast_sip_info_recording_configuration |
Configuration for one-touch INFO recording. More... | |
struct | ast_sip_media_rtp_configuration |
RTP configuration for SIP endpoints. More... | |
struct | ast_sip_mwi_configuration |
Endpoint configuration for unsolicited MWI. More... | |
struct | ast_sip_nat_hook |
Structure for SIP nat hook information. More... | |
struct | ast_sip_outbound_authenticator |
an interchangeable way of responding to authentication challenges More... | |
struct | ast_sip_request_transport_details |
Structure which contains information about a transport. More... | |
struct | ast_sip_security_mechanism |
Structure representing a security mechanism as defined in RFC 3329. More... | |
struct | ast_sip_security_mechanism_vector |
struct | ast_sip_service_route_vector |
struct | ast_sip_supplement |
A supplement to SIP message processing. More... | |
struct | ast_sip_t38_configuration |
struct | ast_sip_timer_options |
Session timers options. More... | |
struct | ast_sip_tpmgr_state_callback |
struct | ast_sip_transport |
Transport to bind to. More... | |
struct | ast_sip_transport_state |
Structure for SIP transport information. More... | |
Macros | |
#define | AST_SIP_AUTH_MAX_REALM_LENGTH 255 /* From the auth/realm realtime column size */ |
#define | ast_sip_call_codec_pref_test(__param, __codec_pref) (!!(ast_test_flag( &__param, AST_SIP_CALL_CODEC_PREF_ ## __codec_pref ))) |
Returns true if the preference is set in the parameter. More... | |
#define | ast_sip_cleanup_auth_objects_vector(auth_objects) AST_VECTOR_RESET(auth_objects, ao2_cleanup) |
Clean up retrieved auth objects in vector. More... | |
#define | AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR(_transport, _dest) pj_sockaddr_print(&_transport->key.rem_addr, _dest, sizeof(_dest), 1); |
Fill a buffer with a pjsip transport's remote ip address and port. More... | |
#define | ast_sip_mod_data_get(mod_data, id, key) ast_sip_dict_get(mod_data[id], key) |
Using the dictionary stored in mod_data array at a given id, retrieve the value associated with the given key. More... | |
#define | ast_sip_mod_data_set(pool, mod_data, id, key, val) mod_data[id] = ast_sip_dict_set(pool, mod_data[id], key, val) |
Utilizing a mod_data array for a given id, set the value associated with the given key. More... | |
#define | ast_sip_transport_is_local(transport_state, addr) (transport_state->localnet && ast_apply_ha(transport_state->localnet, addr) != AST_SENSE_ALLOW) |
#define | ast_sip_transport_is_nonlocal(transport_state, addr) (!transport_state->localnet || ast_apply_ha(transport_state->localnet, addr) == AST_SENSE_ALLOW) |
#define | AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(str) |
Truncate the URI user field options string if enabled. More... | |
#define | AST_SIP_X_AST_TXP "x-ast-txp" |
#define | AST_SIP_X_AST_TXP_LEN 9 |
#define | COLON_PORT_STRLEN 6 |
#define | IP6ADDR_COLON_PORT_BUFLEN (PJ_INET6_ADDRSTRLEN + COLON_PORT_STRLEN) |
#define | MAX_RX_CHALLENGES 10 |
#define | PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)-1) |
#define | PJSIP_MINVERSION(m, n, p) (((m << 24) | (n << 16) | (p << 8)) >= PJ_VERSION_NUM) |
#define | PJSTR_PRINTF_SPEC "%.*s" |
#define | PJSTR_PRINTF_VAR(_v) ((int)(_v).slen), ((_v).ptr) |
#define | SIP_SORCERY_AUTH_TYPE "auth" |
#define | SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias" |
#define | SIP_TLS_MAX_CIPHERS 64 |
Maximum number of ciphers supported for a TLS transport. More... | |
Typedefs | |
typedef int(* | ast_sip_dialog_outbound_auth_cb) (pjsip_dialog *dlg, pjsip_tx_data *tdata, void *user_data) |
Callback called when an outbound request with authentication credentials is to be sent in dialog. More... | |
typedef int(* | ast_sip_task) (void *user_data) |
typedef int(* | ast_transport_monitor_data_matcher) (void *a, void *b) |
Transport shutdown monitor data matcher. More... | |
typedef void(* | ast_transport_monitor_shutdown_cb) (void *data) |
Transport shutdown monitor callback. More... | |
Functions | |
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. More... | |
int | ast_copy_pj_str2 (char **dest, const pj_str_t *src) |
Create and copy a pj_str_t into a standard character buffer. More... | |
struct ast_sip_endpoint * | ast_pjsip_rdata_get_endpoint (pjsip_rx_data *rdata) |
Get the looked-up endpoint on an out-of dialog request or response. More... | |
int | ast_sip_add_body (pjsip_tx_data *tdata, const struct ast_sip_body *body) |
Add a body to an outbound SIP message. More... | |
int | ast_sip_add_body_multipart (pjsip_tx_data *tdata, const struct ast_sip_body *bodies[], int num_bodies) |
Add a multipart body to an outbound SIP message. More... | |
void | ast_sip_add_date_header (pjsip_tx_data *tdata) |
Adds a Date header to the tdata, formatted like: Date: Wed, 01 Jan 2021 14:53:01 GMT. More... | |
int | ast_sip_add_global_request_header (const char *name, const char *value, int replace) |
int | ast_sip_add_global_response_header (const char *name, const char *value, int replace) |
int | ast_sip_add_header (pjsip_tx_data *tdata, const char *name, const char *value) |
Add a header to an outbound SIP message. More... | |
pjsip_generic_string_hdr * | ast_sip_add_header2 (pjsip_tx_data *tdata, const char *name, const char *value) |
Add a header to an outbound SIP message, returning a pointer to the header. More... | |
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. More... | |
void | ast_sip_add_usereqphone (const struct ast_sip_endpoint *endpoint, pj_pool_t *pool, pjsip_uri *uri) |
Add 'user=phone' parameter to URI if enabled and user is a phone number. More... | |
int | ast_sip_append_body (pjsip_tx_data *tdata, const char *body_text) |
Append body data to a SIP message. More... | |
int | ast_sip_are_media_types_equal (pjsip_media_type *a, pjsip_media_type *b) |
Compare pjsip media types. More... | |
const char * | ast_sip_auth_type_to_str (enum ast_sip_auth_type type) |
Converts the given auth type to a string. More... | |
void | ast_sip_auth_vector_destroy (struct ast_sip_auth_vector *vector) |
Free contents of an auth vector. More... | |
int | ast_sip_auth_vector_init (struct ast_sip_auth_vector *vector, const char *auth_names) |
Initialize an auth vector with the configured values. More... | |
int | ast_sip_auths_to_str (const struct ast_sip_auth_vector *auths, char **buf) |
Converts an auths array to a string of comma separated values. More... | |
const char * | ast_sip_call_codec_pref_to_str (struct ast_flags pref) |
Convert the call codec preference flags to a string. More... | |
int | ast_sip_call_codec_str_to_pref (struct ast_flags *pref, const char *pref_str, int is_outgoing) |
Convert a call codec preference string to preference flags. More... | |
enum ast_sip_check_auth_result | ast_sip_check_authentication (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pjsip_tx_data *tdata) |
Method to determine authentication status of an incoming request. More... | |
void | ast_sip_cleanup_auths (struct ast_sip_auth *auths[], size_t num_auths) |
Clean up retrieved auth structures from memory. More... | |
int | ast_sip_contact_to_str (void *object, void *arg, int flags) |
Handler used to convert a contact to a string. More... | |
struct ast_str * | ast_sip_create_ami_event (const char *event, struct ast_sip_ami *ami) |
Creates a string to store AMI event data in. More... | |
pjsip_dialog * | ast_sip_create_dialog_uac (const struct ast_sip_endpoint *endpoint, const char *aor_name, const char *request_user) |
General purpose method for creating a UAC dialog with an endpoint. More... | |
pjsip_dialog * | ast_sip_create_dialog_uas (const struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pj_status_t *status) |
General purpose method for creating a UAS dialog with an endpoint. More... | |
pjsip_dialog * | ast_sip_create_dialog_uas_locked (const struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pj_status_t *status) |
General purpose method for creating a UAS dialog with an endpoint. More... | |
int | ast_sip_create_rdata (pjsip_rx_data *rdata, char *packet, const char *src_name, int src_port, char *transport_type, const char *local_name, int local_port) |
General purpose method for creating an rdata structure using specific information. More... | |
int | ast_sip_create_rdata_with_contact (pjsip_rx_data *rdata, char *packet, const char *src_name, int src_port, char *transport_type, const char *local_name, int local_port, const char *contact_uri) |
General purpose method for creating an rdata structure using specific information. More... | |
int | ast_sip_create_request (const char *method, struct pjsip_dialog *dlg, struct ast_sip_endpoint *endpoint, const char *uri, struct ast_sip_contact *contact, pjsip_tx_data **tdata) |
General purpose method for creating a SIP request. More... | |
int | ast_sip_create_request_with_auth (const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge, pjsip_tx_data *tdata, pjsip_tx_data **new_request) |
Create a response to an authentication challenge. More... | |
int | ast_sip_create_response (const pjsip_rx_data *rdata, int st_code, struct ast_sip_contact *contact, pjsip_tx_data **p_tdata) |
General purpose method for creating a SIP response. More... | |
struct ast_taskprocessor * | ast_sip_create_serializer (const char *name) |
Create a new serializer for SIP tasks. More... | |
struct ast_taskprocessor * | ast_sip_create_serializer_group (const char *name, struct ast_serializer_shutdown_group *shutdown_group) |
Create a new serializer for SIP tasks. More... | |
struct ast_sip_endpoint * | ast_sip_default_outbound_endpoint (void) |
Retrieve the default outbound endpoint. More... | |
struct ast_sip_endpoint * | ast_sip_dialog_get_endpoint (pjsip_dialog *dlg) |
Get the endpoint associated with this dialog. More... | |
void | ast_sip_dialog_set_endpoint (pjsip_dialog *dlg, struct ast_sip_endpoint *endpoint) |
Set an endpoint on a SIP dialog so in-dialog requests do not undergo endpoint lookup. More... | |
void | ast_sip_dialog_set_serializer (pjsip_dialog *dlg, struct ast_taskprocessor *serializer) |
Set a serializer on a SIP dialog so requests and responses are automatically serialized. More... | |
int | ast_sip_dialog_setup_outbound_authentication (pjsip_dialog *dlg, const struct ast_sip_endpoint *endpoint, ast_sip_dialog_outbound_auth_cb cb, void *user_data) |
Set up outbound authentication on a SIP dialog. More... | |
void * | ast_sip_dict_get (void *ht, const char *key) |
Retrieves the value associated with the given key. More... | |
void * | ast_sip_dict_set (pj_pool_t *pool, void *ht, const char *key, void *val) |
Set the value for the given key. More... | |
int | ast_sip_dlg_set_transport (const struct ast_sip_endpoint *endpoint, pjsip_dialog *dlg, pjsip_tpselector *selector) |
Set the transport on a dialog. More... | |
int | ast_sip_dtmf_to_str (const enum ast_sip_dtmf_mode dtmf, char *buf, size_t buf_len) |
Convert the DTMF mode enum value into a string. More... | |
void * | ast_sip_endpoint_alloc (const char *name) |
Allocate a new SIP endpoint. More... | |
int | ast_sip_failover_request (pjsip_tx_data *tdata) |
Set a request to use the next value in the list of resolved addresses. More... | |
struct ast_sip_transport_state * | ast_sip_find_transport_state_in_use (struct ast_sip_request_transport_details *details) |
Returns the transport state currently in use based on request transport details. More... | |
int | ast_sip_for_each_aor (const char *aors, ao2_callback_fn on_aor, void *arg) |
For every aor in the comma separated aors string call the given 'on_aor' handler. More... | |
int | ast_sip_for_each_auth (const struct ast_sip_auth_vector *array, ao2_callback_fn on_auth, void *arg) |
For every auth in the array call the given 'on_auth' handler. More... | |
int | ast_sip_for_each_channel (const struct ast_sip_endpoint *endpoint, ao2_callback_fn on_channel_snapshot, void *arg) |
For every channel snapshot on an endpoint all the given 'on_channel_snapshot' handler. More... | |
int | ast_sip_for_each_channel_snapshot (const struct ast_endpoint_snapshot *endpoint_snapshot, ao2_callback_fn on_channel_snapshot, void *arg) |
For every channel snapshot on an endpoint snapshot call the given 'on_channel_snapshot' handler. More... | |
int | ast_sip_for_each_contact (const struct ast_sip_aor *aor, ao2_callback_fn on_contact, void *arg) |
For every contact on an AOR call the given 'on_contact' handler. More... | |
int | ast_sip_format_auths_ami (const struct ast_sip_auth_vector *auths, struct ast_sip_ami *ami) |
Format auth details for AMI. More... | |
int | ast_sip_format_contact_ami (void *obj, void *arg, int flags) |
Formats the contact and sends over AMI. More... | |
int | ast_sip_format_endpoint_ami (struct ast_sip_endpoint *endpoint, struct ast_sip_ami *ami, int *count) |
Formats the endpoint and sends over AMI. More... | |
unsigned int | ast_sip_get_all_codecs_on_empty_reinvite (void) |
Retrieve the system setting 'all_codecs_on_empty_reinvite'. More... | |
unsigned int | ast_sip_get_allow_sending_180_after_183 (void) |
Retrieve the global setting 'allow_sending_180_after_183'. More... | |
struct ast_sip_auth * | ast_sip_get_artificial_auth (void) |
Retrieves a reference to the artificial auth. More... | |
struct ast_sip_endpoint * | ast_sip_get_artificial_endpoint (void) |
Retrieves a reference to the artificial endpoint. More... | |
unsigned int | ast_sip_get_contact_expiration_check_interval (void) |
Retrieve the system contact expiration check interval setting. More... | |
const char * | ast_sip_get_contact_short_status_label (const enum ast_sip_contact_status_type status) |
pjsip_sip_uri * | ast_sip_get_contact_sip_uri (pjsip_tx_data *tdata) |
Return the SIP URI of the Contact header. More... | |
struct ast_sip_contact_status * | ast_sip_get_contact_status (const struct ast_sip_contact *contact) |
Retrieve the current status for a contact. More... | |
const char * | ast_sip_get_contact_status_label (const enum ast_sip_contact_status_type status) |
translate ast_sip_contact_status_type to character string. More... | |
char * | ast_sip_get_debug (void) |
Retrieve the system debug setting (yes|no|host). More... | |
void | ast_sip_get_default_from_user (char *from_user, size_t size) |
Retrieve the global default from user. More... | |
void | ast_sip_get_default_realm (char *realm, size_t size) |
Retrieve the global default realm. More... | |
char * | ast_sip_get_default_voicemail_extension (void) |
Retrieve the default voicemail extension. More... | |
const char * | ast_sip_get_device_state (const struct ast_sip_endpoint *endpoint) |
Retrieve the device state for an endpoint. More... | |
unsigned int | ast_sip_get_disable_multi_domain (void) |
Retrieve the system setting 'disable multi domain'. More... | |
struct ast_taskprocessor * | ast_sip_get_distributor_serializer (pjsip_rx_data *rdata) |
Determine the distributor serializer for the SIP message. More... | |
struct ast_sip_endpoint * | ast_sip_get_endpoint (const char *to, int get_default_outbound, char **uri) |
Retrieves an endpoint and URI from the "to" string. More... | |
char * | ast_sip_get_endpoint_identifier_order (void) |
Retrieve the global endpoint_identifier_order setting. More... | |
struct ast_endpoint_snapshot * | ast_sip_get_endpoint_snapshot (const struct ast_sip_endpoint *endpoint) |
Retrieve the endpoint snapshot for an endpoint. More... | |
struct ao2_container * | ast_sip_get_endpoints (void) |
Retrieve any endpoints available to sorcery. More... | |
int | ast_sip_get_host_ip (int af, pj_sockaddr *addr) |
Retrieve the local host address in IP form. More... | |
const char * | ast_sip_get_host_ip_string (int af) |
Retrieve the local host address in string form. More... | |
unsigned int | ast_sip_get_ignore_uri_user_options (void) |
Retrieve the global setting 'ignore_uri_user_options'. More... | |
unsigned int | ast_sip_get_keep_alive_interval (void) |
Retrieve the system keep alive interval setting. More... | |
unsigned int | ast_sip_get_max_initial_qualify_time (void) |
Retrieve the system max initial qualify time. More... | |
unsigned int | ast_sip_get_mwi_disable_initial_unsolicited (void) |
Retrieve the global setting 'disable sending unsolicited mwi on startup'. More... | |
unsigned int | ast_sip_get_mwi_tps_queue_high (void) |
Retrieve the global MWI taskprocessor high water alert trigger level. More... | |
int | ast_sip_get_mwi_tps_queue_low (void) |
Retrieve the global MWI taskprocessor low water clear alert level. More... | |
unsigned int | ast_sip_get_norefersub (void) |
Retrieve the global setting 'norefersub'. More... | |
pjsip_endpoint * | ast_sip_get_pjsip_endpoint (void) |
Get a pointer to the PJSIP endpoint. More... | |
char * | ast_sip_get_regcontext (void) |
Retrieve the global regcontext setting. More... | |
unsigned int | ast_sip_get_send_contact_status_on_update_registration (void) |
Retrieve the global setting 'send_contact_status_on_update_registration'. More... | |
struct ast_sorcery * | ast_sip_get_sorcery (void) |
Get a pointer to the SIP sorcery structure. More... | |
int | ast_sip_get_transport_name (const struct ast_sip_endpoint *endpoint, pjsip_sip_uri *sip_uri, char *buf, size_t buf_len) |
Get the transport name from an endpoint or request uri. More... | |
struct ast_sip_transport_state * | ast_sip_get_transport_state (const char *transport_id) |
Retrieve transport state. More... | |
struct ao2_container * | ast_sip_get_transport_states (void) |
Retrieves all transport states. More... | |
void | ast_sip_get_unidentified_request_thresholds (unsigned int *count, unsigned int *period, unsigned int *prune_interval) |
Retrieve the unidentified request security event thresholds. More... | |
unsigned int | ast_sip_get_use_callerid_contact (void) |
Retrieve the global setting 'use_callerid_contact'. More... | |
const int | ast_sip_hangup_sip2cause (int cause) |
Convert SIP hangup causes to Asterisk hangup causes. More... | |
void | ast_sip_header_to_security_mechanism (const pjsip_generic_string_hdr *hdr, struct ast_sip_security_mechanism_vector *security_mechanisms) |
Append to security mechanism vector from SIP header. More... | |
struct ast_sip_endpoint * | ast_sip_identify_endpoint (pjsip_rx_data *rdata) |
Determine the endpoint that has sent a SIP message. More... | |
int | ast_sip_is_allowed_uri (pjsip_uri *uri) |
Check whether a pjsip_uri is allowed or not. More... | |
int | ast_sip_is_content_type (pjsip_media_type *content_type, char *type, char *subtype) |
Checks if the given content type matches type/subtype. More... | |
int | ast_sip_is_media_type_in (pjsip_media_type *a,...) attribute_sentinel |
Check if a media type is in a list of others. More... | |
int | ast_sip_is_uri_sip_sips (pjsip_uri *uri) |
Check whether a pjsip_uri is SIP/SIPS or not. More... | |
int | ast_sip_location_add_contact (struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint) |
Add a new contact to an AOR. More... | |
int | ast_sip_location_add_contact_nolock (struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint) |
Add a new contact to an AOR without locking the AOR. More... | |
struct ast_sip_contact * | ast_sip_location_create_contact (struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, int prune_on_boot, struct ast_sip_endpoint *endpoint) |
Create a new contact for an AOR without locking the AOR. More... | |
int | ast_sip_location_delete_contact (struct ast_sip_contact *contact) |
Delete a contact. More... | |
void | ast_sip_location_prune_boot_contacts (void) |
Prune the prune_on_boot contacts. More... | |
struct ast_sip_aor * | ast_sip_location_retrieve_aor (const char *aor_name) |
Retrieve a named AOR. More... | |
struct ao2_container * | ast_sip_location_retrieve_aor_contacts (const struct ast_sip_aor *aor) |
Retrieve all contacts currently available for an AOR. More... | |
struct ao2_container * | ast_sip_location_retrieve_aor_contacts_filtered (const struct ast_sip_aor *aor, unsigned int flags) |
Retrieve all contacts currently available for an AOR and filter based on flags. More... | |
struct ao2_container * | ast_sip_location_retrieve_aor_contacts_nolock (const struct ast_sip_aor *aor) |
Retrieve all contacts currently available for an AOR without locking the AOR. More... | |
struct ao2_container * | ast_sip_location_retrieve_aor_contacts_nolock_filtered (const struct ast_sip_aor *aor, unsigned int flags) |
Retrieve all contacts currently available for an AOR without locking the AOR and filter based on flags. More... | |
struct ast_sip_contact * | ast_sip_location_retrieve_contact (const char *contact_name) |
Retrieve a named contact. More... | |
void | ast_sip_location_retrieve_contact_and_aor_from_list (const char *aor_list, struct ast_sip_aor **aor, struct ast_sip_contact **contact) |
Retrieve the first bound contact AND the AOR chosen from a list of AORs. More... | |
void | ast_sip_location_retrieve_contact_and_aor_from_list_filtered (const char *aor_list, unsigned int flags, struct ast_sip_aor **aor, struct ast_sip_contact **contact) |
Retrieve the first bound contact AND the AOR chosen from a list of AORs and filter based on flags. More... | |
struct ast_sip_contact * | ast_sip_location_retrieve_contact_from_aor_list (const char *aor_list) |
Retrieve the first bound contact from a list of AORs. More... | |
struct ao2_container * | ast_sip_location_retrieve_contacts_from_aor_list (const char *aor_list) |
Retrieve all contacts from a list of AORs. More... | |
struct ast_sip_contact * | ast_sip_location_retrieve_first_aor_contact (const struct ast_sip_aor *aor) |
Retrieve the first bound contact for an AOR. More... | |
struct ast_sip_contact * | ast_sip_location_retrieve_first_aor_contact_filtered (const struct ast_sip_aor *aor, unsigned int flags) |
Retrieve the first bound contact for an AOR and filter based on flags. More... | |
int | ast_sip_location_update_contact (struct ast_sip_contact *contact) |
Update a contact. More... | |
void | ast_sip_message_apply_transport (const char *transport_name, pjsip_tx_data *tdata) |
Apply the configuration for a transport to an outgoing message. More... | |
void | ast_sip_modify_id_header (pj_pool_t *pool, pjsip_fromto_hdr *id_hdr, const struct ast_party_id *id) |
Set name and number information on an identity header. More... | |
void | ast_sip_persistent_endpoint_publish_contact_state (const char *endpoint_name, const struct ast_sip_contact_status *contact_status) |
Publish the change of state for a contact. More... | |
int | ast_sip_persistent_endpoint_update_state (const char *endpoint_name, enum ast_endpoint_state state) |
Change state of a persistent endpoint. More... | |
const pj_str_t * | ast_sip_pjsip_uri_get_hostname (pjsip_uri *uri) |
Get the host portion of the pjsip_uri. More... | |
struct pjsip_param * | ast_sip_pjsip_uri_get_other_param (pjsip_uri *uri, const pj_str_t *param_str) |
Find an 'other' SIP/SIPS URI parameter by name. More... | |
const pj_str_t * | ast_sip_pjsip_uri_get_username (pjsip_uri *uri) |
Get the user portion of the pjsip_uri. More... | |
int | ast_sip_push_task (struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data) |
Pushes a task to SIP servants. More... | |
int | ast_sip_push_task_synchronous (struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data) |
Push a task to SIP servants and wait for it to complete. More... | |
int | ast_sip_push_task_wait_serializer (struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data) |
Push a task to the serializer and wait for it to complete. More... | |
int | ast_sip_push_task_wait_servant (struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data) |
Push a task to SIP servants and wait for it to complete. More... | |
char * | ast_sip_rdata_get_header_value (pjsip_rx_data *rdata, const pj_str_t str) |
Get a specific header value from rdata. More... | |
int | ast_sip_register_authenticator (struct ast_sip_authenticator *auth) |
Register a SIP authenticator. More... | |
void | ast_sip_register_endpoint_formatter (struct ast_sip_endpoint_formatter *obj) |
Register an endpoint formatter. More... | |
int | ast_sip_register_endpoint_identifier (struct ast_sip_endpoint_identifier *identifier) |
Register a SIP endpoint identifier. More... | |
int | ast_sip_register_endpoint_identifier_with_name (struct ast_sip_endpoint_identifier *identifier, const char *name) |
Register a SIP endpoint identifier with a name. More... | |
int | ast_sip_register_outbound_authenticator (struct ast_sip_outbound_authenticator *outbound_auth) |
Register an outbound SIP authenticator. More... | |
int | ast_sip_register_service (pjsip_module *module) |
Register a SIP service in Asterisk. More... | |
void | ast_sip_register_supplement (struct ast_sip_supplement *supplement) |
Register a supplement to SIP out of dialog processing. More... | |
void | ast_sip_remove_headers_by_name_and_value (pjsip_msg *msg, const pj_str_t *hdr_name, const char *value) |
Removes all headers of a specific name and value from a pjsip_msg. More... | |
void | ast_sip_report_auth_challenge_sent (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pjsip_tx_data *tdata) |
Send a security event notification for when an authentication challenge is sent. More... | |
void | ast_sip_report_auth_failed_challenge_response (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when a challenge response has failed. More... | |
void | ast_sip_report_auth_success (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when authentication succeeds. More... | |
void | ast_sip_report_failed_acl (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *name) |
Send a security event notification for when an ACL check fails. More... | |
void | ast_sip_report_invalid_endpoint (const char *name, pjsip_rx_data *rdata) |
Send a security event notification for when an invalid endpoint is requested. More... | |
void | ast_sip_report_mem_limit (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Send a security event notification for when a memory limit is hit. More... | |
void | ast_sip_report_req_no_support (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *req_type) |
Send a security event notification for when a request is not supported. More... | |
int | ast_sip_requires_authentication (struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
Determine if an incoming request requires authentication. More... | |
int | ast_sip_retrieve_auths (const struct ast_sip_auth_vector *auths, struct ast_sip_auth **out) |
Retrieve relevant SIP auth structures from sorcery. More... | |
int | ast_sip_retrieve_auths_vector (const struct ast_sip_auth_vector *auth_ids, struct ast_sip_auth_objects_vector *auth_objects) |
Retrieve relevant SIP auth structures from sorcery as a vector. More... | |
int | ast_sip_rewrite_uri_to_local (pjsip_sip_uri *uri, pjsip_tx_data *tdata) |
Replace domain and port of SIP URI to point to (external) signaling address of this Asterisk instance. More... | |
int | ast_sip_sched_is_task_running (struct ast_sip_sched_task *schtd) |
Checks if the task is currently running. More... | |
int | ast_sip_sched_is_task_running_by_name (const char *name) |
Checks if the task is currently running. More... | |
int | ast_sip_sched_task_cancel (struct ast_sip_sched_task *schtd) |
Cancels the next invocation of a task. More... | |
int | ast_sip_sched_task_cancel_by_name (const char *name) |
Cancels the next invocation of a task by name. More... | |
int | ast_sip_sched_task_get_name (struct ast_sip_sched_task *schtd, char *name, size_t maxlen) |
Gets the task name. More... | |
int | ast_sip_sched_task_get_next_run (struct ast_sip_sched_task *schtd) |
Gets the number of milliseconds until the next invocation. More... | |
int | ast_sip_sched_task_get_next_run_by_name (const char *name) |
Gets the number of milliseconds until the next invocation. More... | |
int | ast_sip_sched_task_get_times (struct ast_sip_sched_task *schtd, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end) |
Gets the last start and end times of the task. More... | |
int | ast_sip_sched_task_get_times2 (struct ast_sip_sched_task *schtd, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start) |
Gets the queued, last start, last_end, time left, interval, next run. More... | |
int | ast_sip_sched_task_get_times_by_name (const char *name, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end) |
Gets the last start and end times of the task by name. More... | |
int | ast_sip_sched_task_get_times_by_name2 (const char *name, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start) |
Gets the queued, last start, last_end, time left, interval, next run by task name. More... | |
struct ast_sip_sched_task * | ast_sip_schedule_task (struct ast_taskprocessor *serializer, int interval, ast_sip_task sip_task, const char *name, void *task_data, enum ast_sip_scheduler_task_flags flags) |
Schedule a task to run in the res_pjsip thread pool. More... | |
int | ast_sip_security_mechanism_vector_init (struct ast_sip_security_mechanism_vector *security_mechanism, const char *value) |
Initialize security mechanism vector from string of security mechanisms. More... | |
int | ast_sip_security_mechanisms_to_str (const struct ast_sip_security_mechanism_vector *security_mechanisms, int add_qvalue, char **buf) |
Writes the security mechanisms of an endpoint into a buffer as a string and returns the buffer. More... | |
void | ast_sip_security_mechanisms_vector_copy (struct ast_sip_security_mechanism_vector *dst, const struct ast_sip_security_mechanism_vector *src) |
Duplicate a security mechanism. More... | |
void | ast_sip_security_mechanisms_vector_destroy (struct ast_sip_security_mechanism_vector *security_mechanisms) |
Free contents of a security mechanism vector. More... | |
int | ast_sip_send_out_of_dialog_request (pjsip_tx_data *tdata, struct ast_sip_endpoint *endpoint, int timeout, void *token, void(*callback)(void *token, pjsip_event *e)) |
General purpose method for sending an Out-Of-Dialog SIP request. More... | |
int | ast_sip_send_request (pjsip_tx_data *tdata, struct pjsip_dialog *dlg, struct ast_sip_endpoint *endpoint, void *token, void(*callback)(void *token, pjsip_event *e)) |
General purpose method for sending a SIP request. More... | |
int | ast_sip_send_response (pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint) |
Send a response to an out of dialog request. More... | |
int | ast_sip_send_stateful_response (pjsip_rx_data *rdata, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint) |
Send a stateful response to an out of dialog request. More... | |
struct ast_sip_service_route_vector * | ast_sip_service_route_vector_alloc (void) |
Allocate a vector of service routes. More... | |
void | ast_sip_service_route_vector_destroy (struct ast_sip_service_route_vector *service_routes) |
Destroy a vector of service routes. More... | |
int | ast_sip_set_id_connected_line (struct pjsip_rx_data *rdata, struct ast_party_id *id) |
Set the ID for a connected line update. More... | |
int | ast_sip_set_id_from_invite (struct pjsip_rx_data *rdata, struct ast_party_id *id, struct ast_party_id *default_id, int trust_inbound) |
Set the ID from an INVITE. More... | |
int | ast_sip_set_outbound_proxy (pjsip_tx_data *tdata, const char *proxy) |
Set the outbound proxy for an outbound SIP message. More... | |
int | ast_sip_set_request_transport_details (struct ast_sip_request_transport_details *details, pjsip_tx_data *tdata, int use_ipv6) |
Sets request transport details based on tdata. More... | |
int | ast_sip_set_security_negotiation (enum ast_sip_security_negotiation *security_negotiation, const char *val) |
Set the security negotiation based on a given string. More... | |
int | ast_sip_set_tpselector_from_ep_or_uri (const struct ast_sip_endpoint *endpoint, pjsip_sip_uri *sip_uri, pjsip_tpselector *selector) |
Sets pjsip_tpselector from an endpoint or uri. More... | |
int | ast_sip_set_tpselector_from_transport (const struct ast_sip_transport *transport, pjsip_tpselector *selector) |
Sets pjsip_tpselector from ast_sip_transport. More... | |
int | ast_sip_set_tpselector_from_transport_name (const char *transport_name, pjsip_tpselector *selector) |
Sets pjsip_tpselector from ast_sip_transport. More... | |
int | ast_sip_sorcery_object_to_ami (const void *obj, struct ast_str **buf) |
Converts a sorcery object to a string of object properties. More... | |
int | ast_sip_str2rc (const char *name) |
Convert name to SIP response code. More... | |
int | ast_sip_str_to_dtmf (const char *dtmf_mode) |
Convert the DTMF mode name into an enum. More... | |
int | ast_sip_str_to_security_mechanism (struct ast_sip_security_mechanism **security_mechanism, const char *value) |
Allocate a security mechanism from a string. More... | |
int | ast_sip_thread_is_servant (void) |
Determine if the current thread is a SIP servant thread. More... | |
struct ast_threadpool * | ast_sip_threadpool (void) |
Retrieve the SIP threadpool object. More... | |
long | ast_sip_threadpool_queue_size (void) |
Return the size of the SIP threadpool's task queue. More... | |
void | ast_sip_tpselector_unref (pjsip_tpselector *selector) |
Unreference a pjsip_tpselector. More... | |
enum ast_transport_monitor_reg | ast_sip_transport_monitor_register (pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *ao2_data) |
Register a reliable transport shutdown monitor callback. More... | |
enum ast_transport_monitor_reg | ast_sip_transport_monitor_register_key (const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *ao2_data) |
Register a reliable transport shutdown monitor callback. More... | |
enum ast_transport_monitor_reg | ast_sip_transport_monitor_register_replace (pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *ao2_data, ast_transport_monitor_data_matcher matches) |
Register a reliable transport shutdown monitor callback replacing any duplicate. More... | |
enum ast_transport_monitor_reg | ast_sip_transport_monitor_register_replace_key (const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *ao2_data, ast_transport_monitor_data_matcher matches) |
Register a reliable transport shutdown monitor callback replacing any duplicate. More... | |
void | ast_sip_transport_monitor_unregister (pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches) |
Unregister a reliable transport shutdown monitor. More... | |
void | ast_sip_transport_monitor_unregister_all (ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches) |
Unregister a transport shutdown monitor from all reliable transports. More... | |
void | ast_sip_transport_monitor_unregister_key (const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches) |
Unregister a reliable transport shutdown monitor. More... | |
void | ast_sip_transport_state_register (struct ast_sip_tpmgr_state_callback *element) |
Register a transport state notification callback element. More... | |
int | ast_sip_transport_state_set_preferred_identity (const char *transport_name, const char *identity) |
Sets the P-Preferred-Identity on a child transport. More... | |
int | ast_sip_transport_state_set_service_routes (const char *transport_name, struct ast_sip_service_route_vector *service_routes) |
Sets the service routes on a child transport. More... | |
int | ast_sip_transport_state_set_transport (const char *transport_name, pjsip_transport *transport) |
Sets the PJSIP transport on a child transport. More... | |
void | ast_sip_transport_state_unregister (struct ast_sip_tpmgr_state_callback *element) |
Unregister a transport state notification callback element. More... | |
void | ast_sip_unregister_authenticator (struct ast_sip_authenticator *auth) |
Unregister a SIP authenticator. More... | |
void | ast_sip_unregister_endpoint_formatter (struct ast_sip_endpoint_formatter *obj) |
Unregister an endpoint formatter. More... | |
void | ast_sip_unregister_endpoint_identifier (struct ast_sip_endpoint_identifier *identifier) |
Unregister a SIP endpoint identifier. More... | |
void | ast_sip_unregister_outbound_authenticator (struct ast_sip_outbound_authenticator *auth) |
Unregister an outbound SIP authenticator. More... | |
void | ast_sip_unregister_service (pjsip_module *module) |
void | ast_sip_unregister_supplement (struct ast_sip_supplement *supplement) |
Unregister a an supplement to SIP out of dialog processing. More... | |
int | ast_sip_update_from (pjsip_tx_data *tdata, char *from) |
Overwrite fields in the outbound 'From' header. More... | |
int | ast_sip_update_to_uri (pjsip_tx_data *tdata, const char *to) |
Replace the To URI in the tdata with the supplied one. More... | |
Variables | |
static const pj_str_t | AST_PJ_STR_EMPTY = { "", 0 } |
pjsip_media_type | pjsip_media_type_application_cpim_xpidf_xml |
pjsip_media_type | pjsip_media_type_application_json |
pjsip_media_type | pjsip_media_type_application_media_control_xml |
pjsip_media_type | pjsip_media_type_application_pidf_xml |
pjsip_media_type | pjsip_media_type_application_rlmi_xml |
pjsip_media_type | pjsip_media_type_application_sdp |
pjsip_media_type | pjsip_media_type_application_simple_message_summary |
pjsip_media_type | pjsip_media_type_application_xpidf_xml |
pjsip_media_type | pjsip_media_type_multipart_alternative |
pjsip_media_type | pjsip_media_type_multipart_mixed |
pjsip_media_type | pjsip_media_type_multipart_related |
pjsip_media_type | pjsip_media_type_text_plain |
#define AST_SIP_AUTH_MAX_REALM_LENGTH 255 /* From the auth/realm realtime column size */ |
Definition at line 74 of file res_pjsip.h.
#define ast_sip_call_codec_pref_test | ( | __param, | |
__codec_pref | |||
) | (!!(ast_test_flag( &__param, AST_SIP_CALL_CODEC_PREF_ ## __codec_pref ))) |
Returns true if the preference is set in the parameter.
__param | A ast_flags struct with one or more of enum ast_sip_call_codec_pref set |
__codec_pref | The last component of one of the enum values |
1 | if the enum value is set |
0 | if not |
Definition at line 694 of file res_pjsip.h.
#define ast_sip_cleanup_auth_objects_vector | ( | auth_objects | ) | AST_VECTOR_RESET(auth_objects, ao2_cleanup) |
Clean up retrieved auth objects in vector.
Call this function once you have completed operating on auths retrieved from ast_sip_retrieve_auths_vector. All auth objects will have their reference counts decremented and the vector size will be reset to 0. You must still call AST_VECTOR_FREE() on the vector itself.
auth_objects | A vector of auth structures to clean up |
Definition at line 2847 of file res_pjsip.h.
#define AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR | ( | _transport, | |
_dest | |||
) | pj_sockaddr_print(&_transport->key.rem_addr, _dest, sizeof(_dest), 1); |
Fill a buffer with a pjsip transport's remote ip address and port.
_transport | The pjsip_transport to use |
_dest | The destination buffer of at least IP6ADDR_COLON_PORT_BUFLEN bytes |
Definition at line 90 of file res_pjsip.h.
#define ast_sip_mod_data_get | ( | mod_data, | |
id, | |||
key | |||
) | ast_sip_dict_get(mod_data[id], key) |
Using the dictionary stored in mod_data array at a given id, retrieve the value associated with the given key.
mod_data | a module data array |
id | the mod_data array index |
key | the key to find |
the | value associated with the key, NULL otherwise. |
Definition at line 2947 of file res_pjsip.h.
#define ast_sip_mod_data_set | ( | pool, | |
mod_data, | |||
id, | |||
key, | |||
val | |||
) | mod_data[id] = ast_sip_dict_set(pool, mod_data[id], key, val) |
Utilizing a mod_data array for a given id, set the value associated with the given key.
For a given structure's mod_data array set the element indexed by id to be a dictionary containing the key/val pair.
pool | a memory allocation pool |
mod_data | a module data array |
id | the mod_data array index |
key | the key to find |
val | the value to associate with a key |
Definition at line 2979 of file res_pjsip.h.
#define ast_sip_transport_is_local | ( | transport_state, | |
addr | |||
) | (transport_state->localnet && ast_apply_ha(transport_state->localnet, addr) != AST_SENSE_ALLOW) |
Definition at line 212 of file res_pjsip.h.
#define ast_sip_transport_is_nonlocal | ( | transport_state, | |
addr | |||
) | (!transport_state->localnet || ast_apply_ha(transport_state->localnet, addr) == AST_SENSE_ALLOW) |
Definition at line 209 of file res_pjsip.h.
#define AST_SIP_USER_OPTIONS_TRUNCATE_CHECK | ( | str | ) |
Truncate the URI user field options string if enabled.
str | URI user field string to truncate if enabled |
We need to be able to handle URI's looking like "sip:1235557890;phone-context=national@x.x.x.x;user=phone"
Where the URI user field is: "1235557890;phone-context=national"
When truncated the string will become: "1235557890"
Definition at line 3350 of file res_pjsip.h.
#define AST_SIP_X_AST_TXP "x-ast-txp" |
URI parameter for symmetric transport
Definition at line 1077 of file res_pjsip.h.
#define AST_SIP_X_AST_TXP_LEN 9 |
Definition at line 1078 of file res_pjsip.h.
#define COLON_PORT_STRLEN 6 |
Definition at line 77 of file res_pjsip.h.
#define IP6ADDR_COLON_PORT_BUFLEN (PJ_INET6_ADDRSTRLEN + COLON_PORT_STRLEN) |
Definition at line 82 of file res_pjsip.h.
#define MAX_RX_CHALLENGES 10 |
Maximum number of challenges before assuming that we are in a loop
Definition at line 107 of file res_pjsip.h.
#define PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)-1) |
Definition at line 68 of file res_pjsip.h.
#define PJSIP_MINVERSION | ( | m, | |
n, | |||
p | |||
) | (((m << 24) | (n << 16) | (p << 8)) >= PJ_VERSION_NUM) |
Definition at line 59 of file res_pjsip.h.
#define PJSTR_PRINTF_SPEC "%.*s" |
Definition at line 71 of file res_pjsip.h.
#define PJSTR_PRINTF_VAR | ( | _v | ) | ((int)(_v).slen), ((_v).ptr) |
Definition at line 72 of file res_pjsip.h.
#define SIP_SORCERY_AUTH_TYPE "auth" |
Definition at line 574 of file res_pjsip.h.
#define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias" |
Definition at line 309 of file res_pjsip.h.
#define SIP_TLS_MAX_CIPHERS 64 |
Maximum number of ciphers supported for a TLS transport.
Definition at line 104 of file res_pjsip.h.
typedef int(* ast_sip_dialog_outbound_auth_cb) (pjsip_dialog *dlg, pjsip_tx_data *tdata, void *user_data) |
Callback called when an outbound request with authentication credentials is to be sent in dialog.
This callback will have the created request on it. The callback's purpose is to do any extra housekeeping that needs to be done as well as to send the request out.
This callback is only necessary if working with a PJSIP API that sits between the application and the dialog layer.
dlg | The dialog to which the request belongs |
tdata | The created request to be sent out |
user_data | Data supplied with the callback |
0 | Success |
-1 | Failure |
Definition at line 1764 of file res_pjsip.h.
Transport shutdown monitor data matcher.
a | User data to compare. |
b | User data to compare. |
1 | The data objects match |
0 | The data objects don't match |
Definition at line 3932 of file res_pjsip.h.
typedef void(* ast_transport_monitor_shutdown_cb) (void *data) |
Transport shutdown monitor callback.
data | User data to know what to do when transport shuts down. |
Definition at line 3920 of file res_pjsip.h.
enum ast_sip_100rel_mode |
100rel modes for SIP endpoints
Definition at line 526 of file res_pjsip.h.
enum ast_sip_auth_type |
Methods of storing SIP digest authentication credentials.
Note that both methods result in MD5 digest authentication being used. The two methods simply alter how Asterisk determines the credentials for a SIP authentication
Definition at line 563 of file res_pjsip.h.
Incoming/Outgoing call offer/answer joint codec preference.
The default is INTERSECT ALL LOCAL.
Definition at line 665 of file res_pjsip.h.
Possible returns from ast_sip_check_authentication.
Definition at line 1228 of file res_pjsip.h.
Contact retrieval filtering flags.
Enumerator | |
---|---|
AST_SIP_CONTACT_FILTER_DEFAULT | Default filter flags. |
AST_SIP_CONTACT_FILTER_REACHABLE | Return only reachable or unknown contacts. |
Definition at line 1300 of file res_pjsip.h.
Status type for a contact.
Definition at line 431 of file res_pjsip.h.
Definition at line 627 of file res_pjsip.h.
enum ast_sip_dtmf_mode |
DTMF modes for SIP endpoints.
Definition at line 540 of file res_pjsip.h.
Different methods by which incoming requests can be matched to endpoints.
Definition at line 606 of file res_pjsip.h.
The security mechanism type.
Enumerator | |
---|---|
AST_SIP_SECURITY_MECH_NONE | |
AST_SIP_SECURITY_MECH_MSRP_TLS | |
AST_SIP_SECURITY_MECH_SDES_SRTP | |
AST_SIP_SECURITY_MECH_DTLS_SRTP |
Definition at line 361 of file res_pjsip.h.
The kind of security negotiation.
Enumerator | |
---|---|
AST_SIP_SECURITY_NEG_NONE | No security mechanism negotiation |
AST_SIP_SECURITY_NEG_MEDIASEC | Use mediasec security mechanism negotiation |
Definition at line 350 of file res_pjsip.h.
Definition at line 640 of file res_pjsip.h.
Definition at line 651 of file res_pjsip.h.
Enumerator | |
---|---|
AST_SIP_SESSION_REFRESH_METHOD_INVITE | Use reinvite to negotiate direct media |
AST_SIP_SESSION_REFRESH_METHOD_UPDATE | Use UPDATE to negotiate direct media |
Definition at line 620 of file res_pjsip.h.
Definition at line 3178 of file res_pjsip.h.
Definition at line 3934 of file res_pjsip.h.
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.
pj_str_t is not NULL-terminated. Any place that expects a NULL- terminated string needs to have the pj_str_t copied into a separate buffer.
This method copies the pj_str_t contents into the destination buffer and NULL-terminates the buffer.
dest | The destination buffer |
src | The pj_str_t to copy |
size | The size of the destination buffer. |
Definition at line 2201 of file res_pjsip.c.
References MIN.
Referenced by apply_dtls_attrib(), apply_negotiated_sdp_stream(), assign_uuid(), ast_sip_get_transport_name(), ast_sip_header_to_security_mechanism(), ast_sip_report_auth_challenge_sent(), ast_sip_report_auth_failed_challenge_response(), chan_pjsip_get_uniqueid(), change_outgoing_sdp_stream_media_address(), channel_read_pjsip(), cli_complete_subscription_common(), cli_list_subscriptions_detail(), cli_show_subscriptions_detail(), determine_sip_publish_type(), dialog_info_generate_body_content(), endpoint_lookup(), evaluate_like(), extract_contact_addr(), find_aor2(), find_aor_name(), find_challenge(), get_auth_header(), get_codecs(), get_dest_tn(), get_destination(), get_endpoint_details(), get_from_header(), get_mid_bundle_group(), get_user_agent(), handle_incoming_request(), handle_incoming_sdp(), handle_negotiated_sdp_session_media(), handle_registration_response(), headers_to_vars(), incoming_in_dialog_request(), log_failed_request(), negotiate_incoming_sdp_stream(), options_on_rx_request(), parse_uri_cb(), process_extmap_attributes(), process_ice_attributes(), process_ice_auth_attrb(), process_ssrc_attributes(), publish_request_initial(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), refer_blind_callback(), refer_incoming_blind_request(), refer_incoming_refer_request(), rfc3326_use_reason_header(), rfc3329_incoming_response(), rx_data_to_ast_msg(), save_response_fields_to_transport(), sdp_requires_deferral(), security_event_populate(), session_inv_on_redirected(), session_outgoing_nat_hook(), set_id_from_hdr(), set_id_from_oli(), set_mid_and_bundle_group(), set_redirecting_value(), set_remote_mslabel_and_stream_group(), set_sipdomain_variable(), sip_subscription_to_ami(), sub_persistence_recreate(), subscription_get_generator_from_rdata(), subscription_get_handler_from_rdata(), subscription_persistence_create(), subscription_persistence_update(), and transfer_refer().
int ast_copy_pj_str2 | ( | char ** | dest, |
const pj_str_t * | src | ||
) |
Create and copy a pj_str_t into a standard character buffer.
pj_str_t is not NULL-terminated. Any place that expects a NULL- terminated string needs to have the pj_str_t copied into a separate buffer.
Copies the pj_str_t contents into a newly allocated buffer pointed to by dest. NULL-terminates the buffer.
[out] | dest | The destination buffer |
src | The pj_str_t to copy |
Definition at line 2208 of file res_pjsip.c.
References ast_asprintf, and NULL.
struct ast_sip_endpoint * ast_pjsip_rdata_get_endpoint | ( | pjsip_rx_data * | rdata | ) |
Get the looked-up endpoint on an out-of dialog request or response.
The function may ONLY be called on out-of-dialog requests or responses. For in-dialog requests and responses, it is required that the user of the dialog has the looked-up endpoint stored locally.
This function should never return NULL if the message is out-of-dialog. It will always return NULL if the message is in-dialog.
This function will increase the reference count of the returned endpoint by one. Release your reference using the ao2_ref function when finished.
rdata | Out-of-dialog request or response |
Definition at line 966 of file pjsip_distributor.c.
References ao2_ref, and endpoint_mod.
Referenced by authenticate(), handle_new_invite_request(), nat_on_rx_message(), options_on_rx_request(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), registrar_on_rx_request(), rx_data_to_ast_msg(), send_options_response(), send_response(), and supplement_on_rx_request().
int ast_sip_add_body | ( | pjsip_tx_data * | tdata, |
const struct ast_sip_body * | body | ||
) |
Add a body to an outbound SIP message.
If this is called multiple times, the latest body will replace the current body.
tdata | The message to add the body to |
body | The message body to add |
0 | Success |
-1 | Failure |
Definition at line 2052 of file res_pjsip.c.
References ast_body_to_pjsip_body().
Referenced by aoc_bye_outgoing_request(), aoc_bye_outgoing_response(), aoc_send_as_xml(), build_notify_body(), msg_send(), send_unsolicited_mwi_notify_to_contact(), sendtext(), sip_publisher_service_queue(), transmit_info_dtmf(), and transmit_info_with_vidupdate().
int ast_sip_add_body_multipart | ( | pjsip_tx_data * | tdata, |
const struct ast_sip_body * | bodies[], | ||
int | num_bodies | ||
) |
Add a multipart body to an outbound SIP message.
This will treat each part of the input vector as part of a multipart body and add each part to the SIP message.
tdata | The message to add the body to |
bodies | The message bodies to add |
num_bodies | The parts of the body to add |
0 | Success |
-1 | Failure |
Definition at line 2059 of file res_pjsip.c.
References ast_body_to_pjsip_body(), and NULL.
void ast_sip_add_date_header | ( | pjsip_tx_data * | tdata | ) |
Adds a Date header to the tdata, formatted like: Date: Wed, 01 Jan 2021 14:53:01 GMT.
Definition at line 90 of file res_pjsip.c.
References ast_sip_add_header(), and NULL.
Referenced by add_date_header().
int ast_sip_add_global_request_header | ( | const char * | name, |
const char * | value, | ||
int | replace | ||
) |
Definition at line 153 of file pjsip_global_headers.c.
References add_header(), name, replace(), request_headers, and value.
Referenced by global_apply().
int ast_sip_add_global_response_header | ( | const char * | name, |
const char * | value, | ||
int | replace | ||
) |
Definition at line 158 of file pjsip_global_headers.c.
References add_header(), name, replace(), response_headers, and value.
Referenced by global_apply().
int ast_sip_add_header | ( | pjsip_tx_data * | tdata, |
const char * | name, | ||
const char * | value | ||
) |
Add a header to an outbound SIP message.
tdata | The message to add the header to |
name | The header name |
value | The header value |
0 | Success |
-1 | Failure |
Definition at line 2008 of file res_pjsip.c.
Referenced by add_header_from_channel_var(), add_headers_to_message(), ast_sip_add_date_header(), ast_sip_add_security_headers(), ast_sip_message_apply_transport(), build_notify(), handle_outgoing_request(), notify_channel(), notify_contact(), notify_uri(), options_incoming_request(), rfc3326_add_reason_header(), send_options_response(), sip_publication_respond(), transfer_refer(), and vars_to_headers().
pjsip_generic_string_hdr * ast_sip_add_header2 | ( | pjsip_tx_data * | tdata, |
const char * | name, | ||
const char * | value | ||
) |
Add a header to an outbound SIP message, returning a pointer to the header.
tdata | The message to add the header to |
name | The header name |
value | The header value |
Definition at line 2023 of file res_pjsip.c.
Referenced by handle_outgoing_request().
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.
security_mechanisms | Vector of security mechanisms. |
header_name | The header name under which to add the security mechanisms. One of Security-Client, Security-Server, Security-Verify. |
add_qval | If zero, don't add the q-value to the header. |
tdata | The transmission data. |
0 | Success |
non-zero | Failure |
Definition at line 290 of file security_agreements.c.
References ast_free, ast_sip_add_header(), AST_VECTOR_GET, AST_VECTOR_SIZE, buf, NULL, and security_mechanism_to_str().
Referenced by add_outgoing_request_headers(), and add_security_headers().
void ast_sip_add_usereqphone | ( | const struct ast_sip_endpoint * | endpoint, |
pj_pool_t * | pool, | ||
pjsip_uri * | uri | ||
) |
Add 'user=phone' parameter to URI if enabled and user is a phone number.
endpoint | The endpoint to use for configuration |
pool | The memory pool to allocate the parameter from |
uri | The URI to check for user and to add parameter to |
Definition at line 930 of file res_pjsip.c.
References AST_DIGIT_ANY, and ast_sip_endpoint::usereqphone.
Referenced by ast_sip_create_dialog_uac(), create_out_of_dialog_request(), and set_from_header().
int ast_sip_append_body | ( | pjsip_tx_data * | tdata, |
const char * | body_text | ||
) |
Append body data to a SIP message.
This acts mostly the same as ast_sip_add_body, except that rather than replacing a body if it currently exists, it appends data to an existing body.
tdata | The message to append the body to |
body_text | The string to append to the end of the current body |
0 | Success |
-1 | Failure |
Definition at line 2075 of file res_pjsip.c.
References ast_str_alloca, ast_str_buffer(), and ast_str_set().
int ast_sip_are_media_types_equal | ( | pjsip_media_type * | a, |
pjsip_media_type * | b | ||
) |
Compare pjsip media types.
a | the first media type |
b | the second media type |
1 | Media types are equal |
0 | Media types are not equal |
Definition at line 2219 of file res_pjsip.c.
Referenced by find_pidf(), and video_info_incoming_request().
const char * ast_sip_auth_type_to_str | ( | enum ast_sip_auth_type | type | ) |
Converts the given auth type to a string.
type | the auth type to convert |
a | string representative of the auth type |
Definition at line 80 of file config_auth.c.
References ARRAY_IN_BOUNDS, auth_types_map, and type.
Referenced by auth_type_to_str().
void ast_sip_auth_vector_destroy | ( | struct ast_sip_auth_vector * | vector | ) |
Free contents of an auth vector.
vector | Vector whose contents are to be freed |
Definition at line 306 of file pjsip_configuration.c.
References ast_free, AST_VECTOR_FREE, AST_VECTOR_REMOVE_UNORDERED, AST_VECTOR_SIZE, and name.
Referenced by ast_sip_auth_vector_init(), endpoint_destructor(), handle_client_state_destruction(), sip_outbound_publish_destroy(), sip_outbound_registration_destroy(), and sip_outbound_registration_perform().
int ast_sip_auth_vector_init | ( | struct ast_sip_auth_vector * | vector, |
const char * | auth_names | ||
) |
Initialize an auth vector with the configured values.
vector | Vector to initialize |
auth_names | Comma-separated list of names to set in the array |
0 | Success |
non-zero | Failure |
Definition at line 324 of file pjsip_configuration.c.
References ast_assert, ast_free, ast_sip_auth_vector_destroy(), ast_strdup, ast_strdupa, ast_strip(), ast_strlen_zero(), AST_VECTOR_APPEND, AST_VECTOR_INIT, AST_VECTOR_SIZE, NULL, strsep(), and value.
Referenced by inbound_auth_handler(), and outbound_auth_handler().
int ast_sip_auths_to_str | ( | const struct ast_sip_auth_vector * | auths, |
char ** | buf | ||
) |
Converts an auths array to a string of comma separated values.
auths | an auth array |
buf | the string buffer to write the object data |
0 | Success, non-zero on failure |
Definition at line 374 of file pjsip_configuration.c.
References ast_calloc, ast_join_delim(), AST_VECTOR_SIZE, buf, ast_sip_auth_vector::elems, and MAX_OBJECT_FIELD.
Referenced by format_str_append_auth(), inbound_auths_to_str(), and outbound_auths_to_str().
const char * ast_sip_call_codec_pref_to_str | ( | struct ast_flags | pref | ) |
Convert the call codec preference flags to a string.
pref | the call codec preference setting |
Definition at line 2554 of file res_pjsip.c.
References ast_sip_call_codec_pref_test, and value.
Referenced by incoming_call_offer_pref_to_str(), log_caps(), and outgoing_call_offer_pref_to_str().
int ast_sip_call_codec_str_to_pref | ( | struct ast_flags * | pref, |
const char * | pref_str, | ||
int | is_outgoing | ||
) |
Convert a call codec preference string to preference flags.
pref | A pointer to an ast_flags structure to receive the preference flags |
pref_str | The call codec preference setting string |
is_outgoing | Is for outgoing calls? |
0 | The string was parsed successfully |
-1 | The string option was invalid |
Definition at line 2577 of file res_pjsip.c.
References ast_set_flag, AST_SIP_CALL_CODEC_PREF_ALL, AST_SIP_CALL_CODEC_PREF_FIRST, AST_SIP_CALL_CODEC_PREF_INTERSECT, AST_SIP_CALL_CODEC_PREF_LOCAL, AST_SIP_CALL_CODEC_PREF_REMOTE, AST_SIP_CALL_CODEC_PREF_UNION, and ast_flags::flags.
Referenced by call_offer_pref_handler(), and test_create_joint().
enum ast_sip_check_auth_result ast_sip_check_authentication | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
pjsip_tx_data * | tdata | ||
) |
Method to determine authentication status of an incoming request.
This will call into a registered authenticator. The registered authenticator will do what is necessary to determine whether the incoming request passes authentication. A tentative response is passed into this function so that if, say, a digest authentication challenge should be sent in the ensuing response, it can be added to the response.
endpoint | The endpoint from the request was sent |
rdata | The request to potentially authenticate |
tdata | Tentative response to the request |
Definition at line 179 of file res_pjsip.c.
References ast_log, AST_SIP_AUTHENTICATION_SUCCESS, ast_sip_authenticator::check_authentication, LOG_WARNING, and registered_authenticator.
Referenced by authenticate().
void ast_sip_cleanup_auths | ( | struct ast_sip_auth * | auths[], |
size_t | num_auths | ||
) |
Clean up retrieved auth structures from memory.
Call this function once you have completed operating on auths retrieved from ast_sip_retrieve_auths
auths | An array of auth object pointers to clean up |
num_auths | The number of auths in the array |
Definition at line 2542 of file pjsip_configuration.c.
References ao2_cleanup.
Referenced by digest_check_auth(), and set_outbound_initial_authentication_credentials().
int ast_sip_contact_to_str | ( | void * | object, |
void * | arg, | ||
int | flags | ||
) |
Handler used to convert a contact to a string.
object | the ast_sip_aor_contact_pair containing a list of contacts to iterate and the contact |
arg | user data passed to handler |
flags |
0 | Success, non-zero on failure |
Definition at line 770 of file location.c.
References ast_str_append(), buf, and ast_sip_contact_wrapper::contact_id.
Referenced by contacts_to_str(), sip_contact_to_str(), and sip_endpoints_aors_ami().
struct ast_str * ast_sip_create_ami_event | ( | const char * | event, |
struct ast_sip_ami * | ami | ||
) |
Creates a string to store AMI event data in.
event | the event to set |
ami | AMI session and message container |
an | initialized ast_str or NULL on error. |
Definition at line 1724 of file pjsip_configuration.c.
References ast_sip_ami::action_id, AMI_DEFAULT_STR_SIZE, ast_str_append(), ast_str_create, ast_str_set(), ast_strlen_zero(), astman_send_error_va(), buf, ast_sip_ami::m, NULL, and ast_sip_ami::s.
Referenced by ami_outbound_registration_task(), ami_registrations_aor(), ami_subscription_detail(), ast_sip_format_contact_ami(), format_ami_aor_handler(), format_ami_aorlist_handler(), format_ami_auth_handler(), format_ami_authlist_handler(), format_ami_contactlist_handler(), format_ami_endpoint(), format_ami_endpoint_transport(), format_ami_endpoints(), format_ami_resource_lists(), and send_identify_ami_event().
pjsip_dialog * ast_sip_create_dialog_uac | ( | const struct ast_sip_endpoint * | endpoint, |
const char * | aor_name, | ||
const char * | request_user | ||
) |
General purpose method for creating a UAC dialog with an endpoint.
endpoint | A pointer to the endpoint |
aor_name | Optional name of the AOR to target, may even be an explicit SIP URI |
request_user | Optional user to place into the target URI |
non-NULL | success |
NULL | failure |
Definition at line 964 of file res_pjsip.c.
References ast_begins_with(), ast_log, ast_sip_add_usereqphone(), ast_sip_dlg_set_transport(), ast_sip_tpselector_unref(), ast_sorcery_object_get_id(), ast_strlen_zero(), ast_sip_endpoint::contact_user, ast_sip_endpoint::fromdomain, ast_sip_endpoint::fromuser, ast_sip_endpoint::info, LOG_ERROR, NULL, ast_sip_endpoint::outbound_proxy, sip_dialog_create_from(), and tmp().
Referenced by ast_sip_create_subscription(), ast_sip_session_create_outgoing(), and refer_send().
pjsip_dialog * ast_sip_create_dialog_uas | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
pj_status_t * | status | ||
) |
General purpose method for creating a UAS dialog with an endpoint.
endpoint | A pointer to the endpoint | |
rdata | The request that is starting the dialog | |
[out] | status | On failure, the reason for failure in creating the dialog |
Definition at line 1176 of file res_pjsip.c.
References create_dialog_uas(), and status.
pjsip_dialog * ast_sip_create_dialog_uas_locked | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
pj_status_t * | status | ||
) |
General purpose method for creating a UAS dialog with an endpoint.
This function creates and returns a locked, and referenced counted pjsip dialog object. The caller is thus responsible for freeing the allocated memory, decrementing the reference, and releasing the lock when done with the returned object.
The dialog is returned locked and with a reference in order to ensure that the dialog object, and any of its associated objects (e.g. transaction) are not untimely destroyed. For instance, that could happen when a transport error occurs.
As long as the caller maintains a reference to the dialog there should be no worry that it might unknowingly be destroyed. However, once the caller unlocks the dialog there is a danger that some of the dialog's internal objects could be lost and/or compromised. For example, when the aforementioned transport error occurs the dialog's associated transaction gets destroyed (see pjsip_dlg_on_tsx_state in sip_dialog.c, and mod_inv_on_tsx_state in sip_inv.c).
In this case and before using the dialog again the caller should re-lock the dialog, check to make sure the dialog is still established, and the transaction still exists and has not been destroyed.
endpoint | A pointer to the endpoint | |
rdata | The request that is starting the dialog | |
[out] | status | On failure, the reason for failure in creating the dialog |
A | locked, and reference counted pjsip_dialog object. |
NULL | on failure |
Definition at line 1192 of file res_pjsip.c.
References create_dialog_uas(), and status.
Referenced by create_subscription_tree(), and pre_session_setup().
int ast_sip_create_rdata | ( | pjsip_rx_data * | rdata, |
char * | packet, | ||
const char * | src_name, | ||
int | src_port, | ||
char * | transport_type, | ||
const char * | local_name, | ||
int | local_port | ||
) |
General purpose method for creating an rdata structure using specific information.
[out] | rdata | The rdata structure that will be populated |
packet | A SIP message | |
src_name | The source IP address of the message | |
src_port | The source port of the message | |
transport_type | The type of transport the message was received on | |
local_name | The local IP address the message was received on | |
local_port | The local port the message was received on |
0 | success |
-1 | failure |
Definition at line 1266 of file res_pjsip.c.
References ast_sip_create_rdata_with_contact(), and NULL.
int ast_sip_create_rdata_with_contact | ( | pjsip_rx_data * | rdata, |
char * | packet, | ||
const char * | src_name, | ||
int | src_port, | ||
char * | transport_type, | ||
const char * | local_name, | ||
int | local_port, | ||
const char * | contact_uri | ||
) |
General purpose method for creating an rdata structure using specific information.
[out] | rdata | The rdata structure that will be populated |
packet | A SIP message | |
src_name | The source IP address of the message | |
src_port | The source port of the message | |
transport_type | The type of transport the message was received on | |
local_name | The local IP address the message was received on | |
local_port | The local port the message was received on | |
contact_uri | The contact URI of the message |
0 | success |
-1 | failure |
Definition at line 1214 of file res_pjsip.c.
References ast_copy_string(), ast_log, ast_strlen_zero(), LOG_WARNING, NULL, and tmp().
Referenced by ast_sip_create_rdata(), and subscription_persistence_recreate().
int ast_sip_create_request | ( | const char * | method, |
struct pjsip_dialog * | dlg, | ||
struct ast_sip_endpoint * | endpoint, | ||
const char * | uri, | ||
struct ast_sip_contact * | contact, | ||
pjsip_tx_data ** | tdata | ||
) |
General purpose method for creating a SIP request.
Its typical use would be to create one-off requests such as an out of dialog SIP MESSAGE.
The request can either be in- or out-of-dialog. If in-dialog, the dlg parameter MUST be present. If out-of-dialog the endpoint parameter MUST be present. If both are present, then we will assume that the message is to be sent in-dialog.
The uri parameter can be specified if the request should be sent to an explicit URI rather than one configured on the endpoint.
method | The method of the SIP request to send | |
dlg | Optional. If specified, the dialog on which to request the message. | |
endpoint | Optional. If specified, the request will be created out-of-dialog to the endpoint. | |
uri | Optional. If specified, the request will be sent to this URI rather than one configured for the endpoint. | |
contact | The contact with which this request is associated for out-of-dialog requests. | |
[out] | tdata | The newly-created request |
The provided contact is attached to tdata with its reference bumped, but will not survive for the entire lifetime of tdata since the contact is cleaned up when all supplements have completed execution.
0 | Success |
-1 | Failure |
Definition at line 1435 of file res_pjsip.c.
References ast_assert, ast_log, create_in_dialog_request(), create_out_of_dialog_request(), get_pjsip_method(), LOG_WARNING, method, NULL, and pmethod.
Referenced by aoc_send_as_xml(), msg_send(), notify_channel(), notify_contact(), notify_uri(), send_unsolicited_mwi_notify_to_contact(), sendtext(), sip_options_qualify_contact(), transmit_info_dtmf(), and transmit_info_with_vidupdate().
int ast_sip_create_request_with_auth | ( | const struct ast_sip_auth_vector * | auths, |
pjsip_rx_data * | challenge, | ||
pjsip_tx_data * | tdata, | ||
pjsip_tx_data ** | new_request | ||
) |
Create a response to an authentication challenge.
This will call into an outbound authenticator's create_request_with_auth callback to create a new request with authentication credentials. See the create_request_with_auth callback in the ast_sip_outbound_authenticator structure for details about the parameters and return values.
Definition at line 214 of file res_pjsip.c.
References ast_log, challenge(), ast_sip_outbound_authenticator::create_request_with_auth, LOG_WARNING, and registered_outbound_authenticator.
Referenced by check_request_status(), handle_registration_response(), outbound_invite_auth(), refer_client_on_evsub_state(), session_inv_on_tsx_state_changed(), and sip_outbound_publish_callback().
int ast_sip_create_response | ( | const pjsip_rx_data * | rdata, |
int | st_code, | ||
struct ast_sip_contact * | contact, | ||
pjsip_tx_data ** | p_tdata | ||
) |
General purpose method for creating a SIP response.
Its typical use would be to create responses for out of dialog requests.
rdata | The rdata from the incoming request. | |
st_code | The response code to transmit. | |
contact | The contact with which this request is associated. | |
[out] | p_tdata | The newly-created response |
The provided contact is attached to tdata with its reference bumped, but will not survive for the entire lifetime of tdata since the contact is cleaned up when all supplements have completed execution.
0 | Success |
-1 | Failure |
Definition at line 2468 of file res_pjsip.c.
References ao2_bump, ast_sip_get_pjsip_endpoint(), ast_sip_mod_data_set, MOD_DATA_CONTACT, NULL, and supplement_module.
Referenced by send_options_response(), and send_response().
struct ast_sip_endpoint * ast_sip_default_outbound_endpoint | ( | void | ) |
Retrieve the default outbound endpoint.
The | default outbound endpoint, NULL if not found. |
Definition at line 2518 of file pjsip_configuration.c.
References ast_free, ast_sip_global_default_outbound_endpoint(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), name, NULL, RAII_VAR, and sip_sorcery.
Referenced by ast_sip_get_endpoint(), handle_atsign(), handle_single_token(), and notify_uri().
int ast_sip_dialog_setup_outbound_authentication | ( | pjsip_dialog * | dlg, |
const struct ast_sip_endpoint * | endpoint, | ||
ast_sip_dialog_outbound_auth_cb | cb, | ||
void * | user_data | ||
) |
Set up outbound authentication on a SIP dialog.
This sets up the infrastructure so that all requests associated with a created dialog can be re-sent with authentication credentials if the original request is challenged.
dlg | The dialog on which requests will be authenticated |
endpoint | The endpoint whom this dialog pertains to |
cb | Callback to call to send requests with authentication |
user_data | Data to be provided to the callback when it is called |
0 | Success |
-1 | Failure |
void * ast_sip_dict_get | ( | void * | ht, |
const char * | key | ||
) |
Retrieves the value associated with the given key.
ht | the hash table/dictionary to search |
key | the key to find |
the | value associated with the key, NULL otherwise. |
Definition at line 2327 of file res_pjsip.c.
References NULL.
void * ast_sip_dict_set | ( | pj_pool_t * | pool, |
void * | ht, | ||
const char * | key, | ||
void * | val | ||
) |
Set the value for the given key.
Note - if the hash table does not exist one is created first, the key/value pair is set, and the hash table returned.
pool | the pool to allocate memory in |
ht | the hash table/dictionary in which to store the key/value pair |
key | the key to associate a value with |
val | the value to associate with a key |
the | given, or newly created, hash table. |
Definition at line 2338 of file res_pjsip.c.
int ast_sip_dlg_set_transport | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_dialog * | dlg, | ||
pjsip_tpselector * | selector | ||
) |
Set the transport on a dialog.
endpoint | |
dlg | |
selector | (optional) |
Definition at line 727 of file res_pjsip.c.
References ast_sip_set_tpselector_from_ep_or_uri(), and ast_sip_tpselector_unref().
Referenced by ast_sip_create_dialog_uac().
int ast_sip_dtmf_to_str | ( | const enum ast_sip_dtmf_mode | dtmf, |
char * | buf, | ||
size_t | buf_len | ||
) |
Convert the DTMF mode enum value into a string.
dtmf | the dtmf mode |
buf | Buffer to receive dtmf mode string |
buf_len | Buffer length |
0 | Success |
-1 | Failure |
Definition at line 2504 of file res_pjsip.c.
References ast_copy_string(), AST_SIP_DTMF_AUTO, AST_SIP_DTMF_AUTO_INFO, AST_SIP_DTMF_INBAND, AST_SIP_DTMF_INFO, AST_SIP_DTMF_NONE, AST_SIP_DTMF_RFC_4733, and buf.
Referenced by dtmf_to_str(), and pjsip_acf_dtmf_mode_read().
void * ast_sip_endpoint_alloc | ( | const char * | name | ) |
Allocate a new SIP endpoint.
This will return an endpoint with its refcount increased by one. This reference can be released using ao2_ref().
name | The name of the endpoint. |
NULL | Endpoint allocation failed |
non-NULL | The newly allocated endpoint |
Definition at line 2457 of file pjsip_configuration.c.
References ao2_cleanup, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_party_id_init(), ast_sorcery_generic_alloc(), ast_strdup, ast_string_field_init, ast_string_field_init_extended, AST_VECTOR_INIT, ast_sip_endpoint_media_configuration::codecs, endpoint_destructor(), ast_sip_endpoint::id, ast_sip_endpoint::ident_method_order, ast_sip_endpoint::info, init_info_configuration(), init_media_configuration(), init_subscription_configuration(), ast_sip_endpoint::media, NULL, ast_sip_endpoint_id_configuration::self, ast_sip_endpoint::subscription, and ast_party_id::tag.
Referenced by ast_res_pjsip_initialize_configuration().
int ast_sip_failover_request | ( | pjsip_tx_data * | tdata | ) |
Set a request to use the next value in the list of resolved addresses.
tdata | the tx data from the original request |
0 | No more addresses to try |
1 | The request was successfully re-intialized |
Definition at line 1816 of file res_pjsip.c.
References NULL, and send_request_wrapper::tdata.
Referenced by check_request_status(), and handle_registration_response().
struct ast_sip_transport_state * ast_sip_find_transport_state_in_use | ( | struct ast_sip_request_transport_details * | details | ) |
Returns the transport state currently in use based on request transport details.
details |
transport_state |
Definition at line 595 of file res_pjsip.c.
References ao2_callback, ao2_cleanup, ast_sip_get_transport_states(), find_transport_state_in_use(), NULL, RAII_VAR, and transport_states.
Referenced by ast_sip_rewrite_uri_to_local(), and process_nat().
int ast_sip_for_each_aor | ( | const char * | aors, |
ao2_callback_fn | on_aor, | ||
void * | arg | ||
) |
For every aor in the comma separated aors string call the given 'on_aor' handler.
aors | a comma separated list of aors |
on_aor | callback for each aor |
arg | user data passed to handler |
0 | Success, non-zero on failure |
Definition at line 687 of file location.c.
References ao2_ref, ast_sip_location_retrieve_aor(), ast_strdupa, ast_strip(), ast_strlen_zero(), copy(), name, and strsep().
Referenced by ami_registrations_endpoint(), ast_sip_location_retrieve_contacts_from_aor_list(), cli_aor_iterate(), format_ami_contact_status(), format_ami_endpoint_aor(), format_ami_endpoints(), mwi_new_subscribe(), and mwi_subscribe_all().
int ast_sip_for_each_auth | ( | const struct ast_sip_auth_vector * | array, |
ao2_callback_fn | on_auth, | ||
void * | arg | ||
) |
For every auth in the array call the given 'on_auth' handler.
array | an array of auths |
on_auth | callback for each auth |
arg | user data passed to handler |
0 | Success, non-zero on failure |
Definition at line 135 of file config_auth.c.
References ao2_cleanup, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, RAII_VAR, and SIP_SORCERY_AUTH_TYPE.
Referenced by ast_sip_format_auths_ami(), and cli_iterator().
int ast_sip_for_each_channel | ( | const struct ast_sip_endpoint * | endpoint, |
ao2_callback_fn | on_channel_snapshot, | ||
void * | arg | ||
) |
For every channel snapshot on an endpoint all the given 'on_channel_snapshot' handler.
endpoint | endpoint |
on_channel_snapshot | callback for each channel snapshot |
arg | user data passed to handler |
0 | Success, non-zero on failure |
Definition at line 1690 of file pjsip_configuration.c.
References ao2_cleanup, ast_sip_for_each_channel_snapshot(), ast_sip_get_endpoint_snapshot(), and RAII_VAR.
Referenced by cli_channel_iterate(), and cli_channelstats_iterate().
int ast_sip_for_each_channel_snapshot | ( | const struct ast_endpoint_snapshot * | endpoint_snapshot, |
ao2_callback_fn | on_channel_snapshot, | ||
void * | arg | ||
) |
For every channel snapshot on an endpoint snapshot call the given 'on_channel_snapshot' handler.
endpoint_snapshot | snapshot of an endpoint |
on_channel_snapshot | callback for each channel snapshot |
arg | user data passed to handler |
0 | Success, non-zero on failure |
Definition at line 1663 of file pjsip_configuration.c.
References ao2_cleanup, ast_channel_snapshot_get_latest(), ast_endpoint_snapshot::channel_ids, NULL, ast_endpoint_snapshot::num_channels, and RAII_VAR.
Referenced by active_channels_to_str(), and ast_sip_for_each_channel().
int ast_sip_for_each_contact | ( | const struct ast_sip_aor * | aor, |
ao2_callback_fn | on_contact, | ||
void * | arg | ||
) |
For every contact on an AOR call the given 'on_contact' handler.
aor | the aor containing a list of contacts to iterate |
on_contact | callback on each contact on an AOR. The object received by the callback will be a ast_sip_contact_wrapper structure. |
arg | user data passed to handler |
0 | Success, non-zero on failure |
Definition at line 722 of file location.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_cleanup, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_malloc, ast_sip_location_retrieve_aor_contacts(), ast_sorcery_object_get_id(), ast_strdup, contact_wrapper_destroy(), NULL, and RAII_VAR.
Referenced by ami_registrations_aor(), cli_aor_gather_contacts(), cli_contact_iterate(), contacts_to_str(), contacts_to_var_list(), format_contact_status_for_aor(), and sip_endpoints_aors_ami().
int ast_sip_format_auths_ami | ( | const struct ast_sip_auth_vector * | auths, |
struct ast_sip_ami * | ami | ||
) |
Format auth details for AMI.
auths | an auth array |
ami | ami variable container |
0 | Success, non-zero on failure |
Definition at line 195 of file config_auth.c.
References ast_sip_for_each_auth(), and format_ami_auth_handler().
Referenced by ami_outbound_registration_task(), and format_ami_endpoint_auth().
int ast_sip_format_contact_ami | ( | void * | obj, |
void * | arg, | ||
int | flags | ||
) |
Formats the contact and sends over AMI.
obj | a pointer an ast_sip_contact_wrapper structure |
arg | a pointer to an ast_sip_ami structure |
flags | ignored |
0 | Success, otherwise non-zero on error |
Definition at line 2719 of file pjsip_options.c.
References ao2_cleanup, ast_sip_contact_wrapper::aor_id, ast_sip_ami::arg, ast_free, ast_sip_create_ami_event(), ast_sip_get_contact_status(), ast_sip_get_contact_status_label(), ast_sorcery_object_get_id(), ast_str_append(), ast_str_buffer(), ast_strlen_zero(), AST_TIME_T_LEN, ast_time_t_to_string(), astman_append(), ast_sip_contact::authenticate_qualify, AVAILABLE, buf, ast_sip_contact::call_id, ast_sip_contact_wrapper::contact, ast_sip_ami::count, ast_sip_contact::endpoint_name, ast_sip_contact::expiration_time, ast_sip_contact::outbound_proxy, ast_sip_contact::path, ast_sip_contact::qualify_frequency, ast_sip_contact::qualify_timeout, ast_sip_ami::s, S_OR, status, UNKNOWN, ast_sip_contact::uri, ast_sip_contact::user_agent, ast_sip_contact::via_addr, and ast_sip_contact::via_port.
Referenced by ami_show_registration_contact_statuses(), and format_contact_status_for_aor().
int ast_sip_format_endpoint_ami | ( | struct ast_sip_endpoint * | endpoint, |
struct ast_sip_ami * | ami, | ||
int * | count | ||
) |
Formats the endpoint and sends over AMI.
endpoint | the endpoint to format and send |
ami | AMI variable container |
count | the number of formatters operated on |
0 | Success, otherwise non-zero on error |
Definition at line 501 of file res_pjsip.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_sip_endpoint_formatter::format_ami, lock, and SCOPED_LOCK.
Referenced by ami_show_endpoint().
unsigned int ast_sip_get_all_codecs_on_empty_reinvite | ( | void | ) |
Retrieve the system setting 'all_codecs_on_empty_reinvite'.
non | zero if we should return all codecs on empty re-INVITE |
Definition at line 543 of file config_global.c.
References global_config::all_codecs_on_empty_reinvite, ao2_ref, DEFAULT_ALL_CODECS_ON_EMPTY_REINVITE, and get_global_cfg().
Referenced by session_inv_on_create_offer().
unsigned int ast_sip_get_allow_sending_180_after_183 | ( | void | ) |
Retrieve the global setting 'allow_sending_180_after_183'.
non | zero if disable. |
Definition at line 453 of file config_global.c.
References global_config::allow_sending_180_after_183, ao2_ref, DEFAULT_ALLOW_SENDING_180_AFTER_183, and get_global_cfg().
Referenced by chan_pjsip_indicate().
struct ast_sip_auth * ast_sip_get_artificial_auth | ( | void | ) |
Retrieves a reference to the artificial auth.
The | artificial auth |
Definition at line 628 of file pjsip_distributor.c.
References ao2_global_obj_ref.
Referenced by digest_check_auth(), and global_loaded().
struct ast_sip_endpoint * ast_sip_get_artificial_endpoint | ( | void | ) |
Retrieves a reference to the artificial endpoint.
The | artificial endpoint |
Definition at line 651 of file pjsip_distributor.c.
References ao2_ref, and artificial_endpoint.
Referenced by digest_check_auth(), digest_requires_authentication(), endpoint_lookup(), and get_account_id().
unsigned int ast_sip_get_contact_expiration_check_interval | ( | void | ) |
Retrieve the system contact expiration check interval setting.
the | contact expiration check interval. |
Definition at line 315 of file config_global.c.
References ao2_ref, global_config::contact_expiration_check_interval, DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL, and get_global_cfg().
Referenced by expiration_global_loaded().
const char * ast_sip_get_contact_short_status_label | ( | const enum ast_sip_contact_status_type | status | ) |
Definition at line 339 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, short_status_map, and status.
Referenced by cli_contact_print_body().
pjsip_sip_uri * ast_sip_get_contact_sip_uri | ( | pjsip_tx_data * | tdata | ) |
Return the SIP URI of the Contact header.
tdata |
Pointer | to SIP URI of Contact |
NULL | if Contact header not found or not a SIP(S) URI |
Definition at line 564 of file res_pjsip.c.
References NULL.
Referenced by ast_sip_rewrite_uri_to_local(), ast_sip_set_request_transport_details(), and process_nat().
struct ast_sip_contact_status * ast_sip_get_contact_status | ( | const struct ast_sip_contact * | contact | ) |
Retrieve the current status for a contact.
contact | The contact. |
non-NULL | Success |
NULL | Status information not found |
Definition at line 525 of file pjsip_options.c.
References ao2_find, ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, and sip_options_contact_statuses.
Referenced by add_outgoing_request_headers(), ast_sip_format_contact_ami(), cli_contact_print_body(), contact_add_security_headers_to_status(), contact_has_security_mechanisms(), contact_remove_unreachable(), format_ami_contactlist_handler(), pjsip_contact_function_read(), registrar_add_unreachable(), rfc3329_incoming_response(), sip_options_contact_update_task(), and vec_contact_cmp().
const char * ast_sip_get_contact_status_label | ( | const enum ast_sip_contact_status_type | status | ) |
translate ast_sip_contact_status_type to character string.
the | character string equivalent. |
Definition at line 333 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, status, and status_map.
Referenced by ast_res_pjsip_find_or_create_contact_status(), ast_sip_format_contact_ami(), ast_sip_initialize_sorcery_location(), ast_sip_persistent_endpoint_publish_contact_state(), format_ami_contactlist_handler(), pjsip_contact_function_read(), sip_options_contact_status_notify_task(), sip_options_remove_contact_status(), and sip_options_set_contact_status().
char * ast_sip_get_debug | ( | void | ) |
Retrieve the system debug setting (yes|no|host).
the | system debug setting. |
Definition at line 238 of file config_global.c.
References ao2_ref, ast_strdup, global_config::debug, DEFAULT_DEBUG, and get_global_cfg().
Referenced by check_debug().
void ast_sip_get_default_from_user | ( | char * | from_user, |
size_t | size | ||
) |
Retrieve the global default from user.
This is the value placed in outbound requests' From header if there is no better option (such as an endpoint-configured from_user or caller ID number).
[out] | from_user | The default from user |
size | The buffer size of from_user |
Definition at line 394 of file config_global.c.
References ao2_ref, ast_copy_string(), DEFAULT_FROM_USER, global_config::default_from_user, and get_global_cfg().
Referenced by sip_dialog_create_from().
void ast_sip_get_default_realm | ( | char * | realm, |
size_t | size | ||
) |
Retrieve the global default realm.
This is the value placed in outbound challenges' realm if there is no better option (such as an auth-configured realm).
[out] | realm | The default realm |
size | The buffer size of realm |
Definition at line 381 of file config_global.c.
References ao2_ref, ast_copy_string(), DEFAULT_REALM, global_config::default_realm, and get_global_cfg().
Referenced by create_artificial_auth(), and global_loaded().
char * ast_sip_get_default_voicemail_extension | ( | void | ) |
Retrieve the default voicemail extension.
the | default voicemail extension |
Definition at line 269 of file config_global.c.
References ao2_ref, ast_strdup, DEFAULT_VOICEMAIL_EXTENSION, global_config::default_voicemail_extension, and get_global_cfg().
Referenced by global_loaded().
const char * ast_sip_get_device_state | ( | const struct ast_sip_endpoint * | endpoint | ) |
Retrieve the device state for an endpoint.
endpoint | The endpoint whose state is to be retrieved. |
The | device state. |
Definition at line 1647 of file pjsip_configuration.c.
References ast_devstate2str(), ast_sorcery_object_get_id(), and MAX_OBJECT_FIELD.
Referenced by cli_endpoint_print_body(), format_ami_endpoints(), and sip_endpoint_to_ami().
unsigned int ast_sip_get_disable_multi_domain | ( | void | ) |
Retrieve the system setting 'disable multi domain'.
non | zero if disable multi domain. |
Definition at line 330 of file config_global.c.
References ao2_ref, DEFAULT_DISABLE_MULTI_DOMAIN, global_config::disable_multi_domain, and get_global_cfg().
Referenced by anonymous_identify(), find_endpoint(), request(), and sip_dialog_create_from().
struct ast_sip_endpoint * ast_sip_get_endpoint | ( | const char * | to, |
int | get_default_outbound, | ||
char ** | uri | ||
) |
Retrieves an endpoint and URI from the "to" string.
This URI is used as the Request URI.
Expects the given 'to' to be in one of the following formats: Why we allow so many is a mystery.
Basic:
endpoint : We'll get URI from the default aor/contact endpoint/aor : We'll get the URI from the specific aor/contact endpoint@domain : We toss the domain part and just use the endpoint
These all use the endpoint and specified URI:
endpoint/<sip[s]:host> endpoint/<sip[s]:user@host> endpoint/"Bob" <sip[s]:host> endpoint/"Bob" <sip[s]:user@host> endpoint/sip[s]:host endpoint/sip[s]:user@host endpoint/host endpoint/user@host
These all use the default endpoint and specified URI:
<sip[s]:host> <sip[s]:user@host> "Bob" <sip[s]:host> "Bob" <sip[s]:user@host> sip[s]:host sip[s]:user@host
These use the default endpoint and specified host:
host user@host
This form is similar to a dialstring:
PJSIP/user@endpoint
In this case, the user will be added to the endpoint contact's URI. If the contact URI already has a user, it will be replaced.
The ones that have the sip[s] scheme are the easiest to parse. The rest all have some issue.
endpoint vs host : We have to test for endpoint first endpoint/aor vs endpoint/host : We have to test for aor first What if there's an aor with the same name as the host? endpoint@domain vs user@host : We have to test for endpoint first. What if there's an endpoint with the same name as the user?
to | 'To' field with possible endpoint |
get_default_outbound | If nonzero, try to retrieve the default outbound endpoint if no endpoint was found. Otherwise, return NULL if no endpoint was found. |
uri | Pointer to a char* which will be set to the URI. Always must be ast_free'd by the caller - even if the return value is NULL! |
Definition at line 3249 of file res_pjsip.c.
References ao2_cleanup, ast_debug, ast_malloc, ast_sip_default_outbound_endpoint(), ast_strdup, ast_strdupa, handle_atsign(), handle_single_token(), handle_slash(), NULL, and S_OR.
Referenced by msg_send(), and refer_send().
char * ast_sip_get_endpoint_identifier_order | ( | void | ) |
Retrieve the global endpoint_identifier_order setting.
Specifies the order by which endpoint identifiers should be regarded.
the | global endpoint_identifier_order value |
Definition at line 285 of file config_global.c.
References ao2_ref, ast_strdup, DEFAULT_ENDPOINT_IDENTIFIER_ORDER, global_config::endpoint_identifier_order, and get_global_cfg().
Referenced by ast_sip_register_endpoint_identifier_with_name(), and global_loaded().
struct ast_endpoint_snapshot * ast_sip_get_endpoint_snapshot | ( | const struct ast_sip_endpoint * | endpoint | ) |
Retrieve the endpoint snapshot for an endpoint.
endpoint | The endpoint whose snapshot is to be retrieved. |
The | endpoint snapshot |
Definition at line 1655 of file pjsip_configuration.c.
References ast_endpoint_get_resource(), ast_endpoint_get_tech(), ast_endpoint_latest_snapshot(), and ast_sip_endpoint::persistent.
Referenced by active_channels_to_str(), ast_sip_for_each_channel(), and cli_endpoint_print_body().
struct ao2_container * ast_sip_get_endpoints | ( | void | ) |
Retrieve any endpoints available to sorcery.
Endpoints | available to sorcery, NULL if no endpoints found. |
Definition at line 2509 of file pjsip_configuration.c.
References AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sorcery_retrieve_by_fields(), endpoints, NULL, and sip_sorcery.
Referenced by ami_registrations_endpoints(), ami_show_endpoints(), and load_module().
int ast_sip_get_host_ip | ( | int | af, |
pj_sockaddr * | addr | ||
) |
Retrieve the local host address in IP form.
af | The address family to retrieve |
addr | A place to store the local host address |
0 | success |
-1 | failure |
Definition at line 2480 of file res_pjsip.c.
References ast_strlen_zero(), host_ip_ipv4, host_ip_ipv4_string, host_ip_ipv6, and host_ip_ipv6_string.
const char * ast_sip_get_host_ip_string | ( | int | af | ) |
Retrieve the local host address in string form.
af | The address family to retrieve |
non-NULL | success |
NULL | failure |
Definition at line 2493 of file res_pjsip.c.
References host_ip_ipv4_string, host_ip_ipv6_string, and NULL.
Referenced by create_local_sdp(), create_outgoing_sdp_stream(), and multihomed_rewrite_sdp().
unsigned int ast_sip_get_ignore_uri_user_options | ( | void | ) |
Retrieve the global setting 'ignore_uri_user_options'.
non | zero if ignore the user field options. |
Definition at line 468 of file config_global.c.
References ao2_ref, DEFAULT_IGNORE_URI_USER_OPTIONS, get_global_cfg(), and global_config::ignore_uri_user_options.
Referenced by find_registrar_aor().
unsigned int ast_sip_get_keep_alive_interval | ( | void | ) |
Retrieve the system keep alive interval setting.
the | keep alive interval. |
Definition at line 300 of file config_global.c.
References ao2_ref, DEFAULT_KEEPALIVE_INTERVAL, get_global_cfg(), and global_config::keep_alive_interval.
Referenced by keepalive_global_loaded().
unsigned int ast_sip_get_max_initial_qualify_time | ( | void | ) |
Retrieve the system max initial qualify time.
the | maximum initial qualify time. |
Definition at line 345 of file config_global.c.
References ao2_ref, DEFAULT_MAX_INITIAL_QUALIFY_TIME, get_global_cfg(), and global_config::max_initial_qualify_time.
Referenced by sip_options_determine_initial_qualify_time().
unsigned int ast_sip_get_mwi_disable_initial_unsolicited | ( | void | ) |
Retrieve the global setting 'disable sending unsolicited mwi on startup'.
non | zero if disable. |
Definition at line 438 of file config_global.c.
References ao2_ref, DEFAULT_MWI_DISABLE_INITIAL_UNSOLICITED, global_config::disable_initial_unsolicited, get_global_cfg(), and global_config::mwi.
Referenced by load_module(), and reload().
unsigned int ast_sip_get_mwi_tps_queue_high | ( | void | ) |
Retrieve the global MWI taskprocessor high water alert trigger level.
the | system MWI taskprocessor high water alert trigger level |
Definition at line 408 of file config_global.c.
References ao2_ref, DEFAULT_MWI_TPS_QUEUE_HIGH, get_global_cfg(), global_config::mwi, and global_config::tps_queue_high.
Referenced by global_loaded().
int ast_sip_get_mwi_tps_queue_low | ( | void | ) |
Retrieve the global MWI taskprocessor low water clear alert level.
the | system MWI taskprocessor low water clear alert level |
Definition at line 423 of file config_global.c.
References ao2_ref, DEFAULT_MWI_TPS_QUEUE_LOW, get_global_cfg(), global_config::mwi, and global_config::tps_queue_low.
Referenced by global_loaded().
unsigned int ast_sip_get_norefersub | ( | void | ) |
Retrieve the global setting 'norefersub'.
non | zero if norefersub is to be sent in "Supported" Headers |
Definition at line 528 of file config_global.c.
References ao2_ref, DEFAULT_NOREFERSUB, get_global_cfg(), and global_config::norefersub.
Referenced by load_module().
pjsip_endpoint * ast_sip_get_pjsip_endpoint | ( | void | ) |
Get a pointer to the PJSIP endpoint.
This is useful when modules have specific information they need to register with the PJSIP core.
NULL | endpoint has not been created yet. |
non-NULL | PJSIP endpoint. |
Definition at line 520 of file res_pjsip.c.
References ast_pjsip_endpoint.
Referenced by acl_on_rx_msg(), aoc_release_pool(), aoc_send_as_xml(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_init_options_handling(), ast_sip_create_response(), ast_sip_destroy_transport_events(), ast_sip_initialize_transport_events(), ast_sip_pubsub_register_body_generator(), ast_sip_send_response(), ast_sip_send_stateful_response(), ast_sip_session_defer_termination(), ast_sip_session_resume_reinvite(), authenticate(), cancel_publish_refresh(), cancel_registration(), channel_read_pjsip(), create_out_of_dialog_request(), digest_create_request_with_auth(), distribute(), distributor(), do_cli_dump_endpt(), endpoint_lookup(), endpt_send_request(), endpt_send_request_cb(), exten_state_data_alloc(), exten_state_data_destructor(), exten_state_publisher_cb(), filter_on_tx_message(), find_registrar_aor(), insert_user_in_contact_uri(), keepalive_transport_send_keepalive(), load_module(), logging_on_rx_msg(), logging_on_tx_msg(), notify_task(), on_rx_process_uris(), options_incoming_request(), parse_uri_cb(), pool_destroy_callback(), pre_session_setup(), publish_request_initial(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), register_aor(), registrar_on_rx_request(), reschedule_reinvite(), schedule_publish_refresh(), schedule_registration(), send_options_response(), session_reinvite_on_rx_request(), sip_dialog_create_contact(), sip_dialog_create_from(), sip_outbound_publisher_init(), sip_outbound_registration_regc_alloc(), sip_publication_respond(), sip_session_defer_termination_stop_timer(), subscription_persistence_load(), system_create_resolver_and_set_nameservers(), t38_change_state(), transport_apply(), and transport_create().
char * ast_sip_get_regcontext | ( | void | ) |
Retrieve the global regcontext setting.
the | global regcontext setting |
Definition at line 253 of file config_global.c.
References ao2_ref, ast_strdup, DEFAULT_REGCONTEXT, get_global_cfg(), and global_config::regcontext.
Referenced by ast_sip_persistent_endpoint_update_state().
unsigned int ast_sip_get_send_contact_status_on_update_registration | ( | void | ) |
Retrieve the global setting 'send_contact_status_on_update_registration'.
non | zero if need to send AMI ContactStatus event when a contact is updated. |
Definition at line 498 of file config_global.c.
References ao2_ref, DEFAULT_SEND_CONTACT_STATUS_ON_UPDATE_REGISTRATION, get_global_cfg(), and global_config::send_contact_status_on_update_registration.
Referenced by contact_observer_updated().
struct ast_sorcery * ast_sip_get_sorcery | ( | void | ) |
Get a pointer to the SIP sorcery structure.
NULL | sorcery has not been initialized |
non-NULL | sorcery structure |
Definition at line 2569 of file pjsip_configuration.c.
References sip_sorcery.
Referenced by acl_change_stasis_cb(), acl_on_rx_msg(), add_security_headers(), alloc_artificial_auth(), ami_show_endpoint(), ami_show_registration_contact_statuses(), ami_show_resource_lists(), ami_sip_qualify(), anonymous_identify(), aor_deleted_observer(), ast_res_pjsip_cleanup_options_handling(), ast_sip_cli_print_sorcery_objectset(), ast_sip_destroy_distributor(), ast_sip_destroy_sorcery_global(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_transport_management(), ast_sip_for_each_auth(), ast_sip_initialize_distributor(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_domain_alias(), ast_sip_initialize_sorcery_global(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_transport_management(), ast_sip_location_create_contact(), ast_sip_location_delete_contact(), ast_sip_location_prune_boot_contacts(), ast_sip_location_retrieve_aor(), ast_sip_location_retrieve_aor_contacts_nolock_filtered(), ast_sip_location_retrieve_contact(), ast_sip_location_update_contact(), ast_sip_retrieve_auths(), ast_sip_retrieve_auths_vector(), ast_sip_rewrite_uri_to_local(), ast_sip_set_tpselector_from_transport_name(), ast_sip_sorcery_object_to_ami(), asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), asterisk_publication_new(), asterisk_publication_send_refresh(), auth_observer(), can_reuse_registration(), chan_pjsip_devicestate(), check_expiration_thread(), check_state(), cli_aor_get_container(), cli_aor_retrieve_by_id(), cli_complete_endpoint(), cli_complete_registration(), cli_contact_get_container(), cli_endpoint_retrieve_by_id(), cli_get_aors(), cli_get_auths(), cli_get_container(), cli_iterate(), cli_iterator(), cli_qualify(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_retrieve_by_id(), cli_show_qualify_endpoint(), common_identify(), contact_observer_updated(), create_artificial_endpoint(), create_mwi_subscriptions(), create_rtp(), find_aor2(), find_aor_name(), find_endpoint(), format_ami_endpoint_identify(), format_ami_endpoint_transport(), get_all_contacts(), get_publishes_and_update_state(), get_registrations(), get_write_timeout(), handle_atsign(), handle_export_primitives(), handle_registration_response(), handle_single_token(), handle_slash(), line_identify(), load_module(), mwi_contact_changed(), mwi_contact_deleted(), mwi_subscription_shutdown(), on_rx_process_symmetric_transport(), permanent_uri_handler(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), pjsip_outbound_registration_metrics_init(), pjsip_outbound_registration_metrics_unload_cb(), process_nat(), publish_request_initial(), push_notify(), reload_module(), request(), reregister_all(), retrieve_resource_list(), send_unsolicited_mwi_notify(), sip_aor_to_ami(), sip_cli_print_global(), sip_options_aor_observer_modified_task(), sip_options_apply_aor_configuration(), sip_options_contact_add_management_task(), sip_options_init_task(), sip_options_qualify_contact(), sip_options_synchronize_task(), sub_persistence_recreate(), subscription_persistence_create(), subscription_persistence_load(), subscription_persistence_recreate(), subscription_persistence_remove(), subscription_persistence_update(), t38_initialize_session(), transfer(), and unload_module().
int ast_sip_get_transport_name | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_sip_uri * | sip_uri, | ||
char * | buf, | ||
size_t | buf_len | ||
) |
Get the transport name from an endpoint or request uri.
endpoint | |
sip_uri | |
buf | Buffer to receive transport name |
buf_len | Buffer length |
0 | Success |
-1 | Failure |
Definition at line 698 of file res_pjsip.c.
References ast_alloca, ast_copy_pj_str(), ast_copy_string(), AST_SIP_X_AST_TXP, AST_SIP_X_AST_TXP_LEN, ast_sockaddr_parse(), ast_strlen_zero(), buf, NULL, PARSE_PORT_FORBID, and ast_sip_endpoint::transport.
Referenced by ast_sip_set_tpselector_from_ep_or_uri().
struct ast_sip_transport_state * ast_sip_get_transport_state | ( | const char * | transport_id | ) |
Retrieve transport state.
transport_id |
transport_state |
Definition at line 1744 of file config_transport.c.
References ao2_bump, ao2_find, ao2_lock, ao2_ref, ao2_unlock, ast_sip_transport_state::flow, NULL, OBJ_SEARCH_KEY, ast_sip_transport_state::transport, and transport_states.
Referenced by ast_sip_message_apply_transport(), ast_sip_set_tpselector_from_transport(), ast_sip_transport_state_set_preferred_identity(), ast_sip_transport_state_set_service_routes(), ast_sip_transport_state_set_transport(), change_outgoing_sdp_stream_media_address(), create_rtp(), session_outgoing_nat_hook(), t38_initialize_session(), and transport_tls_verify().
struct ao2_container * ast_sip_get_transport_states | ( | void | ) |
Retrieves all transport states.
ao2_container |
Definition at line 1784 of file config_transport.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_callback, ao2_container_alloc_hash, DEFAULT_STATE_BUCKETS, NULL, OBJ_MULTIPLE, OBJ_NODATA, populate_transport_states(), transport_state_cmp(), transport_state_hash(), and transport_states.
Referenced by anonymous_identify(), ast_sip_find_transport_state_in_use(), find_endpoint(), get_udp_transport(), and get_write_timeout().
void ast_sip_get_unidentified_request_thresholds | ( | unsigned int * | count, |
unsigned int * | period, | ||
unsigned int * | prune_interval | ||
) |
Retrieve the unidentified request security event thresholds.
count | The maximum number of unidentified requests per source ip to accumulate before emitting a security event |
period | The period in seconds over which to accumulate unidentified requests |
prune_interval | The interval in seconds at which expired entries will be pruned |
Definition at line 360 of file config_global.c.
References ao2_ref, DEFAULT_UNIDENTIFIED_REQUEST_COUNT, DEFAULT_UNIDENTIFIED_REQUEST_PERIOD, DEFAULT_UNIDENTIFIED_REQUEST_PRUNE_INTERVAL, get_global_cfg(), global_config::unidentified_request_count, global_config::unidentified_request_period, and global_config::unidentified_request_prune_interval.
Referenced by global_loaded(), and prune_task().
unsigned int ast_sip_get_use_callerid_contact | ( | void | ) |
Retrieve the global setting 'use_callerid_contact'.
non | zero if CALLERID(num) is to be used as the default username in the contact |
Definition at line 483 of file config_global.c.
References ao2_ref, DEFAULT_USE_CALLERID_CONTACT, get_global_cfg(), and global_config::use_callerid_contact.
Referenced by set_from_header().
const int ast_sip_hangup_sip2cause | ( | int | cause | ) |
Convert SIP hangup causes to Asterisk hangup causes.
cause | SIP cause |
matched | cause code from causes.h |
Definition at line 3531 of file res_pjsip.c.
References AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, AST_CAUSE_BUSY, AST_CAUSE_CALL_REJECTED, AST_CAUSE_CONGESTION, AST_CAUSE_DESTINATION_OUT_OF_ORDER, AST_CAUSE_FACILITY_REJECTED, AST_CAUSE_FAILURE, AST_CAUSE_INTERWORKING, AST_CAUSE_INVALID_NUMBER_FORMAT, AST_CAUSE_NO_ANSWER, AST_CAUSE_NO_ROUTE_DESTINATION, AST_CAUSE_NO_USER_RESPONSE, AST_CAUSE_NORMAL, AST_CAUSE_NORMAL_TEMPORARY_FAILURE, AST_CAUSE_NUMBER_CHANGED, AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE, AST_CAUSE_UNALLOCATED, and AST_CAUSE_USER_BUSY.
Referenced by chan_pjsip_incoming_response_update_cause(), chan_pjsip_session_end(), and rfc3326_use_reason_header().
void ast_sip_header_to_security_mechanism | ( | const pjsip_generic_string_hdr * | hdr, |
struct ast_sip_security_mechanism_vector * | security_mechanisms | ||
) |
Append to security mechanism vector from SIP header.
hdr | The header of the security mechanisms. |
security_mechanisms | Vector of security mechanisms to append to. Header name must be one of Security-Client, Security-Server, Security-Verify. |
Definition at line 333 of file security_agreements.c.
References ast_copy_pj_str(), ast_sip_str_to_security_mechanism(), ast_skip_blanks(), ast_strsep(), AST_STRSEP_ALL, AST_VECTOR_APPEND, and buf.
Referenced by contact_add_security_headers_to_status(), and handle_registration_response().
struct ast_sip_endpoint * ast_sip_identify_endpoint | ( | pjsip_rx_data * | rdata | ) |
Determine the endpoint that has sent a SIP message.
This will call into each of the registered endpoint identifiers' identify_endpoint() callbacks until one returns a non-NULL endpoint. This will return an ao2 object. Its reference count will need to be decremented when completed using the endpoint.
rdata | The inbound SIP message to use when identifying the endpoint. |
NULL | No matching endpoint |
non-NULL | The matching endpoint |
Definition at line 330 of file res_pjsip.c.
References ast_assert, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, endpoint_identifier_list::identifier, ast_sip_endpoint_identifier::identify_endpoint, lock, NULL, and SCOPED_LOCK.
Referenced by endpoint_lookup().
int ast_sip_is_allowed_uri | ( | pjsip_uri * | uri | ) |
Check whether a pjsip_uri is allowed or not.
uri | The pjsip_uri to check |
1 | if allowed |
0 | if not allowed |
Definition at line 3472 of file res_pjsip.c.
References ast_sip_is_uri_sip_sips().
Referenced by endpoint_lookup(), get_destination(), on_rx_process_uris(), options_on_rx_request(), rx_data_to_ast_msg(), and set_redirecting_reason_by_cause().
int ast_sip_is_content_type | ( | pjsip_media_type * | content_type, |
char * | type, | ||
char * | subtype | ||
) |
Checks if the given content type matches type/subtype.
Compares the pjsip_media_type with the passed type and subtype and returns the result of that comparison. The media type parameters are ignored.
content_type | The pjsip_media_type structure to compare |
type | The media type to compare |
subtype | The media subtype to compare |
0 | No match |
-1 | Match |
Definition at line 2248 of file res_pjsip.c.
References compare(), and type.
Referenced by asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), check_content_type(), and pubsub_on_rx_notify_request().
int ast_sip_is_media_type_in | ( | pjsip_media_type * | a, |
... | |||
) |
Check if a media type is in a list of others.
a | pjsip_media_type to search for |
... | one or more pointers to pjsip_media_types the last of which must be "SENTINEL" |
1 | Media types are equal |
0 | Media types are not equal |
Definition at line 2228 of file res_pjsip.c.
References a, ast_assert, b, NULL, and SENTINEL.
Referenced by check_content_disposition().
int ast_sip_is_uri_sip_sips | ( | pjsip_uri * | uri | ) |
Check whether a pjsip_uri is SIP/SIPS or not.
uri | The pjsip_uri to check |
1 | if true |
0 | if false |
Definition at line 3467 of file res_pjsip.c.
Referenced by ast_sip_is_allowed_uri(), ast_sip_pjsip_uri_get_hostname(), ast_sip_pjsip_uri_get_other_param(), ast_sip_pjsip_uri_get_username(), filter_on_tx_message(), get_endpoint_details(), get_from_header(), publish_request_initial(), pubsub_on_rx_subscribe_request(), and sanitize_tdata().
int ast_sip_location_add_contact | ( | struct ast_sip_aor * | aor, |
const char * | uri, | ||
struct timeval | expiration_time, | ||
const char * | path_info, | ||
const char * | user_agent, | ||
const char * | via_addr, | ||
int | via_port, | ||
const char * | call_id, | ||
struct ast_sip_endpoint * | endpoint | ||
) |
Add a new contact to an AOR.
aor | Pointer to the AOR |
uri | Full contact URI |
expiration_time | Optional expiration time of the contact |
path_info | Path information |
user_agent | User-Agent header from REGISTER request |
via_addr | |
via_port | |
call_id | |
endpoint | The endpoint that resulted in the contact being added |
-1 | failure |
0 | success |
Definition at line 429 of file location.c.
References ao2_lock, ao2_unlock, ast_sip_contact::aor, ast_sip_location_add_contact_nolock(), ast_sip_contact::call_id, ast_sip_contact::endpoint, ast_sip_contact::expiration_time, ast_sip_contact::uri, ast_sip_contact::user_agent, ast_sip_contact::via_addr, and ast_sip_contact::via_port.
int ast_sip_location_add_contact_nolock | ( | struct ast_sip_aor * | aor, |
const char * | uri, | ||
struct timeval | expiration_time, | ||
const char * | path_info, | ||
const char * | user_agent, | ||
const char * | via_addr, | ||
int | via_port, | ||
const char * | call_id, | ||
struct ast_sip_endpoint * | endpoint | ||
) |
Add a new contact to an AOR without locking the AOR.
aor | Pointer to the AOR |
uri | Full contact URI |
expiration_time | Optional expiration time of the contact |
path_info | Path information |
user_agent | User-Agent header from REGISTER request |
via_addr | |
via_port | |
call_id | |
endpoint | The endpoint that resulted in the contact being added |
-1 | failure |
0 | success |
Definition at line 416 of file location.c.
References ao2_cleanup, ast_sip_contact::aor, ast_sip_location_create_contact(), ast_sip_contact::call_id, ast_sip_contact::endpoint, ast_sip_contact::expiration_time, ast_sip_contact::uri, ast_sip_contact::user_agent, ast_sip_contact::via_addr, and ast_sip_contact::via_port.
Referenced by ast_sip_location_add_contact().
struct ast_sip_contact * ast_sip_location_create_contact | ( | struct ast_sip_aor * | aor, |
const char * | uri, | ||
struct timeval | expiration_time, | ||
const char * | path_info, | ||
const char * | user_agent, | ||
const char * | via_addr, | ||
int | via_port, | ||
const char * | call_id, | ||
int | prune_on_boot, | ||
struct ast_sip_endpoint * | endpoint | ||
) |
Create a new contact for an AOR without locking the AOR.
aor | Pointer to the AOR |
uri | Full contact URI |
expiration_time | Optional expiration time of the contact |
path_info | Path information |
user_agent | User-Agent header from REGISTER request |
via_addr | |
via_port | |
call_id | |
prune_on_boot | Non-zero if the contact cannot survive a restart/boot. |
endpoint | The endpoint that resulted in the contact being added |
Definition at line 355 of file location.c.
References ao2_bump, ao2_ref, ast_sip_contact::aor, ast_config_AST_SYSTEM_NAME, ast_md5_hash(), ast_sip_get_sorcery(), ast_sorcery_alloc(), ast_sorcery_create(), ast_sorcery_object_get_id(), ast_string_field_set, ast_strlen_zero(), ast_sip_contact::authenticate_qualify, ast_sip_contact::call_id, ast_sip_contact::endpoint, ast_sip_contact::endpoint_name, ast_sip_contact::expiration_time, MAX_OBJECT_FIELD, name, NULL, ast_sip_contact::outbound_proxy, ast_sip_contact::path, ast_sip_contact::prune_on_boot, ast_sip_contact::qualify_frequency, ast_sip_contact::qualify_timeout, ast_sip_contact::reg_server, ast_sip_contact::uri, ast_sip_contact::user_agent, ast_sip_contact::via_addr, and ast_sip_contact::via_port.
Referenced by ast_sip_location_add_contact_nolock().
int ast_sip_location_delete_contact | ( | struct ast_sip_contact * | contact | ) |
Delete a contact.
contact | Contact object to delete |
-1 | failure |
0 | success |
Definition at line 450 of file location.c.
References ast_sip_get_sorcery(), and ast_sorcery_delete().
Referenced by contact_expire(), destroy_contact(), prune_boot_contacts_cb(), and registrar_contact_delete().
void ast_sip_location_prune_boot_contacts | ( | void | ) |
Prune the prune_on_boot contacts.
Definition at line 469 of file location.c.
References ao2_callback, ao2_ref, AST_RETRIEVE_FLAG_ALL, AST_RETRIEVE_FLAG_MULTIPLE, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_fields(), NULL, and prune_boot_contacts_cb().
Referenced by load_module().
struct ast_sip_aor * ast_sip_location_retrieve_aor | ( | const char * | aor_name | ) |
Retrieve a named AOR.
aor_name | Name of the AOR |
NULL | if not found |
non-NULL | if found |
Definition at line 147 of file location.c.
References ast_sip_get_sorcery(), and ast_sorcery_retrieve_by_id().
Referenced by ast_sip_for_each_aor(), ast_sip_location_retrieve_contact_and_aor_from_list_filtered(), find_aor(), find_aor2(), find_aor_for_resource(), find_registrar_aor(), handle_slash(), notify_endpoint(), pjsip_acf_dial_contacts_read(), register_contact_transport_remove_cb(), send_unsolicited_mwi_notify(), and vec_contact_cmp().
struct ao2_container * ast_sip_location_retrieve_aor_contacts | ( | const struct ast_sip_aor * | aor | ) |
Retrieve all contacts currently available for an AOR.
aor | Pointer to the AOR |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 247 of file location.c.
References AST_SIP_CONTACT_FILTER_DEFAULT, and ast_sip_location_retrieve_aor_contacts_filtered().
Referenced by ast_sip_for_each_contact(), find_contact(), format_ami_aor_handler(), gather_contacts_for_aor(), notify_endpoint(), pjsip_aor_function_read(), and send_unsolicited_mwi_notify().
struct ao2_container * ast_sip_location_retrieve_aor_contacts_filtered | ( | const struct ast_sip_aor * | aor, |
unsigned int | flags | ||
) |
Retrieve all contacts currently available for an AOR and filter based on flags.
aor | Pointer to the AOR |
flags | Filtering flags |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 252 of file location.c.
References ao2_lock, ao2_unlock, and ast_sip_location_retrieve_aor_contacts_nolock_filtered().
Referenced by ast_sip_location_retrieve_aor_contacts(), ast_sip_location_retrieve_first_aor_contact_filtered(), and pjsip_acf_dial_contacts_read().
struct ao2_container * ast_sip_location_retrieve_aor_contacts_nolock | ( | const struct ast_sip_aor * | aor | ) |
Retrieve all contacts currently available for an AOR without locking the AOR.
aor | Pointer to the AOR |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 214 of file location.c.
References AST_SIP_CONTACT_FILTER_DEFAULT, and ast_sip_location_retrieve_aor_contacts_nolock_filtered().
Referenced by register_aor().
struct ao2_container * ast_sip_location_retrieve_aor_contacts_nolock_filtered | ( | const struct ast_sip_aor * | aor, |
unsigned int | flags | ||
) |
Retrieve all contacts currently available for an AOR without locking the AOR and filter based on flags.
aor | Pointer to the AOR |
flags | Filtering flags |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 219 of file location.c.
References ao2_callback, AST_SIP_CONTACT_FILTER_REACHABLE, ast_sip_get_sorcery(), ast_sorcery_object_get_id(), ast_sorcery_retrieve_by_prefix(), contact_expire(), contact_link_static(), contact_remove_unreachable(), NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, ast_sip_aor::permanent_contacts, and prefix.
Referenced by ast_sip_location_retrieve_aor_contacts_filtered(), and ast_sip_location_retrieve_aor_contacts_nolock().
struct ast_sip_contact * ast_sip_location_retrieve_contact | ( | const char * | contact_name | ) |
Retrieve a named contact.
contact_name | Name of the contact |
NULL | if not found |
non-NULL | if found |
Definition at line 350 of file location.c.
References ast_sip_get_sorcery(), and ast_sorcery_retrieve_by_id().
Referenced by register_contact_transport_remove_cb().
void ast_sip_location_retrieve_contact_and_aor_from_list | ( | const char * | aor_list, |
struct ast_sip_aor ** | aor, | ||
struct ast_sip_contact ** | contact | ||
) |
Retrieve the first bound contact AND the AOR chosen from a list of AORs.
aor_list | A comma-separated list of AOR names |
aor | The chosen AOR |
contact | The chosen contact |
Definition at line 266 of file location.c.
References AST_SIP_CONTACT_FILTER_DEFAULT, and ast_sip_location_retrieve_contact_and_aor_from_list_filtered().
Referenced by ast_sip_location_retrieve_contact_from_aor_list().
void ast_sip_location_retrieve_contact_and_aor_from_list_filtered | ( | const char * | aor_list, |
unsigned int | flags, | ||
struct ast_sip_aor ** | aor, | ||
struct ast_sip_contact ** | contact | ||
) |
Retrieve the first bound contact AND the AOR chosen from a list of AORs and filter based on flags.
aor_list | A comma-separated list of AOR names |
flags | Filtering flags |
aor | The chosen AOR |
contact | The chosen contact |
Definition at line 272 of file location.c.
References ao2_ref, ast_log, ast_sip_location_retrieve_aor(), ast_sip_location_retrieve_first_aor_contact_filtered(), ast_strdupa, ast_strip(), ast_strlen_zero(), LOG_WARNING, NULL, and strsep().
Referenced by ast_sip_location_retrieve_contact_and_aor_from_list(), and ast_sip_session_create_outgoing().
struct ast_sip_contact * ast_sip_location_retrieve_contact_from_aor_list | ( | const char * | aor_list | ) |
Retrieve the first bound contact from a list of AORs.
aor_list | A comma-separated list of AOR names |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 304 of file location.c.
References ao2_cleanup, ast_sip_contact::aor, and ast_sip_location_retrieve_contact_and_aor_from_list().
Referenced by ast_sip_create_subscription(), create_out_of_dialog_request(), handle_atsign(), handle_single_token(), insert_user_in_contact_uri(), mwi_contact_deleted(), and transfer().
struct ao2_container * ast_sip_location_retrieve_contacts_from_aor_list | ( | const char * | aor_list | ) |
Retrieve all contacts from a list of AORs.
aor_list | A comma-separated list of AOR names |
NULL | if no contacts available |
non-NULL | container (which must be freed) if contacts available |
Definition at line 335 of file location.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_container_alloc_list, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, ast_sip_for_each_aor(), gather_contacts_for_aor(), NULL, and permanent_uri_sort_fn().
Referenced by add_security_headers(), and handle_registration_response().
struct ast_sip_contact * ast_sip_location_retrieve_first_aor_contact | ( | const struct ast_sip_aor * | aor | ) |
Retrieve the first bound contact for an AOR.
aor | Pointer to the AOR |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 194 of file location.c.
References ast_sip_contact::aor, AST_SIP_CONTACT_FILTER_DEFAULT, and ast_sip_location_retrieve_first_aor_contact_filtered().
Referenced by handle_slash().
struct ast_sip_contact * ast_sip_location_retrieve_first_aor_contact_filtered | ( | const struct ast_sip_aor * | aor, |
unsigned int | flags | ||
) |
Retrieve the first bound contact for an AOR and filter based on flags.
aor | Pointer to the AOR |
flags | Filtering flags |
NULL | if no contacts available |
non-NULL | if contacts available |
Definition at line 199 of file location.c.
References ao2_callback, ao2_cleanup, ao2_container_count(), ast_sip_contact::aor, ast_sip_location_retrieve_aor_contacts_filtered(), and NULL.
Referenced by ast_sip_location_retrieve_contact_and_aor_from_list_filtered(), and ast_sip_location_retrieve_first_aor_contact().
int ast_sip_location_update_contact | ( | struct ast_sip_contact * | contact | ) |
Update a contact.
contact | New contact object with details |
-1 | failure |
0 | success |
Definition at line 445 of file location.c.
References ast_sip_get_sorcery(), and ast_sorcery_update().
void ast_sip_message_apply_transport | ( | const char * | transport_name, |
pjsip_tx_data * | tdata | ||
) |
Apply the configuration for a transport to an outgoing message.
transport_name | The name of the transport to apply configuration from |
tdata | The SIP message |
Definition at line 301 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_add_header(), ast_sip_get_transport_state(), ast_strlen_zero(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sip_transport_state::flow, ast_sip_transport_state::preferred_identity, and ast_sip_transport_state::service_routes.
Referenced by ast_sip_send_out_of_dialog_request(), handle_outgoing_request(), handle_outgoing_response(), and supplement_outgoing_response().
void ast_sip_modify_id_header | ( | pj_pool_t * | pool, |
pjsip_fromto_hdr * | id_hdr, | ||
const struct ast_party_id * | id | ||
) |
Set name and number information on an identity header.
pool | Memory pool to use for string duplication |
id_hdr | A From, P-Asserted-Identity, or Remote-Party-ID header to modify |
id | The identity information to apply to the header |
Definition at line 2850 of file res_pjsip.c.
References ast_alloca, ast_escape_quoted(), ast_strlen_zero(), id, and NULL.
Referenced by add_pai_header(), add_rpid_header(), and set_from_header().
void ast_sip_persistent_endpoint_publish_contact_state | ( | const char * | endpoint_name, |
const struct ast_sip_contact_status * | contact_status | ||
) |
Publish the change of state for a contact.
endpoint_name | The SIP endpoint name. |
contact_status | The contact status. |
Definition at line 1489 of file pjsip_configuration.c.
References ao2_find, ao2_ref, ast_sip_contact_status::aor, ast_endpoint_blob_publish(), ast_endpoint_contact_state_type(), ast_endpoint_get_resource(), ast_json_pack(), ast_json_unref(), ast_sip_get_contact_status_label(), sip_persistent_endpoint::endpoint, OBJ_SEARCH_KEY, persistent_endpoints, ast_sip_contact_status::rtt, ast_sip_contact_status::status, and ast_sip_contact_status::uri.
Referenced by sip_options_publish_contact_state().
int ast_sip_persistent_endpoint_update_state | ( | const char * | endpoint_name, |
enum ast_endpoint_state | state | ||
) |
Change state of a persistent endpoint.
endpoint_name | The SIP endpoint name to change state. |
state | The new state |
0 | Success |
-1 | Endpoint not found |
Definition at line 1432 of file pjsip_configuration.c.
References ao2_find, ao2_ref, ast_add_extension(), ast_context_remove_extension(), AST_DEVICE_UNKNOWN, AST_DEVSTATE_CACHABLE, ast_devstate_changed(), ast_endpoint_blob_publish(), ast_endpoint_get_resource(), ast_endpoint_get_state(), AST_ENDPOINT_OFFLINE, AST_ENDPOINT_ONLINE, ast_endpoint_set_state(), ast_endpoint_state_type(), ast_exists_extension(), ast_free, ast_free_ptr(), ast_json_pack(), ast_json_unref(), ast_sip_get_regcontext(), ast_strdup, ast_strlen_zero(), ast_verb, E_MATCH, sip_persistent_endpoint::endpoint, NULL, OBJ_SEARCH_KEY, pbx_find_extension(), persistent_endpoints, regcontext, and pbx_find_info::stacklen.
Referenced by sip_options_synchronize_endpoint(), sip_options_unused_endpoint_state_compositor(), and sip_options_update_endpoint_state_compositor_aor().
const pj_str_t * ast_sip_pjsip_uri_get_hostname | ( | pjsip_uri * | uri | ) |
Get the host portion of the pjsip_uri.
uri | The pjsip_uri to get the host from |
Definition at line 3496 of file res_pjsip.c.
References AST_PJ_STR_EMPTY, and ast_sip_is_uri_sip_sips().
Referenced by dialog_info_generate_body_content(), find_aor2(), get_endpoint_details(), get_from_header(), and set_sipdomain_variable().
struct pjsip_param * ast_sip_pjsip_uri_get_other_param | ( | pjsip_uri * | uri, |
const pj_str_t * | param_str | ||
) |
Find an 'other' SIP/SIPS URI parameter by name.
A convenience function to find a named parameter from a SIP/SIPS URI. This function will not find the following standard SIP/SIPS URI parameters which are stored separately by PJSIP:
user
method
transport
ttl
lr
maddr
uri | The pjsip_uri to get the parameter from |
param_str | The name of the parameter to find |
Definition at line 3511 of file res_pjsip.c.
References ast_sip_is_uri_sip_sips(), and NULL.
Referenced by get_uri_option_line(), and set_redirecting_reason_by_cause().
const pj_str_t * ast_sip_pjsip_uri_get_username | ( | pjsip_uri * | uri | ) |
Get the user portion of the pjsip_uri.
uri | The pjsip_uri to get the user from |
Definition at line 3477 of file res_pjsip.c.
References AST_PJ_STR_EMPTY, and ast_sip_is_uri_sip_sips().
Referenced by add_diversion_header(), endpoint_lookup(), find_aor2(), get_destination(), get_from_header(), options_on_rx_request(), publish_request_initial(), pubsub_on_rx_subscribe_request(), rx_data_to_ast_msg(), set_id_from_hdr(), and sub_persistence_recreate().
char * ast_sip_rdata_get_header_value | ( | pjsip_rx_data * | rdata, |
const pj_str_t | str | ||
) |
Get a specific header value from rdata.
rdata | The rdata |
str | The header to find |
NULL | on failure |
The | header value on success |
Definition at line 345 of file res_pjsip.c.
Referenced by stir_shaken_incoming_request().
int ast_sip_register_authenticator | ( | struct ast_sip_authenticator * | auth | ) |
Register a SIP authenticator.
An authenticator has three main purposes: 1) Determining if authentication should be performed on an incoming request 2) Gathering credentials necessary for issuing an authentication challenge 3) Authenticating a request that has credentials
Asterisk provides a default authenticator, but it may be replaced by a custom one if desired.
auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 140 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and registered_authenticator.
Referenced by load_module().
void ast_sip_register_endpoint_formatter | ( | struct ast_sip_endpoint_formatter * | obj | ) |
Register an endpoint formatter.
obj | the formatter to register |
Definition at line 481 of file res_pjsip.c.
References AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_cli_entry::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_init_options_handling(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), and load_module().
int ast_sip_register_endpoint_identifier | ( | struct ast_sip_endpoint_identifier * | identifier | ) |
Register a SIP endpoint identifier.
An endpoint identifier's purpose is to determine which endpoint a given SIP message has come from.
Multiple endpoint identifiers may be registered so that if an endpoint cannot be identified by one identifier, it may be identified by another.
Asterisk provides two endpoint identifiers. One identifies endpoints based on the user part of the From header URI. The other identifies endpoints based on the source IP address.
If the order in which endpoint identifiers is run is important to you, then be sure to load individual endpoint identifier modules in the order you wish for them to be run in modules.conf
identifier | The SIP endpoint identifier to register |
0 | Success |
-1 | Failure |
Definition at line 310 of file res_pjsip.c.
References ast_sip_register_endpoint_identifier_with_name(), endpoint_identifier_list::identifier, and NULL.
Referenced by load_module().
int ast_sip_register_endpoint_identifier_with_name | ( | struct ast_sip_endpoint_identifier * | identifier, |
const char * | name | ||
) |
Register a SIP endpoint identifier with a name.
An endpoint identifier's purpose is to determine which endpoint a given SIP message has come from.
Multiple endpoint identifiers may be registered so that if an endpoint cannot be identified by one identifier, it may be identified by another.
identifier | The SIP endpoint identifier to register |
name | The name of the endpoint identifier |
0 | Success |
-1 | Failure |
Definition at line 233 of file res_pjsip.c.
References ast_calloc, ast_debug, ast_free, ast_log, AST_RWLIST_EMPTY, AST_RWLIST_INSERT_AFTER, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_HEAD, AST_RWLIST_INSERT_TAIL, AST_RWLIST_NEXT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_sip_get_endpoint_identifier_order(), ast_strlen_zero(), current, endpoint_identifier_list::identifier, lock, LOG_ERROR, name, endpoint_identifier_list::name, endpoint_identifier_list::priority, and SCOPED_LOCK.
Referenced by ast_sip_register_endpoint_identifier(), and load_module().
int ast_sip_register_outbound_authenticator | ( | struct ast_sip_outbound_authenticator * | outbound_auth | ) |
Register an outbound SIP authenticator.
An outbound authenticator is responsible for creating responses to authentication challenges by remote endpoints.
outbound_auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 191 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and registered_outbound_authenticator.
Referenced by load_module().
int ast_sip_register_service | ( | pjsip_module * | module | ) |
Register a SIP service in Asterisk.
This is more-or-less a wrapper around pjsip_endpt_register_module(). Registering a service makes it so that PJSIP will call into the service at appropriate times. For more information about PJSIP module callbacks, see the PJSIP documentation. Asterisk modules that call this function will likely do so at module load time.
module | The module that is to be registered with PJSIP |
0 | Success |
-1 | Failure |
Definition at line 117 of file res_pjsip.c.
References ast_sip_push_task_wait_servant(), NULL, and register_service().
Referenced by ast_res_pjsip_init_message_filter(), ast_sip_initialize_distributor(), ast_sip_initialize_global_headers(), ast_sip_initialize_transport_management(), and load_module().
void ast_sip_register_supplement | ( | struct ast_sip_supplement * | supplement | ) |
Register a supplement to SIP out of dialog processing.
This allows for someone to insert themselves in the processing of out of dialog SIP requests and responses. This, for example could allow for a module to set channel data based on headers in an incoming message. Similarly, a module could reject an incoming request if desired.
supplement | The supplement to register |
Definition at line 1456 of file res_pjsip.c.
References AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_supplement::next, ast_sip_supplement::priority, and SCOPED_LOCK.
Referenced by ast_res_pjsip_init_message_filter(), and load_module().
void ast_sip_remove_headers_by_name_and_value | ( | pjsip_msg * | msg, |
const pj_str_t * | hdr_name, | ||
const char * | value | ||
) |
Removes all headers of a specific name and value from a pjsip_msg.
msg | PJSIP message from which to remove headers. |
hdr_name | Name of the header to remove. |
value | Optional string value of the header to remove. If NULL, remove all headers of given hdr_name. |
Definition at line 203 of file security_agreements.c.
Referenced by add_security_headers().
void ast_sip_report_auth_challenge_sent | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
pjsip_tx_data * | tdata | ||
) |
Send a security event notification for when an authentication challenge is sent.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
tdata | Sent message |
Definition at line 197 of file res/res_pjsip/security_events.c.
References ast_copy_pj_str(), AST_SEC_EVT, AST_SECURITY_EVENT_CHAL_SENT, AST_SECURITY_EVENT_CHAL_SENT_VERSION, ast_security_event_report(), ast_security_event_chal_sent::common, ast_security_event_common::event_type, get_account_id(), NULL, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_auth_failed_challenge_response | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when a challenge response has failed.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 130 of file res/res_pjsip/security_events.c.
References ast_copy_pj_str(), AST_SEC_EVT, AST_SECURITY_EVENT_CHAL_RESP_FAILED, AST_SECURITY_EVENT_CHAL_RESP_FAILED_VERSION, ast_security_event_report(), ast_security_event_chal_resp_failed::common, ast_security_event_common::event_type, get_account_id(), NULL, ast_security_event_chal_resp_failed::response, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_auth_success | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when authentication succeeds.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 168 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_SUCCESSFUL_AUTH, AST_SECURITY_EVENT_SUCCESSFUL_AUTH_VERSION, ast_security_event_successful_auth::common, ast_security_event_common::event_type, get_account_id(), NULL, security_event_get_transport(), and security_event_populate().
Referenced by authenticate().
void ast_sip_report_failed_acl | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
const char * | name | ||
) |
Send a security event notification for when an ACL check fails.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
name | Name of the ACL |
Definition at line 102 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_FAILED_ACL, AST_SECURITY_EVENT_FAILED_ACL_VERSION, ast_security_event_report(), ast_security_event_failed_acl::common, ast_security_event_common::event_type, get_account_id(), name, security_event_get_transport(), and security_event_populate().
Referenced by apply_endpoint_acl(), apply_endpoint_contact_acl(), and registrar_on_rx_request().
void ast_sip_report_invalid_endpoint | ( | const char * | name, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when an invalid endpoint is requested.
name | Name of the endpoint requested |
rdata | Received message |
Definition at line 75 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_INVAL_ACCT_ID, AST_SECURITY_EVENT_INVAL_ACCT_ID_VERSION, ast_security_event_report(), ast_security_event_inval_acct_id::common, ast_security_event_common::event_type, name, security_event_get_transport(), and security_event_populate().
Referenced by check_endpoint(), and endpoint_lookup().
void ast_sip_report_mem_limit | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Send a security event notification for when a memory limit is hit.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
Definition at line 259 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, AST_SECURITY_EVENT_MEM_LIMIT, AST_SECURITY_EVENT_MEM_LIMIT_VERSION, ast_security_event_report(), ast_security_event_mem_limit::common, ast_security_event_common::event_type, get_account_id(), security_event_get_transport(), and security_event_populate().
void ast_sip_report_req_no_support | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata, | ||
const char * | req_type | ||
) |
Send a security event notification for when a request is not supported.
endpoint | Pointer to the endpoint in use |
rdata | Received message |
req_type | the type of request |
Definition at line 230 of file res/res_pjsip/security_events.c.
References AST_SEC_EVT, ast_security_event_report(), AST_SECURITY_EVENT_REQ_NO_SUPPORT, AST_SECURITY_EVENT_REQ_NO_SUPPORT_VERSION, ast_security_event_req_no_support::common, ast_security_event_common::event_type, get_account_id(), security_event_get_transport(), and security_event_populate().
Referenced by find_registrar_aor(), and registrar_on_rx_request().
int ast_sip_requires_authentication | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Determine if an incoming request requires authentication.
This calls into the registered authenticator's requires_authentication callback in order to determine if the request requires authentication.
If there is no registered authenticator, then authentication will be assumed not to be required.
endpoint | The endpoint from which the request originates |
rdata | The incoming SIP request |
non-zero | The request requires authentication |
0 | The request does not require authentication |
Definition at line 163 of file res_pjsip.c.
References ast_sip_endpoint::allow_unauthenticated_options, ast_debug, ast_log, LOG_WARNING, registered_authenticator, and ast_sip_authenticator::requires_authentication.
Referenced by authenticate().
int ast_sip_retrieve_auths | ( | const struct ast_sip_auth_vector * | auths, |
struct ast_sip_auth ** | out | ||
) |
Retrieve relevant SIP auth structures from sorcery.
auths | Vector of sorcery IDs of auth credentials to retrieve | |
[out] | out | The retrieved auths are stored here |
Definition at line 2525 of file pjsip_configuration.c.
References ast_log, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, LOG_NOTICE, name, out, and SIP_SORCERY_AUTH_TYPE.
Referenced by digest_check_auth(), and set_outbound_initial_authentication_credentials().
int ast_sip_retrieve_auths_vector | ( | const struct ast_sip_auth_vector * | auth_ids, |
struct ast_sip_auth_objects_vector * | auth_objects | ||
) |
Retrieve relevant SIP auth structures from sorcery as a vector.
auth_ids | Vector of sorcery IDs of auth credentials to retrieve | |
[out] | auth_objects | A pointer ast_sip_auth_objects_vector to hold the objects |
0 | Success |
-1 | Number of auth objects found is less than the number of names supplied. |
Definition at line 2550 of file pjsip_configuration.c.
References ast_log, ast_sip_get_sorcery(), ast_sorcery_retrieve_by_id(), AST_VECTOR_APPEND, AST_VECTOR_GET, AST_VECTOR_SIZE, LOG_WARNING, name, and SIP_SORCERY_AUTH_TYPE.
Referenced by digest_create_request_with_auth().
int ast_sip_rewrite_uri_to_local | ( | pjsip_sip_uri * | uri, |
pjsip_tx_data * | tdata | ||
) |
Replace domain and port of SIP URI to point to (external) signaling address of this Asterisk instance.
uri | |
tdata |
0 | success |
-1 | failure |
Definition at line 605 of file res_pjsip.c.
References ao2_cleanup, ast_sip_find_transport_state_in_use(), ast_sip_get_contact_sip_uri(), ast_sip_get_sorcery(), ast_sip_set_request_transport_details(), ast_sip_transport_is_local, ast_sockaddr_isnull(), ast_sockaddr_parse(), ast_sockaddr_set_port, ast_sockaddr_stringify_host(), ast_sorcery_retrieve_by_id(), NULL, PARSE_PORT_FORBID, RAII_VAR, and ast_sip_transport_state::transport.
Referenced by refer_on_tx_request().
int ast_sip_security_mechanism_vector_init | ( | struct ast_sip_security_mechanism_vector * | security_mechanism, |
const char * | value | ||
) |
Initialize security mechanism vector from string of security mechanisms.
security_mechanism | Pointer to vector of security mechanisms to initialize. |
value | String of security mechanisms as defined in RFC 3329. |
0 | Success |
non-zero | Failure |
Definition at line 360 of file security_agreements.c.
References ast_sip_security_mechanisms_vector_destroy(), ast_sip_str_to_security_mechanism(), ast_strdupa, ast_strsep(), AST_STRSEP_ALL, AST_VECTOR_APPEND, AST_VECTOR_INIT, NULL, and value.
Referenced by security_mechanism_handler(), and security_mechanisms_handler().
int ast_sip_security_mechanisms_to_str | ( | const struct ast_sip_security_mechanism_vector * | security_mechanisms, |
int | add_qvalue, | ||
char ** | buf | ||
) |
Writes the security mechanisms of an endpoint into a buffer as a string and returns the buffer.
endpoint | Pointer to endpoint. |
add_qvalue | If non-zero, the q-value is printed as well |
buf | The buffer to write the string into |
0 | Success |
non-zero | Failure |
Definition at line 162 of file security_agreements.c.
References ast_free, ast_str_append(), ast_str_create, ast_str_truncate(), ast_strdup, AST_VECTOR_GET, AST_VECTOR_SIZE, buf, MAX_OBJECT_FIELD, NULL, RAII_VAR, security_mechanism_to_str(), str, and tmp_buf.
Referenced by security_mechanism_to_str().
void ast_sip_security_mechanisms_vector_copy | ( | struct ast_sip_security_mechanism_vector * | dst, |
const struct ast_sip_security_mechanism_vector * | src | ||
) |
Duplicate a security mechanism.
dst | Security mechanism to duplicate to. |
src | Security mechanism to duplicate. |
Definition at line 81 of file security_agreements.c.
References ast_sip_security_mechanisms_vector_destroy(), AST_VECTOR_APPEND, AST_VECTOR_GET, AST_VECTOR_SIZE, and security_mechanisms_copy().
Referenced by sip_contact_status_copy(), and sip_outbound_registration_perform().
void ast_sip_security_mechanisms_vector_destroy | ( | struct ast_sip_security_mechanism_vector * | security_mechanisms | ) |
Free contents of a security mechanism vector.
security_mechanisms | Vector whose contents are to be freed |
Definition at line 94 of file security_agreements.c.
References AST_VECTOR_FREE, AST_VECTOR_RESET, and security_mechanism_destroy().
Referenced by ast_sip_security_mechanism_vector_init(), ast_sip_security_mechanisms_vector_copy(), endpoint_destructor(), handle_client_state_destruction(), sip_contact_status_dtor(), sip_outbound_registration_destroy(), and sip_outbound_registration_perform().
int ast_sip_send_out_of_dialog_request | ( | pjsip_tx_data * | tdata, |
struct ast_sip_endpoint * | endpoint, | ||
int | timeout, | ||
void * | token, | ||
void(*)(void *token, pjsip_event *e) | callback | ||
) |
General purpose method for sending an Out-Of-Dialog SIP request.
This is a companion function for ast_sip_create_request. The request created there can be passed to this function, though any request may be passed in.
This will automatically set up handling outbound authentication challenges if they arrive.
tdata | The request to send |
endpoint | Optional. If specified, the out-of-dialog request is sent to the endpoint. |
timeout | If non-zero, after the timeout the transaction will be terminated and the callback will be called with the PJSIP_EVENT_TIMER type. |
token | Data to be passed to the callback upon receipt of out-of-dialog response. |
callback | Callback to be called upon receipt of out-of-dialog response. |
0 | Success |
-1 | Failure (out-of-dialog callback will not be called.) |
Definition at line 1938 of file res_pjsip.c.
References ao2_cleanup, AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_sip_message_apply_transport(), ast_sip_mod_data_get, ast_sip_mod_data_set, does_method_match(), ast_sip_contact::endpoint, endpt_send_request(), ast_sip_supplement::method, MOD_DATA_CONTACT, NULL, ast_sip_supplement::outgoing_request, send_request_cb(), send_request_data_alloc(), supplement_module, and ast_sip_endpoint::transport.
Referenced by ast_sip_send_request(), and sip_options_qualify_contact().
int ast_sip_send_request | ( | pjsip_tx_data * | tdata, |
struct pjsip_dialog * | dlg, | ||
struct ast_sip_endpoint * | endpoint, | ||
void * | token, | ||
void(*)(void *token, pjsip_event *e) | callback | ||
) |
General purpose method for sending a SIP request.
This is a companion function for ast_sip_create_request. The request created there can be passed to this function, though any request may be passed in.
This will automatically set up handling outbound authentication challenges if they arrive.
tdata | The request to send |
dlg | Optional. The dialog in which the request is sent. Otherwise it is out-of-dialog. |
endpoint | Optional. If specified, the out-of-dialog request is sent to the endpoint. |
token | Data to be passed to the callback upon receipt of out-of-dialog response. |
callback | Callback to be called upon receipt of out-of-dialog response. |
0 | Success |
-1 | Failure (out-of-dialog callback will not be called.) |
Definition at line 1979 of file res_pjsip.c.
References ast_assert, ast_sip_send_out_of_dialog_request(), ast_sip_contact::endpoint, and send_in_dialog_request().
Referenced by msg_send(), notify_channel(), notify_contact(), notify_uri(), refer_client_on_evsub_state(), send_unsolicited_mwi_notify_to_contact(), and sendtext().
int ast_sip_send_response | ( | pjsip_response_addr * | res_addr, |
pjsip_tx_data * | tdata, | ||
struct ast_sip_endpoint * | sip_endpoint | ||
) |
Send a response to an out of dialog request.
Use this function sparingly, since this does not create a transaction within PJSIP. This means that if the request is retransmitted, it is your responsibility to detect this and not process the same request twice, and to send the same response for each retransmission.
res_addr | The response address for this response |
tdata | The response to send |
sip_endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 2396 of file res_pjsip.c.
References ast_sip_get_pjsip_endpoint(), NULL, status, and supplement_outgoing_response().
int ast_sip_send_stateful_response | ( | pjsip_rx_data * | rdata, |
pjsip_tx_data * | tdata, | ||
struct ast_sip_endpoint * | sip_endpoint | ||
) |
Send a stateful response to an out of dialog request.
This creates a transaction within PJSIP, meaning that if the request that we are responding to is retransmitted, we will not attempt to re-handle the request.
rdata | The request that is being responded to |
tdata | The response to send |
sip_endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 2424 of file res_pjsip.c.
References ast_sip_get_pjsip_endpoint(), clean_contact_from_tdata(), NULL, pool_destroy_callback(), and supplement_outgoing_response().
Referenced by register_aor(), send_options_response(), and send_response().
struct ast_sip_service_route_vector * ast_sip_service_route_vector_alloc | ( | void | ) |
Allocate a vector of service routes.
non-NULL | success |
NULL | failure |
Definition at line 352 of file config_transport.c.
References ast_calloc, AST_VECTOR_INIT, and NULL.
Referenced by save_response_fields_to_transport().
void ast_sip_service_route_vector_destroy | ( | struct ast_sip_service_route_vector * | service_routes | ) |
Destroy a vector of service routes.
service_routes | A vector of service routes |
Definition at line 366 of file config_transport.c.
References ast_free, and AST_VECTOR_CALLBACK_VOID.
Referenced by ast_sip_transport_state_set_service_routes(), and save_response_fields_to_transport().
int ast_sip_set_id_connected_line | ( | struct pjsip_rx_data * | rdata, |
struct ast_party_id * | id | ||
) |
Set the ID for a connected line update.
-1 | on failure, 0 on success |
Definition at line 2822 of file res_pjsip.c.
References set_id_from_pai(), and set_id_from_rpid().
Referenced by update_incoming_connected_line().
int ast_sip_set_id_from_invite | ( | struct pjsip_rx_data * | rdata, |
struct ast_party_id * | id, | ||
struct ast_party_id * | default_id, | ||
int | trust_inbound | ||
) |
Set the ID from an INVITE.
rdata | |
id | ID structure to fill |
default_id | Default ID structure with data to use (for non-trusted endpoints) |
trust_inbound | Whether or not the endpoint is trusted (controls whether PAI or RPID can be used) |
-1 | on failure, 0 on success |
Definition at line 2827 of file res_pjsip.c.
References ast_free, ast_party_id_copy(), ast_strdup, id, ast_party_id::number, set_id_from_from(), set_id_from_pai(), set_id_from_rpid(), ast_party_id::tag, and ast_party_number::valid.
Referenced by caller_id_incoming_request(), and fetch_callerid_num().
int ast_sip_set_outbound_proxy | ( | pjsip_tx_data * | tdata, |
const char * | proxy | ||
) |
Set the outbound proxy for an outbound SIP message.
tdata | The message to set the outbound proxy on |
proxy | SIP uri of the proxy |
0 | Success |
-1 | Failure |
Definition at line 1992 of file res_pjsip.c.
Referenced by create_out_of_dialog_request(), path_outgoing_request(), and sip_options_qualify_contact().
int ast_sip_set_request_transport_details | ( | struct ast_sip_request_transport_details * | details, |
pjsip_tx_data * | tdata, | ||
int | use_ipv6 | ||
) |
Sets request transport details based on tdata.
details | pre-allocated request transport details to set |
tdata | |
use_ipv6 | if non-zero, ipv6 transports will be considered |
0 | success |
-1 | failure |
Definition at line 648 of file res_pjsip.c.
References ast_sip_get_contact_sip_uri(), AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, ast_sip_request_transport_details::factory, if(), ast_sip_request_transport_details::local_address, ast_sip_request_transport_details::local_port, NULL, ast_sip_request_transport_details::transport, and ast_sip_request_transport_details::type.
Referenced by ast_sip_rewrite_uri_to_local(), and process_nat().
int ast_sip_set_security_negotiation | ( | enum ast_sip_security_negotiation * | security_negotiation, |
const char * | val | ||
) |
Set the security negotiation based on a given string.
security_negotiation | Security negotiation enum to set. |
val | String that represents a security_negotiation value. |
0 | Success |
non-zero | Failure |
Definition at line 288 of file pjsip_configuration.c.
References AST_SIP_SECURITY_NEG_MEDIASEC, AST_SIP_SECURITY_NEG_NONE, and ast_sip_endpoint::security_negotiation.
Referenced by security_negotiation_handler().
int ast_sip_set_tpselector_from_ep_or_uri | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_sip_uri * | sip_uri, | ||
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from an endpoint or uri.
endpoint | If endpoint->transport is set, it's used |
sip_uri | If sip_uri contains a x-ast-txp parameter, it's used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 911 of file res_pjsip.c.
References ast_sip_get_transport_name(), and ast_sip_set_tpselector_from_transport_name().
Referenced by ast_sip_dlg_set_transport(), create_dialog_uas(), and create_out_of_dialog_request().
int ast_sip_set_tpselector_from_transport | ( | const struct ast_sip_transport * | transport, |
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from ast_sip_transport.
transport | The transport to be used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 843 of file res_pjsip.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_log, ast_sip_get_transport_state(), ast_sorcery_object_get_id(), AST_TRANSPORT_WS, AST_TRANSPORT_WSS, ast_sip_transport_state::factory, ast_sip_transport_state::flow, LOG_ERROR, LOG_WARNING, and ast_sip_transport_state::transport.
Referenced by ast_sip_set_tpselector_from_transport_name().
int ast_sip_set_tpselector_from_transport_name | ( | const char * | transport_name, |
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from ast_sip_transport.
transport_name | The name of the transport to be used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 893 of file res_pjsip.c.
References ao2_cleanup, ast_log, ast_sip_get_sorcery(), ast_sip_set_tpselector_from_transport(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), LOG_ERROR, NULL, RAII_VAR, and ast_sip_transport_state::transport.
Referenced by ast_sip_set_tpselector_from_ep_or_uri(), registration_client_send(), set_transport(), and sip_outbound_registration_regc_alloc().
int ast_sip_sorcery_object_to_ami | ( | const void * | obj, |
struct ast_str ** | buf | ||
) |
Converts a sorcery object to a string of object properties.
obj | the sorcery object to convert |
buf | the string buffer to write the object data |
0 | Success, non-zero on failure |
Definition at line 1749 of file pjsip_configuration.c.
References ast_free, AST_HANDLER_ONLY_STRING, ast_sip_get_sorcery(), ast_sorcery_objectset_create2(), ast_str_append(), ast_to_camel_case, ast_variables_destroy(), buf, ast_variable::name, ast_variable::next, RAII_VAR, sip_sorcery_object_ami_set_type_name(), and ast_variable::value.
Referenced by ami_outbound_registration_task(), ami_registrations_aor(), format_ami_resource_lists(), sip_auth_to_ami(), sip_contact_to_ami(), sip_endpoint_to_ami(), sip_identify_to_ami(), and sip_transport_to_ami().
int ast_sip_str2rc | ( | const char * | name | ) |
Convert name to SIP response code.
name | SIP response code name matching one of the enum names defined in "enum pjsip_status_code" defined in sip_msg.h. May be specified with or without the PJSIP_SC_ prefix. |
SIP | response code |
-1 | if matching code not found |
Definition at line 3714 of file res_pjsip.c.
References ARRAY_LEN, ast_strlen_zero(), response_code_map::code, response_code_map::long_name, name, rc_map, and response_code_map::short_name.
Referenced by response_code_validator().
int ast_sip_str_to_dtmf | ( | const char * | dtmf_mode | ) |
Convert the DTMF mode name into an enum.
dtmf_mode | dtmf mode as a string |
>= | 0 The enum value |
-1 | Failure |
Definition at line 2533 of file res_pjsip.c.
References AST_SIP_DTMF_AUTO, AST_SIP_DTMF_AUTO_INFO, AST_SIP_DTMF_INBAND, AST_SIP_DTMF_INFO, AST_SIP_DTMF_NONE, AST_SIP_DTMF_RFC_4733, and result.
Referenced by dtmf_handler(), and pjsip_acf_dtmf_mode_write().
int ast_sip_str_to_security_mechanism | ( | struct ast_sip_security_mechanism ** | security_mechanism, |
const char * | value | ||
) |
Allocate a security mechanism from a string.
security_mechanism | Pointer-pointer to the security mechanism to allocate. |
value | The security mechanism string as defined in RFC 3329 (section 2.2) in the form <mechanism_name>;q=<q_value>;<mechanism_parameters> |
0 | Success |
non-zero | Failure |
Definition at line 242 of file security_agreements.c.
References ast_strdup, ast_strdupa, ast_strsep(), AST_STRSEP_ALL, AST_VECTOR_APPEND, ast_sip_security_mechanism::mechanism_parameters, NULL, out, parse_qvalue(), ast_sip_security_mechanism::qvalue, security_mechanism_destroy(), security_mechanisms_alloc(), str_to_security_mechanism_type(), tmp(), type, ast_sip_security_mechanism::type, and value.
Referenced by ast_sip_header_to_security_mechanism(), ast_sip_security_mechanism_vector_init(), and rfc3329_incoming_response().
struct ast_threadpool * ast_sip_threadpool | ( | void | ) |
Retrieve the SIP threadpool object.
Definition at line 3462 of file res_pjsip.c.
References sip_threadpool.
Referenced by load_module().
long ast_sip_threadpool_queue_size | ( | void | ) |
Return the size of the SIP threadpool's task queue.
Definition at line 3457 of file res_pjsip.c.
References ast_threadpool_queue_size(), and sip_threadpool.
void ast_sip_tpselector_unref | ( | pjsip_tpselector * | selector | ) |
Unreference a pjsip_tpselector.
selector | The selector to be unreffed |
Definition at line 923 of file res_pjsip.c.
Referenced by ast_sip_create_dialog_uac(), ast_sip_dlg_set_transport(), create_dialog_uas(), create_out_of_dialog_request(), registration_client_send(), set_transport(), and sip_outbound_registration_regc_alloc().
enum ast_transport_monitor_reg ast_sip_transport_monitor_register | ( | pjsip_transport * | transport, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | ao2_data | ||
) |
Register a reliable transport shutdown monitor callback.
transport | Transport to monitor for shutdown. |
cb | Who to call when transport is shutdown. |
ao2_data | Data to pass with the callback. |
There is no checking for duplicate registrations.
Definition at line 478 of file pjsip_transport_events.c.
References AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR, ast_sip_transport_monitor_register_replace_key(), callback_data::cb, IP6ADDR_COLON_PORT_BUFLEN, and NULL.
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_key | ( | const char * | transport_key, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | ao2_data | ||
) |
Register a reliable transport shutdown monitor callback.
transport_key | Key for the transport to monitor for shutdown. Create the key with AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR. |
cb | Who to call when transport is shutdown. |
ao2_data | Data to pass with the callback. |
There is no checking for duplicate registrations.
Definition at line 487 of file pjsip_transport_events.c.
References ast_sip_transport_monitor_register_replace_key(), callback_data::cb, and NULL.
Referenced by subscription_persistence_update().
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace | ( | pjsip_transport * | transport, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | ao2_data, | ||
ast_transport_monitor_data_matcher | matches | ||
) |
Register a reliable transport shutdown monitor callback replacing any duplicate.
transport | Transport to monitor for shutdown. |
cb | Who to call when transport is shutdown. |
ao2_data | Data to pass with the callback. |
matches | Matcher function that returns true if data matches a previously registered data object |
This function checks for duplicates, and overwrites/replaces the old monitor with the given one.
Definition at line 493 of file pjsip_transport_events.c.
References AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR, ast_sip_transport_monitor_register_replace_key(), callback_data::cb, IP6ADDR_COLON_PORT_BUFLEN, and NULL.
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace_key | ( | const char * | transport_key, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | ao2_data, | ||
ast_transport_monitor_data_matcher | matches | ||
) |
Register a reliable transport shutdown monitor callback replacing any duplicate.
transport_key | Key for the transport to monitor for shutdown. Create the key with AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR. |
cb | Who to call when transport is shutdown. |
ao2_data | Data to pass with the callback. |
matches | Matcher function that returns true if data matches a previously registered data object |
This function checks for duplicates, and overwrites/replaces the old monitor with the given one.
Definition at line 502 of file pjsip_transport_events.c.
References ao2_bump, ao2_cleanup, ao2_find, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_assert, ast_debug, AST_TRANSPORT_MONITOR_REG_FAILED, AST_TRANSPORT_MONITOR_REG_NOT_FOUND, AST_TRANSPORT_MONITOR_REG_SUCCESS, AST_VECTOR_APPEND, transport_monitor_notifier::cb, callback_data::cb, transport_monitor_notifier::data, transport_monitor::key, callback_data::matches, transport_monitor::monitors, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, ptr_matcher(), transport_monitor::transport, transport_monitor_unregister_cb(), and transport_monitor::transport_obj_name.
Referenced by ast_sip_transport_monitor_register(), ast_sip_transport_monitor_register_key(), ast_sip_transport_monitor_register_replace(), and registration_transport_monitor_setup().
void ast_sip_transport_monitor_unregister | ( | pjsip_transport * | transport, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | data, | ||
ast_transport_monitor_data_matcher | matches | ||
) |
Unregister a reliable transport shutdown monitor.
transport | Transport to monitor for shutdown. |
cb | The callback that was used for the original register. |
data | Data to pass to the matcher. May be NULL and does NOT need to be an ao2 object. If NULL, all monitors with the provided callback are unregistered. |
matches | Matcher function that returns true if data matches the previously registered data object. If NULL, a simple pointer comparison is done. |
Definition at line 441 of file pjsip_transport_events.c.
References AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR, ast_sip_transport_monitor_unregister_key(), callback_data::cb, callback_data::data, IP6ADDR_COLON_PORT_BUFLEN, and callback_data::matches.
Referenced by registrar_contact_delete().
void ast_sip_transport_monitor_unregister_all | ( | ast_transport_monitor_shutdown_cb | cb, |
void * | data, | ||
ast_transport_monitor_data_matcher | matches | ||
) |
Unregister a transport shutdown monitor from all reliable transports.
cb | The callback that was used for the original register. |
data | Data to pass to the matcher. May be NULL and does NOT need to be an ao2 object. If NULL, all monitors with the provided callback are unregistered. |
matches | Matcher function that returns true if ao2_data matches the previously registered data object. If NULL, a simple pointer comparison is done. |
Definition at line 421 of file pjsip_transport_events.c.
References ao2_callback, ao2_global_obj_ref, ao2_ref, ast_assert, callback_data::cb, callback_data::data, callback_data::matches, NULL, OBJ_MULTIPLE, OBJ_NODATA, ptr_matcher(), and transport_monitor_unregister_cb().
Referenced by registrar_contact_delete(), and unload_module().
void ast_sip_transport_monitor_unregister_key | ( | const char * | transport_key, |
ast_transport_monitor_shutdown_cb | cb, | ||
void * | data, | ||
ast_transport_monitor_data_matcher | matches | ||
) |
Unregister a reliable transport shutdown monitor.
transport_key | Key for the transport to monitor for shutdown. Create the key with AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR. |
cb | The callback that was used for the original register. |
data | Data to pass to the matcher. May be NULL and does NOT need to be an ao2 object. If NULL, all monitors with the provided callback are unregistered. |
matches | Matcher function that returns true if data matches the previously registered data object. If NULL, a simple pointer comparison is done. |
Definition at line 449 of file pjsip_transport_events.c.
References ao2_find, ao2_global_obj_ref, ao2_lock, ao2_ref, ao2_unlock, ast_assert, callback_data::cb, callback_data::data, callback_data::matches, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, ptr_matcher(), and transport_monitor_unregister_cb().
Referenced by ast_sip_transport_monitor_unregister(), handle_registration_response(), and subscription_persistence_remove().
void ast_sip_transport_state_register | ( | struct ast_sip_tpmgr_state_callback * | element | ) |
Register a transport state notification callback element.
element | What we are registering. |
Definition at line 559 of file pjsip_transport_events.c.
References AST_LIST_INSERT_HEAD, AST_LIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and transport_state_list.
Referenced by ast_sip_initialize_transport_management().
int ast_sip_transport_state_set_preferred_identity | ( | const char * | transport_name, |
const char * | identity | ||
) |
Sets the P-Preferred-Identity on a child transport.
transport_name | The name of the transport to be set on |
identity | The P-Preferred-Identity to use on requests on this transport |
0 | success |
-1 | failure |
Definition at line 242 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_free, ast_sip_get_transport_state(), ast_strdup, ast_strlen_zero(), ast_sip_transport_state::flow, and ast_sip_transport_state::preferred_identity.
Referenced by save_response_fields_to_transport().
int ast_sip_transport_state_set_service_routes | ( | const char * | transport_name, |
struct ast_sip_service_route_vector * | service_routes | ||
) |
Sets the service routes on a child transport.
transport_name | The name of the transport to be set on |
service_routes | A vector of service routes |
0 | success |
-1 | failure |
Definition at line 270 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_get_transport_state(), ast_sip_service_route_vector_destroy(), ast_strlen_zero(), ast_sip_transport_state::flow, and ast_sip_transport_state::service_routes.
Referenced by save_response_fields_to_transport().
int ast_sip_transport_state_set_transport | ( | const char * | transport_name, |
pjsip_transport * | transport | ||
) |
Sets the PJSIP transport on a child transport.
transport_name | The name of the transport to be updated |
transport | The PJSIP transport |
0 | success |
-1 | failure |
Definition at line 206 of file config_transport.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_sip_get_transport_state(), ast_strlen_zero(), ast_sip_transport_state::flow, and ast_sip_transport_state::transport.
Referenced by save_response_fields_to_transport().
void ast_sip_transport_state_unregister | ( | struct ast_sip_tpmgr_state_callback * | element | ) |
Unregister a transport state notification callback element.
element | What we are unregistering. |
Definition at line 552 of file pjsip_transport_events.c.
References AST_LIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and transport_state_list.
Referenced by ast_sip_destroy_transport_management().
void ast_sip_unregister_authenticator | ( | struct ast_sip_authenticator * | auth | ) |
Unregister a SIP authenticator.
When there is no authenticator registered, requests cannot be challenged or authenticated.
auth | The authenticator to unregister |
Definition at line 152 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, NULL, and registered_authenticator.
Referenced by unload_module().
void ast_sip_unregister_endpoint_formatter | ( | struct ast_sip_endpoint_formatter * | obj | ) |
Unregister an endpoint formatter.
obj | the formatter to unregister |
Definition at line 487 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_options_handling(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_sorcery_transport(), and unload_module().
void ast_sip_unregister_endpoint_identifier | ( | struct ast_sip_endpoint_identifier * | identifier | ) |
Unregister a SIP endpoint identifier.
This stops an endpoint identifier from being used.
identifier | The SIP endoint identifier to unregister |
Definition at line 315 of file res_pjsip.c.
References ast_debug, ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, endpoint_identifier_list::identifier, lock, and SCOPED_LOCK.
Referenced by unload_module().
void ast_sip_unregister_outbound_authenticator | ( | struct ast_sip_outbound_authenticator * | auth | ) |
Unregister an outbound SIP authenticator.
When there is no outbound authenticator registered, authentication challenges will be handled as any other final response would be.
auth | The authenticator to unregister |
Definition at line 203 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, NULL, and registered_outbound_authenticator.
Referenced by unload_module().
void ast_sip_unregister_service | ( | pjsip_module * | module | ) |
This is the opposite of ast_sip_register_service(). Unregistering a service means that PJSIP will no longer call into the module any more. This will likely occur when an Asterisk module is unloaded.
module | The PJSIP module to unregister |
Definition at line 133 of file res_pjsip.c.
References ast_sip_push_task_wait_servant(), NULL, and unregister_service().
Referenced by ast_res_pjsip_cleanup_message_filter(), ast_sip_destroy_distributor(), ast_sip_destroy_global_headers(), ast_sip_destroy_transport_management(), load_module(), unload_module(), and unload_pjsip().
void ast_sip_unregister_supplement | ( | struct ast_sip_supplement * | supplement | ) |
Unregister a an supplement to SIP out of dialog processing.
supplement | The supplement to unregister |
Definition at line 1476 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_supplement::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_message_filter(), and unload_module().
int ast_sip_update_from | ( | pjsip_tx_data * | tdata, |
char * | from | ||
) |
Overwrite fields in the outbound 'From' header.
The outbound 'From' header is created/added in ast_sip_create_request with default data. If available that data may be info specified in the 'from_user' and 'from_domain' options found on the endpoint. That information will be overwritten with data in the given 'from' parameter.
tdata | the outbound message data structure |
from | info to copy into the header. Can be either a SIP URI, or in the format user[@domain] |
0 | success, -1: failure |
Definition at line 3383 of file res_pjsip.c.
References ast_log, ast_strlen_zero(), and LOG_WARNING.
Referenced by msg_send(), and refer_send().
int ast_sip_update_to_uri | ( | pjsip_tx_data * | tdata, |
const char * | to | ||
) |
Replace the To URI in the tdata with the supplied one.
tdata | the outbound message data structure |
to | URI to replace the To URI with. Must be a valid SIP URI. |
0 | success, -1: failure |
Definition at line 3323 of file res_pjsip.c.
References ast_alloca, ast_debug, ast_log, buf, DEBUG_ATLEAST, DEBUG_BUF_SIZE, if(), LOG_WARNING, and NULL.
Referenced by msg_send(), and refer_send().
|
static |
Definition at line 111 of file res_pjsip.h.
Referenced by ast_sip_pjsip_uri_get_hostname(), and ast_sip_pjsip_uri_get_username().
|
extern |
Definition at line 3913 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Common media types used throughout res_pjsip and pjproject
Definition at line 3909 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Definition at line 3910 of file res_pjsip.c.
Referenced by load_module(), and video_info_incoming_request().
|
extern |
Definition at line 3911 of file res_pjsip.c.
Referenced by add_eprofile_to_tdata(), find_pidf(), and load_module().
|
extern |
Definition at line 3914 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Definition at line 3916 of file res_pjsip.c.
Referenced by filter_on_tx_message(), load_module(), and session_outgoing_nat_hook().
|
extern |
Definition at line 3915 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Definition at line 3912 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Definition at line 3917 of file res_pjsip.c.
Referenced by check_content_disposition(), and load_module().
|
extern |
Definition at line 3918 of file res_pjsip.c.
Referenced by add_eprofile_to_tdata(), aoc_invite_outgoing_response(), check_content_disposition(), find_pidf(), and load_module().
|
extern |
Definition at line 3919 of file res_pjsip.c.
Referenced by load_module().
|
extern |
Definition at line 3920 of file res_pjsip.c.
Referenced by load_module().