Asterisk - The Open Source Telephony Project
18.5.0
|
#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... | |
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... | |
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) |
AST_TEST_DEFINE (xml_sanitization_end_null) | |
AST_TEST_DEFINE (xml_sanitization_exceeds_buffer) | |
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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .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 , } |
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" |
Referenced by cli_show_endpoint_identifiers().
#define MOD_DATA_CONTACT "contact" |
Definition at line 3264 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(), and supplement_outgoing_response().
#define SERIALIZER_POOL_SIZE 8 |
Number of serializers in pool if one not supplied.
Definition at line 3267 of file res_pjsip.c.
Referenced by load_module().
#define SIP_SERVANT_ID 0x5E2F1D |
Definition at line 5294 of file res_pjsip.c.
Referenced by ast_sip_thread_is_servant(), and sip_thread_start().
#define TIMEOUT_TIMER2 5 |
Definition at line 4568 of file res_pjsip.c.
Referenced by endpt_send_request(), endpt_send_request_cb(), and send_request_timer_callback().
#define TIMER_INACTIVE 0 |
Definition at line 4567 of file res_pjsip.c.
Referenced by endpt_send_request(), endpt_send_request_cb(), and send_request_timer_callback().
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 4174 of file res_pjsip.c.
|
static |
Definition at line 5292 of file res_pjsip.c.
|
static |
Definition at line 5293 of file res_pjsip.c.
|
static |
Definition at line 5962 of file res_pjsip.c.
|
static |
Definition at line 5962 of file res_pjsip.c.
|
static |
Definition at line 5078 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 5240 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(), determine_sip_publish_type(), dialog_info_generate_body_content(), endpoint_lookup(), evaluate_like(), extract_contact_addr(), find_aor(), find_aor_name(), find_challenge(), get_auth_header(), get_codecs(), get_destination(), 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(), register_aor_core(), rfc3326_use_reason_header(), rx_data_to_ast_msg(), save_response_fields_to_transport(), sdp_requires_deferral(), security_event_populate(), session_inv_on_redirected(), session_outgoing_nat_hook(), set_id_from_hdr(), set_id_from_oli(), set_mid_and_bundle_group(), set_redirecting_value(), set_remote_mslabel_and_stream_group(), set_sipdomain_variable(), sip_resolve(), 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.
dest | [out] The destination buffer |
src | The pj_str_t to copy |
Number | of characters copied or negative value on error |
Definition at line 5247 of file res_pjsip.c.
References ast_asprintf, and NULL.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 5962 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 5091 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 parts of the body to add |
0 | Success |
-1 | Failure |
Definition at line 5098 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 3288 of file res_pjsip.c.
References ast_sip_add_header(), and NULL.
Referenced by add_date_header(), and register_aor_core().
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 5063 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(), options_incoming_request(), rfc3326_add_reason_header(), send_options_response(), sip_publication_respond(), transfer_refer(), and vars_to_headers().
void ast_sip_add_usereqphone | ( | const struct ast_sip_endpoint * | endpoint, |
pj_pool_t * | pool, | ||
pjsip_uri * | uri | ||
) |
Add 'user=phone' parameter to URI if enabled and user is a phone number.
endpoint | The endpoint to use for configuration |
pool | The memory pool to allocate the parameter from |
uri | The URI to check for user and to add parameter to |
Definition at line 3994 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 | The string to append to the end of the current body |
0 | Success |
-1 | Failure |
Definition at line 5114 of file res_pjsip.c.
References ast_str_alloca, ast_str_buffer(), and ast_str_set().
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 5534 of file res_pjsip.c.
References 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 5557 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 3377 of file res_pjsip.c.
References ast_log, AST_SIP_AUTHENTICATION_SUCCESS, ast_sip_authenticator::check_authentication, and LOG_WARNING.
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 4028 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 4233 of file res_pjsip.c.
References create_dialog_uas().
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 unknowningly 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 4249 of file res_pjsip.c.
References create_dialog_uas().
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.
rdata[out] | 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 4323 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.
rdata[out] | 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 4271 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 4490 of file res_pjsip.c.
References ast_assert, ast_log, create_in_dialog_request(), create_out_of_dialog_request(), get_pjsip_method(), LOG_WARNING, 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 3412 of file res_pjsip.c.
References ast_log, ast_sip_outbound_authenticator::create_request_with_auth, and LOG_WARNING.
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] | 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 5448 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 register_aor_core(), 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 5338 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 5349 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 3791 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 5484 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, and AST_SIP_DTMF_RFC_4733.
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 4871 of file res_pjsip.c.
References NULL, and send_request_cb().
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 |
endpoint | ami AMI variable container |
count | the number of formatters operated on |
0 | Success, otherwise non-zero on error |
Definition at line 3699 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 5460 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 5473 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 3718 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(), digest_create_request_with_auth(), distribute(), distributor(), do_cli_dump_endpt(), endpoint_lookup(), endpt_send_request(), endpt_send_request_cb(), exten_state_data_alloc(), exten_state_data_destructor(), exten_state_publisher_cb(), filter_on_tx_message(), find_registrar_aor(), keepalive_transport_send_keepalive(), load_module(), logging_on_rx_msg(), logging_on_tx_msg(), notify_task(), on_rx_process_uris(), options_incoming_request(), parse_uri_cb(), pre_session_setup(), publish_request_initial(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_subscribe_request(), register_aor(), register_aor_core(), registrar_on_rx_request(), reschedule_reinvite(), schedule_publish_refresh(), schedule_registration(), send_options_response(), session_reinvite_on_rx_request(), sip_check_transport(), sip_dialog_create_contact(), sip_dialog_create_from(), sip_outbound_publisher_init(), sip_outbound_registration_regc_alloc(), sip_publication_respond(), sip_replace_resolver(), sip_session_defer_termination_stop_timer(), 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 3762 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, host, 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 3528 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 5259 of file res_pjsip.c.
References compare().
Referenced by asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), check_content_type(), filter_on_tx_message(), pubsub_on_rx_notify_request(), session_outgoing_nat_hook(), and video_info_incoming_request().
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 5587 of file res_pjsip.c.
References ast_alloca, ast_escape_quoted(), ast_strlen_zero, ast_party_id::name, NULL, ast_party_id::number, ast_party_name::str, ast_party_number::str, ast_party_name::valid, and ast_party_number::valid.
Referenced by add_pai_header(), add_rpid_header(), and set_from_header().
|
static |
Definition at line 5176 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 3543 of file res_pjsip.c.
References NULL.
Referenced by stir_shaken_incoming_request().
int ast_sip_register_authenticator | ( | struct ast_sip_authenticator * | auth | ) |
Register a SIP authenticator.
An authenticator has three main purposes: 1) Determining if authentication should be performed on an incoming request 2) Gathering credentials necessary for issuing an authentication challenge 3) Authenticating a request that has credentials
Asterisk provides a default authenticator, but it may be replaced by a custom one if desired.
auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 3338 of file res_pjsip.c.
References ast_debug, ast_log, and LOG_WARNING.
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 3679 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 3508 of file res_pjsip.c.
References ast_sip_register_endpoint_identifier_with_name(), 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 3431 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, endpoint_identifier_list::identifier, lock, LOG_ERROR, 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.
auth | The authenticator to register |
0 | Success |
-1 | Failure |
Definition at line 3389 of file res_pjsip.c.
References ast_debug, ast_log, and LOG_WARNING.
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 3315 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 |
0 | Success |
-1 | Failure |
Definition at line 4511 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 3361 of file res_pjsip.c.
References ast_sip_endpoint::allow_unauthenticated_options, ast_debug, ast_log, LOG_WARNING, and ast_sip_authenticator::requires_authentication.
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 4993 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(), endpt_send_request(), ast_sip_supplement::method, MOD_DATA_CONTACT, NULL, ast_sip_supplement::outgoing_request, 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 5034 of file res_pjsip.c.
References ast_assert, ast_sip_send_out_of_dialog_request(), 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 |
endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 5407 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 |
endpoint | The ast_sip_endpoint associated with this response |
0 | Success |
-1 | Failure |
Definition at line 5420 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 5047 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 3975 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 3907 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, ast_sip_transport::flow, LOG_ERROR, LOG_WARNING, ast_sip_transport_state::transport, and ast_sip_transport::type.
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 3957 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 5513 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 5630 of file res_pjsip.c.
References sip_threadpool.
Referenced by load_module().
long ast_sip_threadpool_queue_size | ( | void | ) |
Return the size of the SIP threadpool's task queue.
Definition at line 5625 of file res_pjsip.c.
References ast_threadpool_queue_size().
void ast_sip_tpselector_unref | ( | pjsip_tpselector * | selector | ) |
Unreference a pjsip_tpselector.
selector | The selector to be unreffed |
Definition at line 3987 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 3350 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and NULL.
Referenced by unload_module().
void ast_sip_unregister_endpoint_formatter | ( | struct ast_sip_endpoint_formatter * | obj | ) |
Unregister an endpoint formatter.
obj | the formatter to unregister |
Definition at line 3685 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_options_handling(), ast_sip_destroy_sorcery_auth(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_sorcery_transport(), and unload_module().
void ast_sip_unregister_endpoint_identifier | ( | struct ast_sip_endpoint_identifier * | identifier | ) |
Unregister a SIP endpoint identifier.
This stops an endpoint identifier from being used.
identifier | The SIP endoint identifier to unregister |
Definition at line 3513 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 3401 of file res_pjsip.c.
References ast_debug, ast_log, LOG_WARNING, and NULL.
Referenced by unload_module().
void ast_sip_unregister_service | ( | pjsip_module * | module | ) |
This is the opposite of ast_sip_register_service(). Unregistering a service means that PJSIP will no longer call into the module any more. This will likely occur when an Asterisk module is unloaded.
module | The PJSIP module to unregister |
Definition at line 3331 of file res_pjsip.c.
References ast_sip_push_task_wait_servant(), NULL, and unregister_service().
Referenced by ast_res_pjsip_cleanup_message_filter(), ast_sip_destroy_distributor(), ast_sip_destroy_global_headers(), ast_sip_destroy_transport_management(), load_module(), unload_module(), and unload_pjsip().
void ast_sip_unregister_supplement | ( | struct ast_sip_supplement * | supplement | ) |
Unregister a an supplement to SIP out of dialog processing.
supplement | The supplement to unregister |
Definition at line 4531 of file res_pjsip.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, lock, ast_sip_supplement::next, and SCOPED_LOCK.
Referenced by ast_res_pjsip_cleanup_message_filter(), and unload_module().
int ast_sip_will_uri_survive_restart | ( | pjsip_sip_uri * | uri, |
struct ast_sip_endpoint * | endpoint, | ||
pjsip_rx_data * | rdata | ||
) |
Definition at line 3723 of file res_pjsip.c.
References ast_sip_endpoint::nat, result, and ast_sip_endpoint_nat_configuration::rewrite_contact.
Referenced by register_aor_core(), and subscription_persistence_update().
AST_TEST_DEFINE | ( | xml_sanitization_end_null | ) |
Definition at line 5636 of file res_pjsip.c.
References ast_sip_sanitize_xml(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), TEST_EXECUTE, and TEST_INIT.
AST_TEST_DEFINE | ( | xml_sanitization_exceeds_buffer | ) |
Definition at line 5661 of file res_pjsip.c.
References ast_sip_sanitize_xml(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_test_status_update, sip_to_pjsip::info(), TEST_EXECUTE, and TEST_INIT.
|
static |
Definition at line 4894 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, and ast_sip_endpoint::outbound_auths.
Referenced by send_request_cb().
|
static |
Definition at line 3569 of file res_pjsip.c.
References ast_cli_args::argc, ast_cli_args::argv, 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 3609 of file res_pjsip.c.
References ast_cli_args::argc, 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, ast_cli_args::fd, lock, endpoint_identifier_list::name, NULL, SCOPED_LOCK, and ast_cli_entry::usage.
|
static |
Definition at line 3640 of file res_pjsip.c.
References ast_cli(), ast_free, ast_str_buffer(), ast_str_create, CLI_FAILURE, CLI_GENERATE, CLI_INIT, CLI_SUCCESS, ast_cli_entry::command, ast_cli_args::fd, NULL, ast_sip_cli_context::output_buffer, sip_cli_print_global(), sip_cli_print_system(), and ast_cli_entry::usage.
|
static |
Definition at line 4177 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, 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 4362 of file res_pjsip.c.
References ast_log, LOG_WARNING, and supplement_on_rx_request().
Referenced by ast_sip_create_request().
|
static |
Definition at line 4380 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, MOD_DATA_CONTACT, NULL, ast_sip_endpoint::outbound_proxy, pool, RAII_VAR, sip_dialog_create_from(), and supplement_module.
Referenced by ast_sip_create_request().
|
static |
Definition at line 3558 of file res_pjsip.c.
References a, ast_cli_args::argc, ast_pjproject_log_intercept_begin(), ast_pjproject_log_intercept_end(), ast_sip_get_pjsip_endpoint(), and ast_cli_args::fd.
Referenced by cli_dump_endpt().
|
static |
Definition at line 4554 of file res_pjsip.c.
References ast_strlen_zero, 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 4751 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, timeout, 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 4628 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 4351 of file res_pjsip.c.
References ARRAY_LEN, methods, and NULL.
Referenced by ast_sip_create_request().
|
static |
Definition at line 5810 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(), error(), load_pjsip(), LOG_ERROR, LOG_WARNING, NULL, SERIALIZER_POOL_SIZE, sip_get_threadpool_options(), sip_thread_start(), supplement_module, ast_threadpool_options::thread_start, and unload_pjsip().
Referenced by unload_module().
|
static |
Definition at line 5744 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, error(), host_ip_ipv4, host_ip_ipv4_string, host_ip_ipv6, host_ip_ipv6_string, LOG_ERROR, monitor_thread_exec(), never_called_res_pjsip(), NULL, remove_request_headers(), and status.
Referenced by load_module().
|
static |
Definition at line 5277 of file res_pjsip.c.
References ast_pjsip_endpoint, and NULL.
Referenced by load_pjsip().
void never_called_res_pjsip | ( | void | ) |
|
static |
Definition at line 3300 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 5692 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 5923 of file res_pjsip.c.
References ast_log, ast_sip_push_task_wait_servant(), LOG_WARNING, NULL, and reload_configuration_task().
Referenced by unload_module().
|
static |
Definition at line 5613 of file res_pjsip.c.
References request_headers.
Referenced by load_pjsip().
|
static |
Definition at line 4545 of file res_pjsip.c.
References ast_log, LOG_WARNING, and NULL.
Referenced by ast_sip_send_request().
|
static |
Definition at line 4937 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_failover_request().
|
static |
Definition at line 4589 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 4582 of file res_pjsip.c.
References ao2_cleanup, and send_request_data::endpoint.
Referenced by send_request_data_alloc().
|
static |
Definition at line 4703 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 4743 of file res_pjsip.c.
References ast_debug, and send_request_wrapper::tdata.
Referenced by endpt_send_request().
|
static |
Definition at line 3813 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 5296 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 |
|
static |
Definition at line 5361 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.
Referenced by create_in_dialog_request().
|
static |
Definition at line 5385 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 5156 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 4148 of file res_pjsip.c.
References ast_assert, and NULL.
Referenced by create_dialog_uas().
|
static |
Definition at line 5937 of file res_pjsip.c.
References ARRAY_LEN, ast_cli_unregister_multiple(), AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CHANNEL_DEPEND, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_serializer_pool_destroy(), ast_sip_destroy_scheduler(), ast_sip_push_task_wait_servant(), AST_TEST_UNREGISTER, ast_threadpool_shutdown(), ASTERISK_GPL_KEY, load_module(), NULL, reload(), reload_module(), and unload_pjsip().
|
static |
Definition at line 5700 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(), memory_pool, NULL, stop_monitor_thread(), and supplement_module.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 3320 of file res_pjsip.c.
References ast_debug, and ast_pjsip_endpoint.
Referenced by ast_sip_unregister_service().
|
static |
Definition at line 5962 of file res_pjsip.c.
|
static |
Definition at line 5962 of file res_pjsip.c.
|
static |
Definition at line 3272 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 5272 of file res_pjsip.c.
|
static |
Definition at line 3671 of file res_pjsip.c.
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 3277 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 3280 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 3283 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 3286 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 4331 of file res_pjsip.c.
pj_pool_t* memory_pool |
Definition at line 5273 of file res_pjsip.c.
Referenced by unload_pjsip().
|
static |
Definition at line 4332 of file res_pjsip.c.
const char* method |
Definition at line 4335 of file res_pjsip.c.
Referenced by __sip_pretend_ack(), ast_ari_invoke(), ast_websocket_uri_cb(), delayed_request_alloc(), does_method_match(), has_supplement(), httpd_process_request(), ident_handler(), ident_to_str(), mark_method_allowed(), mark_method_unallowed(), mark_parsed_methods(), misdn_cfg_is_group_method(), res_sdp_crypto_parse_offer(), sip_endpoint_identifier_str2type(), sorcery_function_read(), and update_connected_line_information().
struct { ... } methods[] |
Referenced by get_auth_methods(), get_pjsip_method(), ident_to_str(), parse_allowed_methods(), and sorcery_function_read().
|
static |
Definition at line 5275 of file res_pjsip.c.
pj_thread_t* monitor_thread |
Definition at line 5274 of file res_pjsip.c.
|
static |
Definition at line 5292 of file res_pjsip.c.
Referenced by sip_thread_start().
const pjsip_method* pmethod |
Definition at line 4336 of file res_pjsip.c.
Referenced by ast_sip_create_request().
|
static |
Definition at line 3336 of file res_pjsip.c.
|
static |
Definition at line 3387 of file res_pjsip.c.
|
static |
Definition at line 5293 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 3270 of file res_pjsip.c.
|
static |
Definition at line 3274 of file res_pjsip.c.
Referenced by ast_sip_threadpool().
|
static |
Definition at line 4373 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} } , } |