Asterisk - The Open Source Telephony Project
GIT-master-a24979a
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjsip_simple.h>
#include <pjsip/sip_transaction.h>
#include <pj/timer.h>
#include <pjlib.h>
#include <pjmedia/errno.h>
#include "asterisk/res_pjsip.h"
#include "res_pjsip/include/res_pjsip_private.h"
#include "asterisk/linkedlists.h"
#include "asterisk/logger.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/astobj2.h"
#include "asterisk/module.h"
#include "asterisk/serializer.h"
#include "asterisk/threadpool.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/uuid.h"
#include "asterisk/sorcery.h"
#include "asterisk/file.h"
#include "asterisk/cli.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/test.h"
#include "asterisk/res_pjsip_presence_xml.h"
#include "asterisk/res_pjproject.h"
Go to the source code of this file.
Data Structures | |
struct | endpoint_formatters |
struct | endpoint_identifier_list |
struct | endpoint_identifiers |
struct | send_request_data |
Structure to hold information about an outbound request. More... | |
struct | send_request_wrapper |
struct | supplements |
struct | sync_task_data |
Macros | |
#define | ENDPOINT_IDENTIFIER_FORMAT "%-20.20s\n" |
#define | MOD_DATA_CONTACT "contact" |
#define | SERIALIZER_POOL_SIZE 8 |
#define | SIP_SERVANT_ID 0x5E2F1D |
#define | TIMEOUT_TIMER2 5 |
#define | TIMER_INACTIVE 0 |
Typedefs | |
typedef pj_status_t(* | create_dlg_uac) (pjsip_user_agent *ua, pjsip_rx_data *rdata, const pj_str_t *contact, pjsip_dialog **p_dlg) |
Functions | |
static void | __init_pj_thread_storage (void) |
static void | __init_servant_id_storage (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static pjsip_msg_body * | ast_body_to_pjsip_body (pj_pool_t *pool, const struct ast_sip_body *body) |
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_module * | AST_MODULE_SELF_SYM (void) |
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_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_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... | |
pjsip_dialog * | ast_sip_create_dialog_uac (const struct ast_sip_endpoint *endpoint, const char *uri, 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) |
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 *old_request, 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 **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... | |
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... | |
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_format_endpoint_ami (struct ast_sip_endpoint *endpoint, struct ast_sip_ami *ami, int *count) |
Formats the endpoint and sends over AMI. 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... | |
pjsip_endpoint * | ast_sip_get_pjsip_endpoint (void) |
Get a pointer to the PJSIP endpoint. 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_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,...) |
Check if a media type is in a list of others. 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... | |
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... | |
static int | ast_sip_push_task_wait (struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data) |
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 *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... | |
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_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... | |
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_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... | |
void | ast_sip_unregister_authenticator (struct ast_sip_authenticator *auth) |
Unregister a SIP authenticator. More... | |
void | ast_sip_unregister_endpoint_formatter (struct ast_sip_endpoint_formatter *obj) |
Unregister an endpoint formatter. More... | |
void | ast_sip_unregister_endpoint_identifier (struct ast_sip_endpoint_identifier *identifier) |
Unregister a SIP endpoint identifier. More... | |
void | ast_sip_unregister_outbound_authenticator (struct ast_sip_outbound_authenticator *auth) |
Unregister an outbound SIP authenticator. More... | |
void | ast_sip_unregister_service (pjsip_module *module) |
void | ast_sip_unregister_supplement (struct ast_sip_supplement *supplement) |
Unregister a an supplement to SIP out of dialog processing. More... | |
int | ast_sip_will_uri_survive_restart (pjsip_sip_uri *uri, struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata) |
static int | check_request_status (struct send_request_data *req_data, pjsip_event *e) |
static char * | cli_dump_endpt (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_show_endpoint_identifiers (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | cli_show_settings (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static pjsip_dialog * | create_dialog_uas (const struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pj_status_t *status, create_dlg_uac create_fun) |
static int | create_in_dialog_request (const pjsip_method *method, struct pjsip_dialog *dlg, pjsip_tx_data **tdata) |
static int | create_out_of_dialog_request (const pjsip_method *method, struct ast_sip_endpoint *endpoint, const char *uri, struct ast_sip_contact *provided_contact, pjsip_tx_data **tdata) |
static int | do_cli_dump_endpt (void *v_a) |
static pj_bool_t | does_method_match (const pj_str_t *message_method, const char *supplement_method) |
static pj_status_t | endpt_send_request (struct ast_sip_endpoint *endpoint, pjsip_tx_data *tdata, pj_int32_t timeout, void *token, pjsip_endpt_send_callback cb) |
static void | endpt_send_request_cb (void *token, pjsip_event *e) |
static const pjsip_method * | get_pjsip_method (const char *method) |
static int | load_module (void) |
static int | load_pjsip (void) |
static void * | monitor_thread_exec (void *endpt) |
void | never_called_res_pjsip (void) |
static int | register_service (void *data) |
static int | reload_configuration_task (void *obj) |
static int | reload_module (void) |
static void | remove_request_headers (pjsip_endpoint *endpt) |
static int | send_in_dialog_request (pjsip_tx_data *tdata, struct pjsip_dialog *dlg) |
static void | send_request_cb (void *token, pjsip_event *e) |
static struct send_request_data * | send_request_data_alloc (struct ast_sip_endpoint *endpoint, void *token, void(*callback)(void *token, pjsip_event *e)) |
static void | send_request_data_destroy (void *obj) |
static void | send_request_timer_callback (pj_timer_heap_t *theap, pj_timer_entry *entry) |
static void | send_request_wrapper_destructor (void *obj) |
static int | sip_dialog_create_from (pj_pool_t *pool, pj_str_t *from, const char *user, const char *domain, const pj_str_t *target, pjsip_tpselector *selector) |
static void | sip_thread_start (void) |
static void | stop_monitor_thread (void) |
static pj_bool_t | supplement_on_rx_request (pjsip_rx_data *rdata) |
static void | supplement_outgoing_response (pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint) |
static int | sync_task (void *data) |
static int | uas_use_sips_contact (pjsip_rx_data *rdata) |
Determine if a SIPS Contact header is required. More... | |
static int | unload_module (void) |
static int | unload_pjsip (void *data) |
static int | unregister_service (void *data) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Basic SIP resource" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND - 5, .requires = "dnsmgr,res_pjproject,res_sorcery_config,res_sorcery_memory,res_sorcery_astdb", .optional_modules = "res_statsd", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static pjsip_endpoint * | ast_pjsip_endpoint |
pj_caching_pool | caching_pool |
static struct ast_cli_entry | cli_commands [] |
struct endpoint_formatters | endpoint_formatters = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct endpoint_identifiers | endpoint_identifiers = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static pj_sockaddr | host_ip_ipv4 |
static char | host_ip_ipv4_string [PJ_INET6_ADDRSTRLEN] |
static pj_sockaddr | host_ip_ipv6 |
static char | host_ip_ipv6_string [PJ_INET6_ADDRSTRLEN] |
static const pjsip_method | info_method = {PJSIP_OTHER_METHOD, {"INFO", 4} } |
pj_pool_t * | memory_pool |
static const pjsip_method | message_method = {PJSIP_OTHER_METHOD, {"MESSAGE", 7} } |
struct { | |
const char * method | |
const pjsip_method * pmethod | |
} | methods [] |
static int | monitor_continue |
pj_thread_t * | monitor_thread |
static struct ast_threadstorage | pj_thread_storage = { .once = PTHREAD_ONCE_INIT , .key_init = __init_pj_thread_storage , .custom_init = NULL , } |
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 |
static struct ast_sip_authenticator * | registered_authenticator |
static struct ast_sip_outbound_authenticator * | registered_outbound_authenticator |
static struct ast_threadstorage | servant_id_storage = { .once = PTHREAD_ONCE_INIT , .key_init = __init_servant_id_storage , .custom_init = NULL , } |
static struct ast_serializer_pool * | sip_serializer_pool |
static struct ast_threadpool * | sip_threadpool |
static pjsip_module | supplement_module |
struct supplements | supplements = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
#define ENDPOINT_IDENTIFIER_FORMAT "%-20.20s\n" |
#define MOD_DATA_CONTACT "contact" |
Definition at line 59 of file res_pjsip.c.
#define SERIALIZER_POOL_SIZE 8 |
Number of serializers in pool if one not supplied.
Definition at line 62 of file res_pjsip.c.
#define SIP_SERVANT_ID 0x5E2F1D |
Definition at line 2117 of file res_pjsip.c.
#define TIMEOUT_TIMER2 5 |
Definition at line 1363 of file res_pjsip.c.
#define TIMER_INACTIVE 0 |
Definition at line 1362 of file res_pjsip.c.
typedef pj_status_t(* create_dlg_uac) (pjsip_user_agent *ua, pjsip_rx_data *rdata, const pj_str_t *contact, pjsip_dialog **p_dlg) |
Definition at line 969 of file res_pjsip.c.
|
static |
Definition at line 2115 of file res_pjsip.c.
|
static |
Definition at line 2116 of file res_pjsip.c.
|
static |
Definition at line 2814 of file res_pjsip.c.
|
static |
Definition at line 2814 of file res_pjsip.c.
|
static |
Definition at line 1873 of file res_pjsip.c.
References ast_sip_body::body_text, ast_sip_body::subtype, type, and ast_sip_body::type.
Referenced by ast_sip_add_body(), and ast_sip_add_body_multipart().
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_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 2814 of file res_pjsip.c.
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_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_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().
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().
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().
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_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().
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().
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().
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_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().
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().
|
static |
Definition at line 1971 of file res_pjsip.c.
References ast_cond_destroy, ast_cond_init, ast_cond_wait, ast_mutex_destroy, ast_mutex_init, ast_mutex_lock, ast_mutex_unlock, ast_sip_push_task(), sync_task_data::complete, sync_task_data::cond, sync_task_data::fail, sync_task_data::lock, NULL, sync_task(), sync_task_data::task, and sync_task_data::task_data.
Referenced by ast_sip_push_task_wait_serializer(), and ast_sip_push_task_wait_servant().
char* ast_sip_rdata_get_header_value | ( | pjsip_rx_data * | rdata, |
const pj_str_t | str | ||
) |
Get a specific header value from rdata.
rdata | The rdata |
str | The header to find |
NULL | on failure |
The | header value on success |
Definition at line 338 of file res_pjsip.c.
Referenced by check_date_header(), handle_new_invite_request(), and stir_shaken_incoming_request().
int ast_sip_register_authenticator | ( | struct ast_sip_authenticator * | auth | ) |
Register a SIP authenticator.
An authenticator has three main purposes: 1) Determining if authentication should be performed on an incoming request 2) Gathering credentials necessary for issuing an authentication challenge 3) Authenticating a request that has credentials
Asterisk provides a default authenticator, but it may be replaced by a custom one if desired.
auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 133 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and registered_authenticator.
Referenced by load_module().
void ast_sip_register_endpoint_formatter | ( | struct ast_sip_endpoint_formatter * | obj | ) |
Register an endpoint formatter.
obj | the formatter to register |
Definition at line 474 of file res_pjsip.c.
References AST_RWLIST_INSERT_TAIL, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_cli_entry::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_init_options_handling(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_sorcery_transport(), and load_module().
int ast_sip_register_endpoint_identifier | ( | struct ast_sip_endpoint_identifier * | identifier | ) |
Register a SIP endpoint identifier.
An endpoint identifier's purpose is to determine which endpoint a given SIP message has come from.
Multiple endpoint identifiers may be registered so that if an endpoint cannot be identified by one identifier, it may be identified by another.
Asterisk provides two endpoint identifiers. One identifies endpoints based on the user part of the From header URI. The other identifies endpoints based on the source IP address.
If the order in which endpoint identifiers is run is important to you, then be sure to load individual endpoint identifier modules in the order you wish for them to be run in modules.conf
identifier | The SIP endpoint identifier to register |
0 | Success |
-1 | Failure |
Definition at line 303 of file res_pjsip.c.
References ast_sip_register_endpoint_identifier_with_name(), endpoint_identifier_list::identifier, and NULL.
Referenced by load_module().
int ast_sip_register_endpoint_identifier_with_name | ( | struct ast_sip_endpoint_identifier * | identifier, |
const char * | name | ||
) |
Register a SIP endpoint identifier with a name.
An endpoint identifier's purpose is to determine which endpoint a given SIP message has come from.
Multiple endpoint identifiers may be registered so that if an endpoint cannot be identified by one identifier, it may be identified by another.
identifier | The SIP endpoint identifier to register |
name | The name of the endpoint identifier |
0 | Success |
-1 | Failure |
Definition at line 226 of file res_pjsip.c.
References ast_calloc, ast_debug, ast_free, ast_log, AST_RWLIST_EMPTY, AST_RWLIST_INSERT_AFTER, AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_HEAD, AST_RWLIST_INSERT_TAIL, AST_RWLIST_NEXT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_sip_get_endpoint_identifier_order(), ast_strlen_zero(), current, endpoint_identifier_list::identifier, lock, LOG_ERROR, name, endpoint_identifier_list::name, endpoint_identifier_list::priority, and SCOPED_LOCK.
Referenced by ast_sip_register_endpoint_identifier(), and load_module().
int ast_sip_register_outbound_authenticator | ( | struct ast_sip_outbound_authenticator * | outbound_auth | ) |
Register an outbound SIP authenticator.
An outbound authenticator is responsible for creating responses to authentication challenges by remote endpoints.
outbound_auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 184 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and registered_outbound_authenticator.
Referenced by load_module().
int ast_sip_register_service | ( | pjsip_module * | module | ) |
Register a SIP service in Asterisk.
This is more-or-less a wrapper around pjsip_endpt_register_module(). Registering a service makes it so that PJSIP will call into the service at appropriate times. For more information about PJSIP module callbacks, see the PJSIP documentation. Asterisk modules that call this function will likely do so at module load time.
module | The module that is to be registered with PJSIP |
0 | Success |
-1 | Failure |
Definition at line 110 of file res_pjsip.c.
References ast_sip_push_task_wait_servant(), NULL, and register_service().
Referenced by ast_res_pjsip_init_message_filter(), ast_sip_initialize_distributor(), ast_sip_initialize_global_headers(), ast_sip_initialize_transport_management(), and load_module().
void ast_sip_register_supplement | ( | struct ast_sip_supplement * | supplement | ) |
Register a supplement to SIP out of dialog processing.
This allows for someone to insert themselves in the processing of out of dialog SIP requests and responses. This, for example could allow for a module to set channel data based on headers in an incoming message. Similarly, a module could reject an incoming request if desired.
supplement | The supplement to register |
Definition at line 1306 of file res_pjsip.c.
References AST_RWLIST_INSERT_BEFORE_CURRENT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_supplement::next, ast_sip_supplement::priority, and SCOPED_LOCK.
Referenced by ast_res_pjsip_init_message_filter(), and load_module().
int ast_sip_requires_authentication | ( | struct ast_sip_endpoint * | endpoint, |
pjsip_rx_data * | rdata | ||
) |
Determine if an incoming request requires authentication.
This calls into the registered authenticator's requires_authentication callback in order to determine if the request requires authentication.
If there is no registered authenticator, then authentication will be assumed not to be required.
endpoint | The endpoint from which the request originates |
rdata | The incoming SIP request |
non-zero | The request requires authentication |
0 | The request does not require authentication |
Definition at line 156 of file res_pjsip.c.
Referenced by authenticate().
int ast_sip_send_out_of_dialog_request | ( | pjsip_tx_data * | tdata, |
struct ast_sip_endpoint * | endpoint, | ||
int | timeout, | ||
void * | token, | ||
void(*)(void *token, pjsip_event *e) | callback | ||
) |
General purpose method for sending an Out-Of-Dialog SIP request.
This is a companion function for ast_sip_create_request. The request created there can be passed to this function, though any request may be passed in.
This will automatically set up handling outbound authentication challenges if they arrive.
tdata | The request to send |
endpoint | Optional. If specified, the out-of-dialog request is sent to the endpoint. |
timeout | If non-zero, after the timeout the transaction will be terminated and the callback will be called with the PJSIP_EVENT_TIMER type. |
token | Data to be passed to the callback upon receipt of out-of-dialog response. |
callback | Callback to be called upon receipt of out-of-dialog response. |
0 | Success |
-1 | Failure (out-of-dialog callback will not be called.) |
Definition at line 1788 of file res_pjsip.c.
References ao2_cleanup, AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_sip_message_apply_transport(), ast_sip_mod_data_get, ast_sip_mod_data_set, does_method_match(), ast_sip_contact::endpoint, endpt_send_request(), ast_sip_supplement::method, MOD_DATA_CONTACT, NULL, ast_sip_supplement::outgoing_request, send_request_cb(), send_request_data_alloc(), supplement_module, and ast_sip_endpoint::transport.
Referenced by ast_sip_send_request(), and sip_options_qualify_contact().
int ast_sip_send_request | ( | pjsip_tx_data * | tdata, |
struct pjsip_dialog * | dlg, | ||
struct ast_sip_endpoint * | endpoint, | ||
void * | token, | ||
void(*)(void *token, pjsip_event *e) | callback | ||
) |
General purpose method for sending a SIP request.
This is a companion function for ast_sip_create_request. The request created there can be passed to this function, though any request may be passed in.
This will automatically set up handling outbound authentication challenges if they arrive.
tdata | The request to send |
dlg | Optional. The dialog in which the request is sent. Otherwise it is out-of-dialog. |
endpoint | Optional. If specified, the out-of-dialog request is sent to the endpoint. |
token | Data to be passed to the callback upon receipt of out-of-dialog response. |
callback | Callback to be called upon receipt of out-of-dialog response. |
0 | Success |
-1 | Failure (out-of-dialog callback will not be called.) |
Definition at line 1829 of file res_pjsip.c.
References ast_assert, ast_sip_send_out_of_dialog_request(), ast_sip_contact::endpoint, and send_in_dialog_request().
Referenced by msg_send(), notify_channel(), notify_contact(), notify_uri(), send_unsolicited_mwi_notify_to_contact(), and sendtext().
int ast_sip_send_response | ( | pjsip_response_addr * | res_addr, |
pjsip_tx_data * | tdata, | ||
struct ast_sip_endpoint * | sip_endpoint | ||
) |
Send a response to an out of dialog request.
Use this function sparingly, since this does not create a transaction within PJSIP. This means that if the request is retransmitted, it is your responsibility to detect this and not process the same request twice, and to send the same response for each retransmission.
res_addr | The response address for this response |
tdata | The response to send |
sip_endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 2230 of file res_pjsip.c.
References ast_sip_get_pjsip_endpoint(), NULL, status, and supplement_outgoing_response().
int ast_sip_send_stateful_response | ( | pjsip_rx_data * | rdata, |
pjsip_tx_data * | tdata, | ||
struct ast_sip_endpoint * | sip_endpoint | ||
) |
Send a stateful response to an out of dialog request.
This creates a transaction within PJSIP, meaning that if the request that we are responding to is retransmitted, we will not attempt to re-handle the request.
rdata | The request that is being responded to |
tdata | The response to send |
sip_endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 2243 of file res_pjsip.c.
References ao2_cleanup, ast_sip_mod_data_get, ast_sip_mod_data_set, MOD_DATA_CONTACT, NULL, supplement_module, and supplement_outgoing_response().
Referenced by register_aor(), send_options_response(), and send_response().
int ast_sip_set_outbound_proxy | ( | pjsip_tx_data * | tdata, |
const char * | proxy | ||
) |
Set the outbound proxy for an outbound SIP message.
tdata | The message to set the outbound proxy on |
proxy | SIP uri of the proxy |
0 | Success |
-1 | Failure |
Definition at line 1842 of file res_pjsip.c.
Referenced by create_out_of_dialog_request(), path_outgoing_request(), and sip_options_qualify_contact().
int ast_sip_set_tpselector_from_ep_or_uri | ( | const struct ast_sip_endpoint * | endpoint, |
pjsip_sip_uri * | sip_uri, | ||
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from an endpoint or uri.
endpoint | If endpoint->transport is set, it's used |
sip_uri | If sip_uri contains a x-ast-txp parameter, it's used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 770 of file res_pjsip.c.
References ast_sip_get_transport_name(), and ast_sip_set_tpselector_from_transport_name().
Referenced by ast_sip_dlg_set_transport(), create_dialog_uas(), and create_out_of_dialog_request().
int ast_sip_set_tpselector_from_transport | ( | const struct ast_sip_transport * | transport, |
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from ast_sip_transport.
transport | The transport to be used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 702 of file res_pjsip.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_log, ast_sip_get_transport_state(), ast_sorcery_object_get_id(), AST_TRANSPORT_WS, AST_TRANSPORT_WSS, ast_sip_transport_state::factory, ast_sip_transport_state::flow, LOG_ERROR, LOG_WARNING, and ast_sip_transport_state::transport.
Referenced by ast_sip_set_tpselector_from_transport_name().
int ast_sip_set_tpselector_from_transport_name | ( | const char * | transport_name, |
pjsip_tpselector * | selector | ||
) |
Sets pjsip_tpselector from ast_sip_transport.
transport_name | The name of the transport to be used |
selector | The selector to be populated |
0 | success |
-1 | failure |
Definition at line 752 of file res_pjsip.c.
References ao2_cleanup, ast_log, ast_sip_get_sorcery(), ast_sip_set_tpselector_from_transport(), ast_sorcery_retrieve_by_id(), ast_strlen_zero(), LOG_ERROR, NULL, RAII_VAR, and ast_sip_transport_state::transport.
Referenced by ast_sip_set_tpselector_from_ep_or_uri(), registration_client_send(), set_transport(), and sip_outbound_registration_regc_alloc().
int ast_sip_str_to_dtmf | ( | const char * | dtmf_mode | ) |
Convert the DTMF mode name into an enum.
dtmf_mode | dtmf mode as a string |
>= | 0 The enum value |
-1 | Failure |
Definition at line 2336 of file res_pjsip.c.
References AST_SIP_DTMF_AUTO, AST_SIP_DTMF_AUTO_INFO, AST_SIP_DTMF_INBAND, AST_SIP_DTMF_INFO, AST_SIP_DTMF_NONE, AST_SIP_DTMF_RFC_4733, and result.
Referenced by dtmf_handler(), and pjsip_acf_dtmf_mode_write().
struct ast_threadpool* ast_sip_threadpool | ( | void | ) |
Retrieve the SIP threadpool object.
Definition at line 2453 of file res_pjsip.c.
References sip_threadpool.
long ast_sip_threadpool_queue_size | ( | void | ) |
Return the size of the SIP threadpool's task queue.
Definition at line 2448 of file res_pjsip.c.
References ast_threadpool_queue_size(), and sip_threadpool.
void ast_sip_tpselector_unref | ( | pjsip_tpselector * | selector | ) |
Unreference a pjsip_tpselector.
selector | The selector to be unreffed |
Definition at line 782 of file res_pjsip.c.
Referenced by ast_sip_create_dialog_uac(), ast_sip_dlg_set_transport(), create_dialog_uas(), create_out_of_dialog_request(), registration_client_send(), set_transport(), and sip_outbound_registration_regc_alloc().
void ast_sip_unregister_authenticator | ( | struct ast_sip_authenticator * | auth | ) |
Unregister a SIP authenticator.
When there is no authenticator registered, requests cannot be challenged or authenticated.
auth | The authenticator to unregister |
Definition at line 145 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, NULL, and registered_authenticator.
void ast_sip_unregister_endpoint_formatter | ( | struct ast_sip_endpoint_formatter * | obj | ) |
Unregister an endpoint formatter.
obj | the formatter to unregister |
Definition at line 480 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_options_handling(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), and ast_sip_destroy_sorcery_transport().
void ast_sip_unregister_endpoint_identifier | ( | struct ast_sip_endpoint_identifier * | identifier | ) |
Unregister a SIP endpoint identifier.
This stops an endpoint identifier from being used.
identifier | The SIP endoint identifier to unregister |
Definition at line 308 of file res_pjsip.c.
References ast_debug, ast_free, AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, endpoint_identifier_list::identifier, lock, and SCOPED_LOCK.
Referenced by unload_module().
void ast_sip_unregister_outbound_authenticator | ( | struct ast_sip_outbound_authenticator * | auth | ) |
Unregister an outbound SIP authenticator.
When there is no outbound authenticator registered, authentication challenges will be handled as any other final response would be.
auth | The authenticator to unregister |
Definition at line 196 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, NULL, and registered_outbound_authenticator.
void ast_sip_unregister_service | ( | pjsip_module * | module | ) |
This is the opposite of ast_sip_register_service(). Unregistering a service means that PJSIP will no longer call into the module any more. This will likely occur when an Asterisk module is unloaded.
module | The PJSIP module to unregister |
Definition at line 126 of file res_pjsip.c.
References ast_sip_push_task_wait_servant(), NULL, and unregister_service().
Referenced by ast_res_pjsip_cleanup_message_filter(), ast_sip_destroy_global_headers(), ast_sip_destroy_transport_management(), load_module(), unload_module(), and unload_pjsip().
void ast_sip_unregister_supplement | ( | struct ast_sip_supplement * | supplement | ) |
Unregister a an supplement to SIP out of dialog processing.
supplement | The supplement to unregister |
Definition at line 1326 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_supplement::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_message_filter().
int ast_sip_will_uri_survive_restart | ( | pjsip_sip_uri * | uri, |
struct ast_sip_endpoint * | endpoint, | ||
pjsip_rx_data * | rdata | ||
) |
Definition at line 518 of file res_pjsip.c.
References ast_sip_endpoint::nat, result, and ast_sip_endpoint_nat_configuration::rewrite_contact.
Referenced by subscription_persistence_update().
|
static |
Definition at line 1689 of file res_pjsip.c.
References ao2_bump, ao2_ref, ast_sip_create_request_with_auth(), ast_sip_failover_request(), send_request_data::challenge_count, send_request_data::endpoint, endpt_send_request(), MAX_RX_CHALLENGES, ast_sip_endpoint::outbound_auths, and send_request_cb().
Referenced by send_request_cb().
|
static |
Definition at line 364 of file res_pjsip.c.
References a, ast_sip_push_task_wait_servant(), CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, do_cli_dump_endpt(), NULL, and ast_cli_entry::usage.
|
static |
Definition at line 404 of file res_pjsip.c.
References a, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, ENDPOINT_IDENTIFIER_FORMAT, lock, endpoint_identifier_list::name, NULL, SCOPED_LOCK, and ast_cli_entry::usage.
|
static |
Definition at line 435 of file res_pjsip.c.
|
static |
Definition at line 972 of file res_pjsip.c.
References ast_assert, ast_log, ast_sip_set_tpselector_from_ep_or_uri(), ast_sip_tpselector_unref(), ast_sorcery_object_get_id(), LOG_ERROR, NULL, status, ast_sip_transport_state::transport, type, and uas_use_sips_contact().
Referenced by ast_sip_create_dialog_uas(), and ast_sip_create_dialog_uas_locked().
|
static |
Definition at line 1157 of file res_pjsip.c.
References ast_log, LOG_WARNING, and method.
Referenced by ast_sip_create_request().
|
static |
Definition at line 1175 of file res_pjsip.c.
References ao2_bump, ao2_cleanup, ast_sip_endpoint::aors, ast_log, ast_sip_add_usereqphone(), ast_sip_get_pjsip_endpoint(), ast_sip_location_retrieve_contact_from_aor_list(), ast_sip_mod_data_set, ast_sip_set_outbound_proxy(), ast_sip_set_tpselector_from_ep_or_uri(), 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, LOG_ERROR, LOG_WARNING, method, MOD_DATA_CONTACT, NULL, ast_sip_endpoint::outbound_proxy, RAII_VAR, sip_dialog_create_from(), and supplement_module.
Referenced by ast_sip_create_request().
|
static |
Definition at line 353 of file res_pjsip.c.
References a, ast_pjproject_log_intercept_begin(), ast_pjproject_log_intercept_end(), and ast_sip_get_pjsip_endpoint().
Referenced by cli_dump_endpt().
|
static |
Definition at line 1349 of file res_pjsip.c.
References ast_strlen_zero(), message_method, and method.
Referenced by ast_sip_send_out_of_dialog_request(), send_request_cb(), supplement_on_rx_request(), and supplement_outgoing_response().
|
static |
Definition at line 1546 of file res_pjsip.c.
References ao2_alloc, ao2_lock, ao2_ref, ao2_t_ref, ao2_unlock, ast_debug, ast_log, ast_sip_get_pjsip_endpoint(), ast_sorcery_object_get_id(), send_request_wrapper::callback, send_request_wrapper::cb_called, endpt_send_request_cb(), LOG_ERROR, NULL, send_request_wrapper::send_cb_called, send_request_timer_callback(), send_request_wrapper_destructor(), send_request_wrapper::tdata, send_request_wrapper::timeout, send_request_wrapper::timeout_timer, TIMEOUT_TIMER2, TIMER_INACTIVE, and send_request_wrapper::token.
Referenced by ast_sip_send_out_of_dialog_request(), and check_request_status().
|
static |
Definition at line 1423 of file res_pjsip.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_debug, ast_sip_get_pjsip_endpoint(), send_request_wrapper::callback, send_request_wrapper::cb_called, send_request_wrapper::send_cb_called, send_request_wrapper::timeout_timer, TIMEOUT_TIMER2, TIMER_INACTIVE, and send_request_wrapper::token.
Referenced by endpt_send_request().
|
static |
Definition at line 1146 of file res_pjsip.c.
References ARRAY_LEN, method, methods, and NULL.
Referenced by ast_sip_create_request().
|
static |
Definition at line 2647 of file res_pjsip.c.
References ARRAY_LEN, ast_cli_register_multiple, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_res_pjsip_init_message_filter(), ast_res_pjsip_init_options_handling(), ast_res_pjsip_initialize_configuration(), ast_res_pjsip_preinit_options_handling(), ast_serializer_pool_create(), ast_serializer_pool_destroy(), ast_sip_destroy_scheduler(), ast_sip_initialize_distributor(), ast_sip_initialize_dns(), ast_sip_initialize_global_headers(), ast_sip_initialize_resolver(), ast_sip_initialize_scheduler(), ast_sip_initialize_system(), ast_sip_initialize_transport_events(), ast_sip_initialize_transport_management(), ast_sip_register_service(), AST_TEST_REGISTER, ast_threadpool_create(), ast_threadpool_shutdown(), cli_commands, error(), load_pjsip(), LOG_ERROR, LOG_WARNING, NULL, options, pjsip_media_type_application_cpim_xpidf_xml, pjsip_media_type_application_json, pjsip_media_type_application_media_control_xml, pjsip_media_type_application_pidf_xml, pjsip_media_type_application_rlmi_xml, pjsip_media_type_application_sdp, pjsip_media_type_application_simple_message_summary, pjsip_media_type_application_xpidf_xml, pjsip_media_type_multipart_alternative, pjsip_media_type_multipart_mixed, pjsip_media_type_multipart_related, pjsip_media_type_text_plain, SERIALIZER_POOL_SIZE, sip_get_threadpool_options(), sip_serializer_pool, sip_thread_start(), sip_threadpool, supplement_module, and unload_pjsip().
|
static |
Definition at line 2567 of file res_pjsip.c.
References ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_pjproject_caching_pool_init(), ast_pjsip_endpoint, ast_verb, caching_pool, error(), host_ip_ipv4, host_ip_ipv4_string, host_ip_ipv6, host_ip_ipv6_string, LOG_ERROR, memory_pool, monitor_continue, monitor_thread, monitor_thread_exec(), NULL, remove_request_headers(), and status.
Referenced by load_module().
|
static |
Definition at line 2100 of file res_pjsip.c.
References ast_pjsip_endpoint, monitor_continue, and NULL.
Referenced by load_pjsip().
void never_called_res_pjsip | ( | void | ) |
Definition at line 2628 of file res_pjsip.c.
References NULL.
|
static |
Definition at line 95 of file res_pjsip.c.
References ast_debug, ast_log, ast_pjsip_endpoint, and LOG_ERROR.
Referenced by ast_sip_register_service().
|
static |
Definition at line 2515 of file res_pjsip.c.
References ast_res_pjsip_init_options_handling(), ast_res_pjsip_reload_configuration(), and ast_sip_initialize_dns().
Referenced by reload_module().
|
static |
Definition at line 2775 of file res_pjsip.c.
References ast_log, ast_sip_push_task_wait_servant(), LOG_WARNING, NULL, and reload_configuration_task().
|
static |
Definition at line 2436 of file res_pjsip.c.
References request_headers.
Referenced by load_pjsip().
|
static |
Definition at line 1340 of file res_pjsip.c.
References ast_log, LOG_WARNING, and NULL.
Referenced by ast_sip_send_request().
|
static |
Definition at line 1732 of file res_pjsip.c.
References ao2_ref, AST_LIST_TRAVERSE, ast_log, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, send_request_data::callback, challenge(), check_request_status(), does_method_match(), send_request_data::endpoint, ast_sip_supplement::incoming_response, LOG_ERROR, ast_sip_supplement::method, ast_sip_supplement::next, and send_request_data::token.
Referenced by ast_sip_send_out_of_dialog_request(), and check_request_status().
|
static |
Definition at line 1384 of file res_pjsip.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, send_request_data::callback, send_request_data::endpoint, NULL, send_request_data_destroy(), and send_request_data::token.
Referenced by ast_sip_send_out_of_dialog_request().
|
static |
Definition at line 1377 of file res_pjsip.c.
References ao2_cleanup, and send_request_data::endpoint.
Referenced by send_request_data_alloc().
|
static |
Definition at line 1498 of file res_pjsip.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_debug, send_request_wrapper::callback, send_request_wrapper::cb_called, send_request_wrapper::tdata, send_request_wrapper::timeout, TIMEOUT_TIMER2, TIMER_INACTIVE, and send_request_wrapper::token.
Referenced by endpt_send_request().
|
static |
Definition at line 1538 of file res_pjsip.c.
References ast_debug, and send_request_wrapper::tdata.
Referenced by endpt_send_request().
|
static |
Definition at line 608 of file res_pjsip.c.
References ast_sip_get_default_from_user(), ast_sip_get_disable_multi_domain(), ast_sip_get_pjsip_endpoint(), ast_strlen_zero(), tmp(), and type.
Referenced by ast_sip_create_dialog_uac(), and create_out_of_dialog_request().
|
static |
Definition at line 2119 of file res_pjsip.c.
References ast_log, ast_threadstorage_get(), desc, LOG_ERROR, pj_thread_storage, servant_id_storage, SIP_SERVANT_ID, and thread.
Referenced by load_module().
|
static |
Definition at line 2109 of file res_pjsip.c.
References monitor_continue, and monitor_thread.
Referenced by unload_pjsip().
|
static |
Definition at line 2184 of file res_pjsip.c.
References ao2_cleanup, AST_LIST_TRAVERSE, ast_pjsip_rdata_get_endpoint(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, does_method_match(), ast_sip_supplement::incoming_request, ast_sip_supplement::method, and ast_sip_supplement::next.
|
static |
Definition at line 2208 of file res_pjsip.c.
References ao2_cleanup, AST_LIST_TRAVERSE, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_sip_message_apply_transport(), ast_sip_mod_data_get, ast_sip_mod_data_set, does_method_match(), ast_sip_supplement::method, MOD_DATA_CONTACT, NULL, ast_sip_supplement::outgoing_response, supplement_module, and ast_sip_endpoint::transport.
Referenced by ast_sip_send_response(), and ast_sip_send_stateful_response().
|
static |
Definition at line 1951 of file res_pjsip.c.
References ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, sync_task_data::complete, sync_task_data::cond, sync_task_data::fail, sync_task_data::lock, sync_task_data::task, and sync_task_data::task_data.
Referenced by ast_sip_push_task_wait().
|
static |
Determine if a SIPS Contact header is required.
This uses the guideline provided in RFC 3261 Section 12.1.1 to determine if the Contact header must be a sips: URI.
rdata | The incoming dialog-starting request |
0 | SIPS not required |
1 | SIPS required |
Definition at line 943 of file res_pjsip.c.
References ast_assert, and NULL.
Referenced by create_dialog_uas().
|
static |
Definition at line 2789 of file res_pjsip.c.
|
static |
Definition at line 2523 of file res_pjsip.c.
References ast_pjproject_caching_pool_destroy(), ast_pjsip_endpoint, ast_res_pjsip_cleanup_message_filter(), ast_res_pjsip_cleanup_options_handling(), ast_res_pjsip_destroy_configuration(), ast_sip_destroy_distributor(), ast_sip_destroy_global_headers(), ast_sip_destroy_system(), ast_sip_destroy_transport_events(), ast_sip_destroy_transport_management(), ast_sip_unregister_service(), caching_pool, memory_pool, monitor_thread, NULL, sip_serializer_pool, stop_monitor_thread(), and supplement_module.
Referenced by load_module().
|
static |
Definition at line 115 of file res_pjsip.c.
References ast_debug, and ast_pjsip_endpoint.
Referenced by ast_sip_unregister_service().
|
static |
Definition at line 2789 of file res_pjsip.c.
|
static |
Definition at line 2814 of file res_pjsip.c.
|
static |
Definition at line 67 of file res_pjsip.c.
Referenced by ast_sip_get_pjsip_endpoint(), load_pjsip(), monitor_thread_exec(), register_service(), unload_pjsip(), and unregister_service().
pj_caching_pool caching_pool |
Definition at line 2095 of file res_pjsip.c.
Referenced by load_pjsip(), and unload_pjsip().
|
static |
Definition at line 435 of file res_pjsip.c.
Referenced by load_module().
struct endpoint_formatters endpoint_formatters = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
|
static |
|
static |
Local host address for IPv4
Definition at line 72 of file res_pjsip.c.
Referenced by ast_sip_get_host_ip(), and load_pjsip().
|
static |
Local host address for IPv4 (string form)
Definition at line 75 of file res_pjsip.c.
Referenced by ast_sip_get_host_ip(), ast_sip_get_host_ip_string(), and load_pjsip().
|
static |
Local host address for IPv6
Definition at line 78 of file res_pjsip.c.
Referenced by ast_sip_get_host_ip(), and load_pjsip().
|
static |
Local host address for IPv6 (string form)
Definition at line 81 of file res_pjsip.c.
Referenced by ast_sip_get_host_ip(), ast_sip_get_host_ip_string(), and load_pjsip().
|
static |
Definition at line 1126 of file res_pjsip.c.
pj_pool_t* memory_pool |
Definition at line 2096 of file res_pjsip.c.
Referenced by load_pjsip(), and unload_pjsip().
|
static |
Definition at line 1127 of file res_pjsip.c.
Referenced by does_method_match().
const char* method |
Definition at line 1130 of file res_pjsip.c.
Referenced by __sip_pretend_ack(), ari_handle_websocket(), ast_ari_callback(), ast_ari_invoke(), ast_get_http_method(), ast_http_send(), ast_sip_create_request(), ast_sip_session_refresh(), ast_websocket_uri_cb(), auth_http_callback(), auth_manager_http_callback(), auth_mxml_http_callback(), build_reply_digest(), caldav_request(), create_in_dialog_request(), create_out_of_dialog_request(), delay_request(), delayed_method2str(), delayed_request_alloc(), does_method_match(), exchangecal_request(), generic_http_callback(), get_pjsip_method(), handle_uri(), has_supplement(), http_callback(), http_post_callback(), httpd_process_request(), httpstatus_callback(), ident_handler(), ident_to_str(), is_method_allowed(), manager_http_callback(), mark_method_allowed(), mark_method_unallowed(), mark_parsed_methods(), mxml_http_callback(), phoneprov_callback(), res_sdp_crypto_parse_offer(), resp_needs_contact(), sip_endpoint_identifier_str2type(), sip_endpoint_identifier_type2str(), sip_session_refresh(), static_callback(), and update_connected_line_information().
struct { ... } methods[] |
Referenced by get_auth_methods(), get_pjsip_method(), ident_to_str(), mark_parsed_methods(), and parse_allowed_methods().
|
static |
Definition at line 2098 of file res_pjsip.c.
Referenced by load_pjsip(), monitor_thread_exec(), and stop_monitor_thread().
pj_thread_t* monitor_thread |
Definition at line 2097 of file res_pjsip.c.
Referenced by ast_sip_thread_is_servant(), load_pjsip(), stop_monitor_thread(), and unload_pjsip().
|
static |
Definition at line 2115 of file res_pjsip.c.
Referenced by sip_thread_start().
pjsip_media_type pjsip_media_type_application_cpim_xpidf_xml |
Definition at line 2638 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_application_json |
Common media types used throughout res_pjsip and pjproject
Definition at line 2634 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_application_media_control_xml |
Definition at line 2635 of file res_pjsip.c.
Referenced by load_module(), and video_info_incoming_request().
pjsip_media_type pjsip_media_type_application_pidf_xml |
Definition at line 2636 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_application_rlmi_xml |
Definition at line 2639 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_application_sdp |
Definition at line 2641 of file res_pjsip.c.
Referenced by filter_on_tx_message(), load_module(), and session_outgoing_nat_hook().
pjsip_media_type pjsip_media_type_application_simple_message_summary |
Definition at line 2640 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_application_xpidf_xml |
Definition at line 2637 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_multipart_alternative |
Definition at line 2642 of file res_pjsip.c.
Referenced by check_content_disposition(), and load_module().
pjsip_media_type pjsip_media_type_multipart_mixed |
Definition at line 2643 of file res_pjsip.c.
Referenced by check_content_disposition(), and load_module().
pjsip_media_type pjsip_media_type_multipart_related |
Definition at line 2644 of file res_pjsip.c.
Referenced by load_module().
pjsip_media_type pjsip_media_type_text_plain |
Definition at line 2645 of file res_pjsip.c.
Referenced by load_module().
const pjsip_method* pmethod |
Definition at line 1131 of file res_pjsip.c.
Referenced by ast_sip_create_request().
|
static |
Definition at line 131 of file res_pjsip.c.
Referenced by ast_sip_check_authentication(), ast_sip_register_authenticator(), and ast_sip_unregister_authenticator().
|
static |
Definition at line 182 of file res_pjsip.c.
Referenced by ast_sip_create_request_with_auth(), ast_sip_register_outbound_authenticator(), and ast_sip_unregister_outbound_authenticator().
|
static |
Definition at line 2116 of file res_pjsip.c.
Referenced by ast_sip_thread_is_servant(), and sip_thread_start().
|
static |
Pool of serializers to use if not supplied.
Definition at line 65 of file res_pjsip.c.
Referenced by ast_sip_push_task(), ast_sip_push_task_wait_serializer(), load_module(), and unload_pjsip().
|
static |
Definition at line 69 of file res_pjsip.c.
Referenced by ast_sip_create_serializer_group(), ast_sip_threadpool(), ast_sip_threadpool_queue_size(), and load_module().
|
static |
Definition at line 1168 of file res_pjsip.c.
Referenced by ast_sip_create_response(), ast_sip_send_out_of_dialog_request(), ast_sip_send_stateful_response(), create_out_of_dialog_request(), load_module(), supplement_outgoing_response(), and unload_pjsip().
struct supplements supplements = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |