Asterisk - The Open Source Telephony Project
GIT-master-a24979a
|
#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_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_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_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 | AST_STIR_SHAKEN_RESPONSE_CODE_BAD_IDENTITY_INFO 436 |
#define | AST_STIR_SHAKEN_RESPONSE_CODE_INVALID_IDENTITY_HEADER 438 |
#define | AST_STIR_SHAKEN_RESPONSE_CODE_STALE_DATE 403 |
#define | AST_STIR_SHAKEN_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL 437 |
#define | AST_STIR_SHAKEN_RESPONSE_CODE_USE_IDENTITY_HEADER 428 |
#define | AST_STIR_SHAKEN_RESPONSE_CODE_USE_SUPPORTED_PASSPORT_FORMAT 428 |
#define | AST_STIR_SHAKEN_RESPONSE_STR_BAD_IDENTITY_INFO "Bad Identity Info" |
#define | AST_STIR_SHAKEN_RESPONSE_STR_INVALID_IDENTITY_HEADER "Invalid Identity Header" |
#define | AST_STIR_SHAKEN_RESPONSE_STR_STALE_DATE "Stale Date" |
#define | AST_STIR_SHAKEN_RESPONSE_STR_UNSUPPORTED_CREDENTIAL "Unsupported Credential" |
#define | AST_STIR_SHAKEN_RESPONSE_STR_USE_IDENTITY_HEADER "Use Identity Header" |
#define | AST_STIR_SHAKEN_RESPONSE_STR_USE_SUPPORTED_PASSPORT_FORMAT "Use Supported PASSporT Format" |
#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 | 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... | |
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... | |
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_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) |
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... | |
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... | |
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_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_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... | |
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_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_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_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_outbound_proxy (pjsip_tx_data *tdata, const char *proxy) |
Set the outbound proxy for an outbound SIP message. 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_str_to_dtmf (const char *dtmf_mode) |
Convert the DTMF mode name into an enum. 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_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... | |
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_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... | |
Variables | |
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_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 590 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 2620 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 2720 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 2752 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 181 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 178 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 3123 of file res_pjsip.h.
#define AST_SIP_X_AST_TXP "x-ast-txp" |
URI parameter for symmetric transport
Definition at line 955 of file res_pjsip.h.
#define AST_SIP_X_AST_TXP_LEN 9 |
Definition at line 956 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_BAD_IDENTITY_INFO 436 |
Definition at line 70 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_INVALID_IDENTITY_HEADER 438 |
Definition at line 72 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_STALE_DATE 403 |
Definition at line 67 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_UNSUPPORTED_CREDENTIAL 437 |
Definition at line 71 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_USE_IDENTITY_HEADER 428 |
Definition at line 68 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_CODE_USE_SUPPORTED_PASSPORT_FORMAT 428 |
Definition at line 69 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_BAD_IDENTITY_INFO "Bad Identity Info" |
Definition at line 78 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_INVALID_IDENTITY_HEADER "Invalid Identity Header" |
Definition at line 80 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_STALE_DATE "Stale Date" |
Definition at line 75 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_UNSUPPORTED_CREDENTIAL "Unsupported Credential" |
Definition at line 79 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_USE_IDENTITY_HEADER "Use Identity Header" |
Definition at line 76 of file res_pjsip.h.
#define AST_STIR_SHAKEN_RESPONSE_STR_USE_SUPPORTED_PASSPORT_FORMAT "Use Supported PASSporT Format" |
Definition at line 77 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 96 of file res_pjsip.h.
#define PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)-1) |
Definition at line 63 of file res_pjsip.h.
#define PJSIP_MINVERSION | ( | m, | |
n, | |||
p | |||
) | (((m << 24) | (n << 16) | (p << 8)) >= PJ_VERSION_NUM) |
Definition at line 54 of file res_pjsip.h.
#define SIP_SORCERY_AUTH_TYPE "auth" |
Definition at line 461 of file res_pjsip.h.
#define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias" |
Definition at line 270 of file res_pjsip.h.
#define SIP_TLS_MAX_CIPHERS 64 |
Maximum number of ciphers supported for a TLS transport.
Definition at line 93 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 1548 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 3540 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 3528 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 450 of file res_pjsip.h.
Incoming/Outgoing call offer/answer joint codec preference.
The default is INTERSECT ALL LOCAL.
Definition at line 561 of file res_pjsip.h.
Possible returns from ast_sip_check_authentication.
Definition at line 1012 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 1084 of file res_pjsip.h.
Status type for a contact.
Definition at line 339 of file res_pjsip.h.
Definition at line 512 of file res_pjsip.h.
enum ast_sip_dtmf_mode |
DTMF modes for SIP endpoints.
Definition at line 427 of file res_pjsip.h.
Different methods by which incoming requests can be matched to endpoints.
Definition at line 493 of file res_pjsip.h.
Definition at line 525 of file res_pjsip.h.
Definition at line 536 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 505 of file res_pjsip.h.
Definition at line 545 of file res_pjsip.h.
Definition at line 2951 of file res_pjsip.h.
Definition at line 3542 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 2035 of file res_pjsip.c.
References MIN.
Referenced by add_identity_header(), apply_dtls_attrib(), apply_negotiated_sdp_stream(), assign_uuid(), ast_sip_get_transport_name(), 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(), dialog_info_generate_body_content(), endpoint_lookup(), extract_contact_addr(), find_aor(), find_aor_name(), find_challenge(), get_auth_header(), get_codecs(), get_endpoint_details(), get_from_header(), get_mid_bundle_group(), get_user_agent(), 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(), 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 2042 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 969 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(), 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 1886 of file res_pjsip.c.
References ast_body_to_pjsip_body().
Referenced by 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 1893 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 83 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 1858 of file res_pjsip.c.
Referenced by add_header_from_channel_var(), add_headers_to_message(), ast_sip_add_date_header(), ast_sip_message_apply_transport(), build_notify(), notify_channel(), notify_contact(), notify_uri(), rfc3326_add_reason_header(), send_options_response(), sip_publication_respond(), and transfer_refer().
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 789 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 1909 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.
pjsip_media_type | a |
pjsip_media_type | b |
1 | Media types are equal |
0 | Media types are not equal |
Definition at line 2053 of file res_pjsip.c.
Referenced by 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 249 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 267 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 317 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 2357 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 2380 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 156 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().
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 2417 of file pjsip_configuration.c.
References ao2_cleanup.
Referenced by 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 1622 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_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 823 of file res_pjsip.c.
References 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(), and ast_sip_session_create_outgoing().
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 1028 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 1044 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 1118 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 1066 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 1285 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 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 207 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(), 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 2271 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 2393 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 get_outbound_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 2161 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 2172 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 586 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 2307 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 2346 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_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 1666 of file res_pjsip.c.
References NULL, and send_request_wrapper::tdata.
Referenced by check_request_status(), and handle_registration_response().
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_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 1588 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 1561 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().
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 2717 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(), AVAILABLE, buf, ast_sip_contact_wrapper::contact, ast_sip_ami::count, ast_sip_ami::s, S_OR, status, and UNKNOWN.
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 494 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_allow_sending_180_after_183 | ( | void | ) |
Retrieve the global setting 'allow_sending_180_after_183'.
non | zero if disable. |
Definition at line 450 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 631 of file pjsip_distributor.c.
References ao2_global_obj_ref.
Referenced by 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 654 of file pjsip_distributor.c.
References ao2_ref, and artificial_endpoint.
Referenced by 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 312 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 342 of file pjsip_options.c.
References ARRAY_LEN, ast_assert, short_status_map, and status.
Referenced by cli_contact_print_body().
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 523 of file pjsip_options.c.
References ao2_find, ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, and sip_options_contact_statuses.
Referenced by ast_sip_format_contact_ami(), cli_contact_print_body(), contact_remove_unreachable(), format_ami_contactlist_handler(), registrar_add_unreachable(), 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 336 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(), 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 235 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 391 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 378 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 266 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 1545 of file pjsip_configuration.c.
References ast_devstate2str(), ast_sorcery_object_get_id(), and MAX_OBJECT_FIELD.
Referenced by 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 327 of file config_global.c.
References ao2_ref, DEFAULT_DISABLE_MULTI_DOMAIN, global_config::disable_multi_domain, and get_global_cfg().
Referenced by find_endpoint(), request(), and sip_dialog_create_from().
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 282 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 1553 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(), and ast_sip_for_each_channel().
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 2384 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 2283 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 2296 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 465 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 297 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 342 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 435 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 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 405 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 420 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 525 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 513 of file res_pjsip.c.
References ast_pjsip_endpoint.
Referenced by acl_on_rx_msg(), 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_session_defer_termination(), ast_sip_session_resume_reinvite(), authenticate(), cancel_publish_refresh(), cancel_registration(), channel_read_pjsip(), create_out_of_dialog_request(), 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(), handle_new_invite_request(), keepalive_transport_send_keepalive(), load_module(), logging_on_rx_msg(), logging_on_tx_msg(), notify_task(), on_rx_process_uris(), parse_uri_cb(), 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(), stir_shaken_inv_end_session(), 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 250 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 495 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 2444 of file pjsip_configuration.c.
References sip_sorcery.
Referenced by acl_change_stasis_cb(), acl_on_rx_msg(), alloc_artificial_auth(), ami_show_endpoint(), ami_show_registration_contact_statuses(), ami_show_resource_lists(), ami_sip_qualify(), aor_deleted_observer(), ast_res_pjsip_cleanup_options_handling(), ast_sip_cli_print_sorcery_objectset(), 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_set_tpselector_from_transport_name(), ast_sip_sorcery_object_to_ami(), asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), asterisk_publication_new(), 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_aor(), find_aor_name(), find_endpoint(), get_all_contacts(), get_publishes_and_update_state(), get_registrations(), get_write_timeout(), handle_atsign(), handle_single_token(), handle_slash(), 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_outbound_registration_metrics_init(), pjsip_outbound_registration_metrics_unload_cb(), process_nat(), publish_request_initial(), 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 557 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 |
Definition at line 1570 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(), and t38_initialize_session().
struct ao2_container* ast_sip_get_transport_states | ( | void | ) |
Retrieves all transport states.
Definition at line 1610 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 find_endpoint(), get_udp_transport(), get_write_timeout(), and process_nat().
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 357 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 480 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().
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 323 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_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 2082 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 2062 of file res_pjsip.c.
References a, ast_assert, b, NULL, and SENTINEL.
Referenced by check_content_disposition().
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::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::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 ast_res_pjsip_initialize_configuration().
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_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(), format_ami_aor_handler(), gather_contacts_for_aor(), notify_endpoint(), 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().
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 2410 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 1424 of file pjsip_configuration.c.