24 #include <pjsip_simple.h> 25 #include <pjsip/sip_transaction.h> 54 #define PJSIP_MINVERSION(m,n,p) (((m << 24) | (n << 16) | (p << 8)) >= PJ_VERSION_NUM) 56 #ifndef PJSIP_EXPIRES_NOT_SPECIFIED 63 #define PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)-1) 71 struct pjsip_transport;
72 struct pjsip_tpfactory;
73 struct pjsip_tls_setting;
74 struct pjsip_tpselector;
77 #define SIP_TLS_MAX_CIPHERS 64 80 #define MAX_RX_CHALLENGES 10 82 AST_VECTOR(ast_sip_service_route_vector,
char *);
162 #define ast_sip_transport_is_nonlocal(transport_state, addr) \ 163 (!transport_state->localnet || ast_apply_ha(transport_state->localnet, addr) == AST_SENSE_ALLOW) 165 #define ast_sip_transport_is_local(transport_state, addr) \ 166 (transport_state->localnet && ast_apply_ha(transport_state->localnet, addr) != AST_SENSE_ALLOW) 254 #define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias" 305 struct timeval expiration_time;
371 unsigned int minimum_expiration;
373 unsigned int maximum_expiration;
377 unsigned int qualify_frequency;
379 int authenticate_qualify;
381 unsigned int max_contacts;
383 unsigned int remove_existing;
387 unsigned int support_path;
389 double qualify_timeout;
391 char *voicemail_extension;
444 #define SIP_SORCERY_AUTH_TYPE "auth" 466 unsigned int nonce_lifetime;
562 #define ast_sip_call_codec_pref_test(__param, __codec_pref) (!!(ast_test_flag( &__param, AST_SIP_CALL_CODEC_PREF_ ## __codec_pref ))) 571 unsigned int sess_expires;
598 unsigned int aggregate;
600 unsigned int subscribe_replaces_unsolicited;
602 char *voicemail_extension;
612 unsigned int minexpiry;
624 unsigned int force_rport;
637 unsigned int trust_inbound;
639 unsigned int trust_outbound;
641 unsigned int send_pai;
643 unsigned int send_rpid;
645 unsigned int rpid_immediate;
647 unsigned int send_diversion;
649 unsigned int trust_connected_line;
651 unsigned int send_connected_line;
655 unsigned int send_history_info;
667 struct ast_namedgroups *named_callgroups;
669 struct ast_namedgroups *named_pickupgroups;
705 unsigned int symmetric;
707 unsigned int ice_support;
709 unsigned int use_ptime;
711 unsigned int use_avpf;
713 unsigned int force_avp;
715 unsigned int use_received_transport;
719 unsigned int srtp_tag_32;
723 unsigned int encryption_optimistic;
729 unsigned int timeout_hold;
731 unsigned int follow_early_media_fork;
733 unsigned int accept_multiple_sdp_answers;
747 unsigned int disable_on_nat;
756 unsigned int maxdatagram;
794 unsigned int g726_non_standard;
796 unsigned int bind_rtp_to_media_address;
800 unsigned int max_audio_streams;
802 unsigned int max_video_streams;
808 struct ast_flags incoming_call_offer_pref;
810 struct ast_flags outgoing_call_offer_pref;
877 unsigned int inband_progress;
881 unsigned int devicestate_busy_at;
883 unsigned int faxdetect;
885 unsigned int allowtransfer;
891 unsigned int usereqphone;
893 unsigned int moh_passthrough;
899 unsigned int faxdetect_timeout;
903 unsigned int preferred_codec_only;
905 unsigned int asymmetric_rtp_codec;
907 unsigned int allow_overlap;
909 unsigned int refer_blind_progress;
911 unsigned int notify_early_inuse_ringing;
913 unsigned int suppress_q850_reason_headers;
915 unsigned int ignore_183_without_sdp;
917 unsigned int stir_shaken;
919 unsigned int allow_unauthenticated_options;
923 #define AST_SIP_X_AST_TXP "x-ast-txp" 924 #define AST_SIP_X_AST_TXP_LEN 9 969 int (*requires_authentication)(
struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata);
980 pjsip_rx_data *rdata, pjsip_tx_data *tdata);
1001 struct pjsip_tx_data *old_request,
struct pjsip_tx_data **new_request);
1252 unsigned int flags);
1283 unsigned int flags);
1313 unsigned int flags);
1411 struct timeval expiration_time,
const char *path_info,
const char *user_agent,
1412 const char *via_addr,
int via_port,
const char *call_id,
1436 const char *uri,
struct timeval expiration_time,
const char *path_info,
1437 const char *user_agent,
const char *via_addr,
int via_port,
const char *call_id,
1945 int *
interval,
int *time_left,
struct timeval *next_start);
1980 int *
interval,
int *time_left,
struct timeval *next_start);
2045 const char *subtype;
2047 const char *body_text;
2112 pjsip_rx_data *rdata, pj_status_t *status);
2131 const char *src_name,
int src_port,
char *transport_type,
const char *local_name,
2132 int local_port,
const char *contact_uri);
2149 int src_port,
char *transport_type,
const char *local_name,
int local_port);
2205 void (*callback)(
void *token, pjsip_event *e));
2236 void (*callback)(
void *token, pjsip_event *e));
2324 pjsip_rx_data *rdata, pjsip_tx_data *tdata);
2335 pjsip_tx_data *tdata, pjsip_tx_data **new_request);
2539 struct ast_sip_auth_objects_vector *auth_objects);
2552 #define ast_sip_cleanup_auth_objects_vector(auth_objects) AST_VECTOR_RESET(auth_objects, ao2_cleanup) 2619 const char* req_type);
2652 #define ast_sip_mod_data_get(mod_data, id, key) \ 2653 ast_sip_dict_get(mod_data[id], key) 2669 const char *key,
void *
val);
2684 #define ast_sip_mod_data_set(pool, mod_data, id, key, val) \ 2685 mod_data[id] = ast_sip_dict_set(pool, mod_data[id], key, val) 2757 const char *action_id;
2940 void (*incoming_response)(
struct ast_sip_endpoint *endpoint,
struct pjsip_rx_data *rdata);
3050 #define AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(str) \ 3052 char *__semi = strchr((str), ';'); \ 3053 if (__semi && ast_sip_get_ignore_uri_user_options()) { \ 3342 unsigned int *prune_interval);
3362 pjsip_sip_uri *sip_uri,
char *
buf,
size_t buf_len);
3376 pjsip_sip_uri *sip_uri, pjsip_tpselector *selector);
3395 pjsip_tpselector *selector);
3410 char *
buf,
size_t buf_len);
3569 pjsip_tp_state_callback cb;
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.
unsigned long long ast_group_t
Call pickup configuration options for endpoints.
Information needed to identify an endpoint in a call.
static char accountcode[AST_MAX_ACCOUNT_CODE]
int ast_sip_register_outbound_authenticator(struct ast_sip_outbound_authenticator *outbound_auth)
Register an outbound SIP authenticator.
void ast_sip_report_mem_limit(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Send a security event notification for when a memory limit is hit.
struct ast_dnsmgr_entry * external_address_refresher
int ast_sip_auth_vector_init(struct ast_sip_auth_vector *vector, const char *auth_names)
Initialize an auth vector with the configured values.
long ast_sip_threadpool_queue_size(void)
Return the size of the SIP threadpool's task queue.
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.
ast_sip_scheduler_task_flags
Task flags for the res_pjsip scheduler.
ast_sip_contact_filter
Contact retrieval filtering flags.
int ast_sip_for_each_aor(const char *aors, ao2_callback_fn on_aor, void *arg)
For every aor in the comma separated aors string call the given 'on_aor' handler. ...
struct ao2_container * ast_sip_location_retrieve_aor_contacts_nolock(const struct ast_sip_aor *aor)
Retrieve all contacts currently available for an AOR without locking the AOR.
void ast_sip_report_auth_failed_challenge_response(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Send a security event notification for when a challenge response has failed.
The task is scheduled at multiples of interval.
char * ast_sip_get_regcontext(void)
Retrieve the global regcontext setting.
int ast_sip_register_authenticator(struct ast_sip_authenticator *auth)
Register a SIP authenticator.
Endpoint configuration options for INFO packages.
struct ast_sip_contact_status * ast_sip_get_contact_status(const struct ast_sip_contact *contact)
Retrieve the current status for a contact.
ast_sip_session_media_encryption
int ast_sip_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Determine if an incoming request requires authentication.
static uint32_t keepalive
struct timeval last_start
int ast_sip_for_each_channel_snapshot(const struct ast_endpoint_snapshot *endpoint_snapshot, ao2_callback_fn on_channel_snapshot, void *arg)
For every channel snapshot on an endpoint snapshot call the given 'on_channel_snapshot' handler...
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.
int ast_sip_sched_task_cancel(struct ast_sip_sched_task *schtd)
Cancels the next invocation of a task.
void ast_sip_dialog_set_serializer(pjsip_dialog *dlg, struct ast_taskprocessor *serializer)
Set a serializer on a SIP dialog so requests and responses are automatically serialized.
ast_sip_check_auth_result
Possible returns from ast_sip_check_authentication.
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 subscription configuration.
void ast_sip_auth_vector_destroy(struct ast_sip_auth_vector *vector)
Free contents of an auth vector.
enum ast_transport_monitor_reg ast_sip_transport_monitor_register(pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *ao2_data)
Register a reliable transport shutdown monitor callback.
ast_transport_monitor_reg
int ast_sip_set_outbound_proxy(pjsip_tx_data *tdata, const char *proxy)
Set the outbound proxy for an outbound SIP message.
static struct stasis_rest_handlers mailboxes
REST handler for /api-docs/mailboxes.json.
void * ast_sip_dict_get(void *ht, const char *key)
Retrieves the value associated with the given key.
void ast_sip_transport_state_register(struct ast_sip_tpmgr_state_callback *element)
Register a transport state notification callback element.
Party identification options for endpoints.
Structure for variables, used for configurations and for channel variables.
static pj_pool_t * pool
Global memory pool for configuration and timers.
void ast_sip_dialog_set_endpoint(pjsip_dialog *dlg, struct ast_sip_endpoint *endpoint)
Set an endpoint on a SIP dialog so in-dialog requests do not undergo endpoint lookup.
char * ast_sip_get_debug(void)
Retrieve the system debug setting (yes|no|host).
unsigned int ast_sip_get_norefersub(void)
Retrieve the global setting 'norefersub'.
int ast_sip_transport_state_set_preferred_identity(const char *transport_name, const char *identity)
Sets the P-Preferred-Identity on a child transport.
ast_sip_call_codec_pref
Incoming/Outgoing call offer/answer joint codec preference.
int ast_sip_for_each_channel(const struct ast_sip_endpoint *endpoint, ao2_callback_fn on_channel_snapshot, void *arg)
For every channel snapshot on an endpoint all the given 'on_channel_snapshot' handler.
Full structure for sorcery.
struct timeval when_queued
const char * ast_sip_get_contact_short_status_label(const enum ast_sip_contact_status_type status)
Background DNS update manager.
void ast_sip_unregister_outbound_authenticator(struct ast_sip_outbound_authenticator *auth)
Unregister an outbound SIP authenticator.
int ast_sip_location_add_contact_nolock(struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint)
Add a new contact to an AOR without locking the AOR.
const char * ast_sip_get_device_state(const struct ast_sip_endpoint *endpoint)
Retrieve the device state for an endpoint.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
struct ao2_container * ast_sip_location_retrieve_aor_contacts(const struct ast_sip_aor *aor)
Retrieve all contacts currently available for an AOR.
Wrapper for an ast_acl linked list.
Replaced the already existing transport monitor with new one.
const char * ast_sip_get_contact_status_label(const enum ast_sip_contact_status_type status)
translate ast_sip_contact_status_type to character string.
void ast_sip_get_default_realm(char *realm, size_t size)
Retrieve the global default realm.
void ast_copy_pj_str(char *dest, const pj_str_t *src, size_t size)
Copy a pj_str_t into a standard character buffer.
int ast_sip_str_to_dtmf(const char *dtmf_mode)
Convert the DTMF mode name into an enum.
void ast_sip_unregister_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
Unregister an endpoint formatter.
struct ast_sip_endpoint * ast_sip_default_outbound_endpoint(void)
Retrieve the default outbound endpoint.
int ast_sip_contact_to_str(void *object, void *arg, int flags)
Handler used to convert a contact to a string.
void * ast_sip_endpoint_alloc(const char *name)
Allocate a new SIP endpoint.
Endpoint configuration for SIP extensions.
struct ast_threadpool * ast_sip_threadpool(void)
Retrieve the SIP threadpool object.
struct spandsp_fax_stats t38
struct ast_sip_transport_state * state
int ast_sip_add_global_request_header(const char *name, const char *value, int replace)
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.
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.
int ast_sip_sched_task_get_times_by_name(const char *name, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end)
Gets the last start and end times of the task by name.
struct ao2_container * ast_sip_location_retrieve_aor_contacts_nolock_filtered(const struct ast_sip_aor *aor, unsigned int flags)
Retrieve all contacts currently available for an AOR without locking the AOR and filter based on flag...
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.
Socket address structure.
static struct ast_str * password
ast_endpoint_state
Valid states for an endpoint.
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.
int ast_sip_add_header(pjsip_tx_data *tdata, const char *name, const char *value)
Add a header to an outbound SIP message.
int ast_sip_persistent_endpoint_update_state(const char *endpoint_name, enum ast_endpoint_state state)
Change state of a persistent endpoint.
int(* ast_sip_dialog_outbound_auth_cb)(pjsip_dialog *dlg, pjsip_tx_data *tdata, void *user_data)
Callback called when an outbound request with authentication credentials is to be sent in dialog...
ast_sip_supplement_priority
int ast_sip_sched_is_task_running(struct ast_sip_sched_task *schtd)
Checks if the task is currently running.
ast_sip_contact_status_type
Status type for a contact.
struct ast_endpoint_snapshot * ast_sip_get_endpoint_snapshot(const struct ast_sip_endpoint *endpoint)
Retrieve the endpoint snapshot for an endpoint.
const char * ast_sip_get_host_ip_string(int af)
Retrieve the local host address in string form.
int ast_sip_failover_request(pjsip_tx_data *tdata)
Set a request to use the next value in the list of resolved addresses.
struct ast_sip_endpoint * ast_pjsip_rdata_get_endpoint(pjsip_rx_data *rdata)
Get the looked-up endpoint on an out-of dialog request or response.
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.
unsigned int ast_sip_get_mwi_tps_queue_high(void)
Retrieve the global MWI taskprocessor high water alert trigger level.
internal representation of ACL entries In principle user applications would have no need for this...
struct ast_sockaddr external_media_address
void ast_sip_unregister_authenticator(struct ast_sip_authenticator *auth)
Unregister a SIP authenticator.
int ast_sip_get_mwi_tps_queue_low(void)
Retrieve the global MWI taskprocessor low water clear alert level.
char * preferred_identity
int ast_sip_retrieve_auths(const struct ast_sip_auth_vector *auths, struct ast_sip_auth **out)
Retrieve relevant SIP auth structures from sorcery.
struct ast_sip_sched_task * ast_sip_schedule_task(struct ast_taskprocessor *serializer, int interval, ast_sip_task sip_task, const char *name, void *task_data, enum ast_sip_scheduler_task_flags flags)
Schedule a task to run in the res_pjsip thread pool.
void ast_sip_register_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
Register an endpoint formatter.
int() ao2_callback_fn(void *obj, void *arg, int flags)
Type of a generic callback function.
void ast_sip_report_failed_acl(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *name)
Send a security event notification for when an ACL check fails.
Structure for SIP nat hook information.
void ast_sip_report_req_no_support(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, const char *req_type)
Send a security event notification for when a request is not supported.
struct ast_sip_contact * ast_sip_location_retrieve_first_aor_contact_filtered(const struct ast_sip_aor *aor, unsigned int flags)
Retrieve the first bound contact for an AOR and filter based on flags.
int ast_sip_register_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier)
Register a SIP endpoint identifier.
Structure for SIP transport information.
char * ast_sip_rdata_get_header_value(pjsip_rx_data *rdata, const pj_str_t str)
Get a specific header value from rdata.
General Asterisk PBX channel definitions.
int ast_sip_sched_task_get_next_run_by_name(const char *name)
Gets the number of milliseconds until the next invocation.
const char * ast_sip_call_codec_pref_to_str(struct ast_flags pref)
Convert the call codec preference flags to a string.
int ast_sip_auths_to_str(const struct ast_sip_auth_vector *auths, char **buf)
Converts an auths array to a string of comma separated values.
struct ast_sip_contact * ast_sip_location_create_contact(struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, int prune_on_boot, struct ast_sip_endpoint *endpoint)
Create a new contact for an AOR without locking the AOR.
int ast_sip_add_body(pjsip_tx_data *tdata, const struct ast_sip_body *body)
Add a body to an outbound SIP message.
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.
struct pjsip_transport * transport
Transport itself.
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.
struct ao2_container * ast_sip_location_retrieve_contacts_from_aor_list(const char *aor_list)
Retrieve all contacts from a list of AORs.
static struct ao2_container * codecs
Registered codecs.
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.
struct ast_sip_endpoint * ast_sip_dialog_get_endpoint(pjsip_dialog *dlg)
Get the endpoint associated with this dialog.
static char mohsuggest[MAX_MUSICCLASS]
#define AST_STRING_FIELD(name)
Declare a string field.
ast_sip_direct_media_glare_mitigation
int ast_copy_pj_str2(char **dest, const pj_str_t *src)
Create and copy a pj_str_t into a standard character buffer.
In case you didn't read that giant block of text above the mansession_session struct, the struct mansession is named this solely to keep the API the same in Asterisk. This structure really represents data that is different from Manager action to Manager action. The mansession_session pointer contained within points to session-specific data.
struct ast_sip_endpoint * ast_sip_identify_endpoint(pjsip_rx_data *rdata)
Determine the endpoint that has sent a SIP message.
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.
char * ast_sip_get_default_voicemail_extension(void)
Retrieve the default voicemail extension.
Successfully registered the transport monitor.
static void challenge(const char *realm, pjsip_tx_data *tdata, const pjsip_rx_data *rdata, int is_stale)
astobj2 callback for adding digest challenges to responses
unsigned int ast_sip_get_mwi_disable_initial_unsolicited(void)
Retrieve the global setting 'disable sending unsolicited mwi on startup'.
A set of macros to manage forward-linked lists.
static char language[MAX_LANGUAGE]
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.
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.
static int default_expiration
int ast_sip_sched_task_get_times(struct ast_sip_sched_task *schtd, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end)
Gets the last start and end times of the task.
int ast_sip_sched_task_get_times_by_name2(const char *name, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start)
Gets the queued, last start, last_end, time left, interval, next run by task name.
unsigned int ast_sip_get_disable_multi_domain(void)
Retrieve the system setting 'disable multi domain'.
An entity with which Asterisk communicates.
unsigned int ast_sip_get_max_initial_qualify_time(void)
Retrieve the system max initial qualify time.
unsigned int ast_sip_get_send_contact_status_on_update_registration(void)
Retrieve the global setting 'send_contact_status_on_update_registration'.
unsigned int ast_sip_get_use_callerid_contact(void)
Retrieve the global setting 'use_callerid_contact'.
int ast_sip_register_service(pjsip_module *module)
Register a SIP service in Asterisk.
int ast_sip_format_auths_ami(const struct ast_sip_auth_vector *auths, struct ast_sip_ami *ami)
Format auth details for AMI.
struct ast_sip_contact * ast_sip_location_retrieve_contact_from_aor_list(const char *aor_list)
Retrieve the first bound contact from a list of AORs.
ast_sip_endpoint_identifier_type
Different methods by which incoming requests can be matched to endpoints.
A snapshot of an endpoint's state.
struct ast_sip_service_route_vector * ast_sip_service_route_vector_alloc(void)
Allocate a vector of service routes.
int ast_sip_location_delete_contact(struct ast_sip_contact *contact)
Delete a contact.
void ast_sip_location_retrieve_contact_and_aor_from_list_filtered(const char *aor_list, unsigned int flags, struct ast_sip_aor **aor, struct ast_sip_contact **contact)
Retrieve the first bound contact AND the AOR chosen from a list of AORs and filter based on flags...
void ast_sip_transport_monitor_unregister(pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches)
Unregister a reliable transport shutdown monitor.
int ast_sip_is_content_type(pjsip_media_type *content_type, char *type, char *subtype)
Checks if the given content type matches type/subtype.
struct ast_sip_aor * ast_sip_location_retrieve_aor(const char *aor_name)
Retrieve a named AOR.
int ast_sip_add_global_response_header(const char *name, const char *value, int replace)
struct ast_sip_auth * ast_sip_get_artificial_auth(void)
Retrieves a reference to the artificial auth.
Transport not found to monitor.
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace(pjsip_transport *transport, ast_transport_monitor_shutdown_cb cb, void *ao2_data, ast_transport_monitor_data_matcher matches)
Register a reliable transport shutdown monitor callback replacing any duplicate.
void ast_sip_register_supplement(struct ast_sip_supplement *supplement)
Register a supplement to SIP out of dialog processing.
struct ao2_container * ast_sip_get_transport_states(void)
Retrieves all transport states.
void ast_sip_location_prune_boot_contacts(void)
Prune the prune_on_boot contacts.
void ast_sip_get_default_from_user(char *from_user, size_t size)
Retrieve the global default from user.
void ast_sip_service_route_vector_destroy(struct ast_sip_service_route_vector *service_routes)
Destroy a vector of service routes.
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.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
int ast_sip_sched_is_task_running_by_name(const char *name)
Checks if the task is currently running.
#define SORCERY_OBJECT(details)
Macro which must be used at the beginning of each sorcery capable object.
int ast_sip_thread_is_servant(void)
Determine if the current thread is a SIP servant thread.
int ast_sip_push_task(struct ast_taskprocessor *serializer, int(*sip_task)(void *), void *task_data)
Pushes a task to SIP servants.
static int array(struct ast_channel *chan, const char *cmd, char *var, const char *value)
void ast_sip_report_invalid_endpoint(const char *name, pjsip_rx_data *rdata)
Send a security event notification for when an invalid endpoint is requested.
int ast_sip_sched_task_get_times2(struct ast_sip_sched_task *schtd, struct timeval *when_queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start)
Gets the queued, last start, last_end, time left, interval, next run.
#define SIP_TLS_MAX_CIPHERS
Maximum number of ciphers supported for a TLS transport.
unsigned int async_operations
void ast_sip_unregister_supplement(struct ast_sip_supplement *supplement)
Unregister a an supplement to SIP out of dialog processing.
int(* ast_transport_monitor_data_matcher)(void *a, void *b)
Transport shutdown monitor data matcher.
struct ast_taskprocessor * ast_sip_create_serializer(const char *name)
Create a new serializer for SIP tasks.
char * ast_sip_get_endpoint_identifier_order(void)
Retrieve the global endpoint_identifier_order setting.
ast_sip_session_refresh_method
struct ast_sip_endpoint * ast_sip_get_artificial_endpoint(void)
Retrieves a reference to the artificial endpoint.
ast_sip_dtmf_mode
DTMF modes for SIP endpoints.
userdata associated with baseline taskprocessor test
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.
struct ast_taskprocessor * ast_sip_get_distributor_serializer(pjsip_rx_data *rdata)
Determine the distributor serializer for the SIP message.
int ast_sip_for_each_auth(const struct ast_sip_auth_vector *array, ao2_callback_fn on_auth, void *arg)
For every auth in the array call the given 'on_auth' handler.
void ast_sip_cleanup_auths(struct ast_sip_auth *auths[], size_t num_auths)
Clean up retrieved auth structures from memory.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
The next invocation of the task is at last finish + interval.
void ast_sip_get_unidentified_request_thresholds(unsigned int *count, unsigned int *period, unsigned int *prune_interval)
Retrieve the unidentified request security event thresholds.
struct ast_sip_contact * ast_sip_location_retrieve_first_aor_contact(const struct ast_sip_aor *aor)
Retrieve the first bound contact for an AOR.
int ast_sip_sched_task_get_next_run(struct ast_sip_sched_task *schtd)
Gets the number of milliseconds until the next invocation.
struct ast_sip_transport_state * ast_sip_get_transport_state(const char *transport_id)
Retrieve transport state.
struct pjsip_tpfactory * factory
Transport factory.
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.
Endpoint configuration for unsolicited MWI.
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.
void ast_sip_message_apply_transport(const char *transport_name, pjsip_tx_data *tdata)
Apply the configuration for a transport to an outgoing message.
unsigned int ast_sip_get_contact_expiration_check_interval(void)
Retrieve the system contact expiration check interval setting.
void ast_sip_location_retrieve_contact_and_aor_from_list(const char *aor_list, struct ast_sip_aor **aor, struct ast_sip_contact **contact)
Retrieve the first bound contact AND the AOR chosen from a list of AORs.
Vector container support.
An entity responsible for identifying the source of a SIP message.
int ast_sip_transport_state_set_transport(const char *transport_name, pjsip_transport *transport)
Sets the PJSIP transport on a child transport.
Structure used to handle boolean flags.
int ast_sip_format_contact_ami(void *obj, void *arg, int flags)
Formats the contact and sends over AMI.
struct ast_str * ast_sip_create_ami_event(const char *event, struct ast_sip_ami *ami)
Creates a string to store AMI event data in.
int ast_sip_dlg_set_transport(const struct ast_sip_endpoint *endpoint, pjsip_dialog *dlg, pjsip_tpselector *selector)
Set the transport on a dialog.
The scheduled task's events are tracked in the debug log.
struct ast_sockaddr external_signaling_address
unsigned int external_signaling_port
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
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.
int ast_sip_get_host_ip(int af, pj_sockaddr *addr)
Retrieve the local host address in IP form.
pjsip_endpoint * ast_sip_get_pjsip_endpoint(void)
Get a pointer to the PJSIP endpoint.
void ast_sip_persistent_endpoint_publish_contact_state(const char *endpoint_name, const struct ast_sip_contact_status *contact_status)
Publish the change of state for a contact.
unsigned int ast_sip_get_keep_alive_interval(void)
Retrieve the system keep alive interval setting.
An interchangeable way of handling digest authentication for SIP.
A ast_taskprocessor structure is a singleton by name.
const char * ast_sip_auth_type_to_str(enum ast_sip_auth_type type)
Converts the given auth type to a string.
struct ast_sorcery * ast_sip_get_sorcery(void)
Get a pointer to the SIP sorcery structure.
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.
void ast_sip_report_auth_challenge_sent(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pjsip_tx_data *tdata)
Send a security event notification for when an authentication challenge is sent.
A supplement to SIP message processing.
int ast_sip_dialog_setup_outbound_authentication(pjsip_dialog *dlg, const struct ast_sip_endpoint *endpoint, ast_sip_dialog_outbound_auth_cb cb, void *user_data)
Set up outbound authentication on a SIP dialog.
An opaque threadpool structure.
int ast_sip_set_tpselector_from_transport(const struct ast_sip_transport *transport, pjsip_tpselector *selector)
Sets pjsip_tpselector from ast_sip_transport.
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.
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.
void ast_sip_unregister_service(pjsip_module *module)
void ast_sip_report_auth_success(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Send a security event notification for when authentication succeeds.
int ast_sip_sorcery_object_to_ami(const void *obj, struct ast_str **buf)
Converts a sorcery object to a string of object properties.
void ast_sip_unregister_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier)
Unregister a SIP endpoint identifier.
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.
void ast_sip_transport_state_unregister(struct ast_sip_tpmgr_state_callback *element)
Unregister a transport state notification callback element.
struct ao2_container * ast_sip_location_retrieve_aor_contacts_filtered(const struct ast_sip_aor *aor, unsigned int flags)
Retrieve all contacts currently available for an AOR and filter based on flags.
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.
static int rtcp_mux(struct ast_rtp *rtp, const unsigned char *packet)
struct ao2_container * ast_sip_get_endpoints(void)
Retrieve any endpoints available to sorcery.
int ast_sip_retrieve_auths_vector(const struct ast_sip_auth_vector *auth_ids, struct ast_sip_auth_objects_vector *auth_objects)
Return only reachable or unknown contacts.
struct ast_sip_service_route_vector * service_routes
int ast_sip_append_body(pjsip_tx_data *tdata, const char *body_text)
Append body data to a SIP message.
int ast_sip_location_update_contact(struct ast_sip_contact *contact)
Update a contact.
static char context[AST_MAX_CONTEXT]
static int rewrite_contact(pjsip_rx_data *rdata, pjsip_dialog *dlg)
int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint)
Add a new contact to an AOR.
void ast_sip_tpselector_unref(pjsip_tpselector *selector)
Unreference a pjsip_tpselector.
int ast_sip_for_each_contact(const struct ast_sip_aor *aor, ao2_callback_fn on_contact, void *arg)
For every contact on an AOR call the given 'on_contact' handler.
an interchangeable way of responding to authentication challenges
int ast_sip_sched_task_get_name(struct ast_sip_sched_task *schtd, char *name, size_t maxlen)
Gets the task name.
NAT configuration options for endpoints.
const ast_string_field aors
ast_sip_auth_type
Methods of storing SIP digest authentication credentials.
Error while registering transport monitor.
struct ast_dnsmgr_entry * external_media_address_refresher
Pluggable RTP Architecture.
struct ast_sip_contact * ast_sip_location_retrieve_contact(const char *contact_name)
Retrieve a named contact.
AST_VECTOR(ast_sip_service_route_vector, char *)
void ast_sip_transport_monitor_unregister_all(ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches)
Unregister a transport shutdown monitor from all reliable transports.
static struct ast_serializer_shutdown_group * shutdown_group
Shutdown group for options serializers.
int(* ast_sip_task)(void *user_data)
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.
int ast_sip_transport_state_set_service_routes(const char *transport_name, struct ast_sip_service_route_vector *service_routes)
Sets the service routes on a child transport.
struct ast_dnsmgr_entry * external_signaling_address_refresher
unsigned int ast_sip_get_ignore_uri_user_options(void)
Retrieve the global setting 'ignore_uri_user_options'.
DTLS configuration structure.
int ast_sip_sched_task_cancel_by_name(const char *name)
Cancels the next invocation of a task by name.
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.
Sorcery Data Access Layer API.
pj_ssl_cipher ciphers[SIP_TLS_MAX_CIPHERS]
void(* ast_transport_monitor_shutdown_cb)(void *data)
Transport shutdown monitor callback.
void * ast_sip_dict_set(pj_pool_t *pool, void *ht, const char *key, void *val)
Set the value for the given key.
Configuration for one-touch INFO recording.
int ast_sip_set_tpselector_from_transport_name(const char *transport_name, pjsip_tpselector *selector)
Sets pjsip_tpselector from ast_sip_transport.