24 #include <pjsip_simple.h>
25 #include <pjsip/sip_transaction.h>
50 #include "asterisk/stasis_channels.h"
54 #ifdef HAVE_PJSIP_TLS_TRANSPORT_RESTART
59 #define PJSIP_MINVERSION(m,n,p) (((m << 24) | (n << 16) | (p << 8)) >= PJ_VERSION_NUM)
61 #ifndef PJSIP_EXPIRES_NOT_SPECIFIED
68 #define PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)-1)
71 #define PJSTR_PRINTF_SPEC "%.*s"
72 #define PJSTR_PRINTF_VAR(_v) ((int)(_v).slen), ((_v).ptr)
74 #define AST_SIP_AUTH_MAX_REALM_LENGTH 255
77 #define COLON_PORT_STRLEN 6
82 #define IP6ADDR_COLON_PORT_BUFLEN (PJ_INET6_ADDRSTRLEN + COLON_PORT_STRLEN)
90 #define AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR(_transport, _dest) \
91 snprintf(_dest, IP6ADDR_COLON_PORT_BUFLEN, \
92 PJSTR_PRINTF_SPEC ":%d", \
93 PJSTR_PRINTF_VAR(_transport->remote_name.host), \
94 _transport->remote_name.port);
101 struct pjsip_transport;
102 struct pjsip_tpfactory;
103 struct pjsip_tls_setting;
104 struct pjsip_tpselector;
107 #define SIP_TLS_MAX_CIPHERS 64
110 #define MAX_RX_CHALLENGES 10
114 static const pj_str_t AST_PJ_STR_EMPTY = {
"", 0 };
200 #ifdef HAVE_PJSIP_TLS_TRANSPORT_RESTART
212 #define ast_sip_transport_is_nonlocal(transport_state, addr) \
213 (!transport_state->localnet || ast_apply_ha(transport_state->localnet, addr) == AST_SENSE_ALLOW)
215 #define ast_sip_transport_is_local(transport_state, addr) \
216 (transport_state->localnet && ast_apply_ha(transport_state->localnet, addr) != AST_SENSE_ALLOW)
312 #define SIP_SORCERY_DOMAIN_ALIAS_TYPE "domain_alias"
353 enum ast_sip_security_negotiation {
355 AST_SIP_SECURITY_NEG_NONE = 0,
357 AST_SIP_SECURITY_NEG_MEDIASEC,
364 enum ast_sip_security_mechanism_type {
365 AST_SIP_SECURITY_MECH_NONE = 0,
367 AST_SIP_SECURITY_MECH_MSRP_TLS,
369 AST_SIP_SECURITY_MECH_SDES_SRTP,
371 AST_SIP_SECURITY_MECH_DTLS_SRTP,
380 enum ast_sip_security_mechanism_type type;
434 enum ast_sip_contact_status_type {
529 enum ast_sip_100rel_mode {
531 AST_SIP_100REL_UNSUPPORTED = 0,
533 AST_SIP_100REL_SUPPORTED,
535 AST_SIP_100REL_PEER_SUPPORTED,
537 AST_SIP_100REL_REQUIRED,
543 enum ast_sip_dtmf_mode {
548 AST_SIP_DTMF_RFC_4733,
556 AST_SIP_DTMF_AUTO_INFO,
566 enum ast_sip_auth_type {
568 AST_SIP_AUTH_TYPE_USER_PASS,
570 AST_SIP_AUTH_TYPE_MD5,
572 AST_SIP_AUTH_TYPE_GOOGLE_OAUTH,
574 AST_SIP_AUTH_TYPE_ARTIFICIAL
577 #define SIP_SORCERY_AUTH_TYPE "auth"
601 enum ast_sip_auth_type
type;
609 enum ast_sip_endpoint_identifier_type {
611 AST_SIP_ENDPOINT_IDENTIFY_BY_USERNAME = (1 << 0),
613 AST_SIP_ENDPOINT_IDENTIFY_BY_AUTH_USERNAME = (1 << 1),
615 AST_SIP_ENDPOINT_IDENTIFY_BY_IP = (1 << 2),
617 AST_SIP_ENDPOINT_IDENTIFY_BY_HEADER = (1 << 3),
619 AST_SIP_ENDPOINT_IDENTIFY_BY_REQUEST_URI = (1 << 4),
623 enum ast_sip_session_refresh_method {
625 AST_SIP_SESSION_REFRESH_METHOD_INVITE,
627 AST_SIP_SESSION_REFRESH_METHOD_UPDATE,
630 enum ast_sip_direct_media_glare_mitigation {
632 AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_NONE,
636 AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_OUTGOING,
640 AST_SIP_DIRECT_MEDIA_GLARE_MITIGATION_INCOMING,
643 enum ast_sip_session_media_encryption {
645 AST_SIP_MEDIA_TRANSPORT_INVALID = 0,
647 AST_SIP_MEDIA_ENCRYPT_NONE,
649 AST_SIP_MEDIA_ENCRYPT_SDES,
651 AST_SIP_MEDIA_ENCRYPT_DTLS,
654 enum ast_sip_session_redirect {
656 AST_SIP_REDIRECT_USER = 0,
658 AST_SIP_REDIRECT_URI_CORE,
660 AST_SIP_REDIRECT_URI_PJSIP,
668 enum ast_sip_call_codec_pref {
671 AST_SIP_CALL_CODEC_PREF_INTERSECT = 1 << 0,
673 AST_SIP_CALL_CODEC_PREF_UNION = 1 << 1,
677 AST_SIP_CALL_CODEC_PREF_ALL = 1 << 2,
679 AST_SIP_CALL_CODEC_PREF_FIRST = 1 << 3,
683 AST_SIP_CALL_CODEC_PREF_LOCAL = 1 << 4,
685 AST_SIP_CALL_CODEC_PREF_REMOTE = 1 << 5,
697 #define ast_sip_call_codec_pref_test(__param, __codec_pref) (!!(ast_test_flag( &__param, AST_SIP_CALL_CODEC_PREF_ ## __codec_pref )))
878 enum ast_sip_session_refresh_method
method;
1070 enum ast_sip_100rel_mode
rel100;
1076 #define AST_SIP_X_AST_TXP "x-ast-txp"
1077 #define AST_SIP_X_AST_TXP_LEN 9
1080 extern pjsip_media_type pjsip_media_type_application_json;
1081 extern pjsip_media_type pjsip_media_type_application_media_control_xml;
1082 extern pjsip_media_type pjsip_media_type_application_pidf_xml;
1083 extern pjsip_media_type pjsip_media_type_application_xpidf_xml;
1084 extern pjsip_media_type pjsip_media_type_application_cpim_xpidf_xml;
1085 extern pjsip_media_type pjsip_media_type_application_rlmi_xml;
1086 extern pjsip_media_type pjsip_media_type_application_simple_message_summary;
1087 extern pjsip_media_type pjsip_media_type_application_sdp;
1088 extern pjsip_media_type pjsip_media_type_multipart_alternative;
1089 extern pjsip_media_type pjsip_media_type_multipart_mixed;
1090 extern pjsip_media_type pjsip_media_type_multipart_related;
1091 extern pjsip_media_type pjsip_media_type_text_plain;
1101 int ast_sip_are_media_types_equal(pjsip_media_type *a, pjsip_media_type *b);
1111 int ast_sip_is_media_type_in(pjsip_media_type *a, ...) attribute_sentinel;
1125 const
char *header_name,
int add_qval, pjsip_tx_data *tdata);
1205 int ast_sip_set_security_negotiation(enum ast_sip_security_negotiation *security_negotiation, const
char *
val);
1227 enum ast_sip_check_auth_result {
1229 AST_SIP_AUTHENTICATION_CHALLENGE,
1231 AST_SIP_AUTHENTICATION_SUCCESS,
1233 AST_SIP_AUTHENTICATION_FAILED,
1235 AST_SIP_AUTHENTICATION_ERROR,
1261 pjsip_rx_data *rdata, pjsip_tx_data *tdata);
1282 struct pjsip_tx_data *old_request,
struct pjsip_tx_data **new_request);
1299 enum ast_sip_contact_filter {
1301 AST_SIP_CONTACT_FILTER_DEFAULT = 0,
1304 AST_SIP_CONTACT_FILTER_REACHABLE = (1 << 0),
1316 void ast_sip_add_date_header(pjsip_tx_data *tdata);
1331 int ast_sip_register_service(pjsip_module *module);
1340 void ast_sip_unregister_service(pjsip_module *module);
1454 void *ast_sip_endpoint_alloc(
const char *name);
1472 void ast_sip_persistent_endpoint_publish_contact_state(
const char *endpoint_name,
const struct ast_sip_contact_status *contact_status);
1494 pjsip_endpoint *ast_sip_get_pjsip_endpoint(
void);
1512 struct ast_sip_aor *ast_sip_location_retrieve_aor(
const char *aor_name);
1533 unsigned int flags);
1564 unsigned int flags);
1594 unsigned int flags);
1603 struct ast_sip_contact *ast_sip_location_retrieve_contact_from_aor_list(
const char *aor_list);
1612 struct ao2_container *ast_sip_location_retrieve_contacts_from_aor_list(
const char *aor_list);
1621 void ast_sip_location_retrieve_contact_and_aor_from_list(
const char *aor_list,
struct ast_sip_aor **aor,
1633 void ast_sip_location_retrieve_contact_and_aor_from_list_filtered(
const char *aor_list,
unsigned int flags,
1644 struct ast_sip_contact *ast_sip_location_retrieve_contact(
const char *contact_name);
1691 int ast_sip_location_add_contact_nolock(
struct ast_sip_aor *
aor,
const char *
uri,
1745 void ast_sip_location_prune_boot_contacts(
void);
1763 typedef int (*ast_sip_dialog_outbound_auth_cb)(pjsip_dialog *dlg, pjsip_tx_data *tdata,
void *user_data);
1780 ast_sip_dialog_outbound_auth_cb cb,
void *user_data);
1787 struct ast_sip_auth *ast_sip_get_artificial_auth(
void);
1868 typedef int (*ast_sip_task)(
void *user_data);
2226 int *
interval,
int *time_left,
struct timeval *next_start);
2261 int *
interval,
int *time_left,
struct timeval *next_start);
2342 pjsip_dialog *ast_sip_create_dialog_uac(
const struct ast_sip_endpoint *endpoint,
const char *aor_name,
const char *request_user);
2356 pjsip_dialog *ast_sip_create_dialog_uas(
const struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pj_status_t *status);
2393 pjsip_dialog *ast_sip_create_dialog_uas_locked(
const struct ast_sip_endpoint *endpoint,
2394 pjsip_rx_data *rdata, pj_status_t *status);
2412 int ast_sip_create_rdata_with_contact(pjsip_rx_data *rdata,
char *packet,
2413 const char *src_name,
int src_port,
char *transport_type,
const char *local_name,
2414 int local_port,
const char *contact_uri);
2430 int ast_sip_create_rdata(pjsip_rx_data *rdata,
char *packet,
const char *src_name,
2431 int src_port,
char *transport_type,
const char *local_name,
int local_port);
2462 int ast_sip_create_request(
const char *method,
struct pjsip_dialog *dlg,
2485 int ast_sip_send_request(pjsip_tx_data *tdata,
struct pjsip_dialog *dlg,
2487 void (*callback)(
void *token, pjsip_event *e));
2516 int ast_sip_send_out_of_dialog_request(pjsip_tx_data *tdata,
2518 void (*callback)(
void *token, pjsip_event *e));
2538 int ast_sip_create_response(
const pjsip_rx_data *rdata,
int st_code,
2556 int ast_sip_send_response(pjsip_response_addr *res_addr, pjsip_tx_data *tdata,
struct ast_sip_endpoint *sip_endpoint);
2574 int ast_sip_send_stateful_response(pjsip_rx_data *rdata, pjsip_tx_data *tdata,
struct ast_sip_endpoint *sip_endpoint);
2590 int ast_sip_requires_authentication(
struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata);
2605 enum ast_sip_check_auth_result ast_sip_check_authentication(
struct ast_sip_endpoint *endpoint,
2606 pjsip_rx_data *rdata, pjsip_tx_data *tdata);
2616 int ast_sip_create_request_with_auth(
const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge,
2617 pjsip_tx_data *tdata, pjsip_tx_data **new_request);
2644 char *ast_sip_rdata_get_header_value(pjsip_rx_data *rdata,
const pj_str_t str);
2654 int ast_sip_set_outbound_proxy(pjsip_tx_data *tdata,
const char *proxy);
2665 int ast_sip_add_header(pjsip_tx_data *tdata,
const char *name,
const char *value);
2675 pjsip_generic_string_hdr *ast_sip_add_header2(pjsip_tx_data *tdata,
2676 const char *name,
const char *value);
2689 int ast_sip_add_body(pjsip_tx_data *tdata,
const struct ast_sip_body *body);
2703 int ast_sip_add_body_multipart(pjsip_tx_data *tdata,
const struct ast_sip_body *bodies[],
int num_bodies);
2716 int ast_sip_append_body(pjsip_tx_data *tdata,
const char *body_text);
2732 void ast_copy_pj_str(
char *dest,
const pj_str_t *src,
size_t size);
2750 int ast_copy_pj_str2(
char **dest,
const pj_str_t *src);
2768 struct ast_sip_endpoint *ast_pjsip_rdata_get_endpoint(pjsip_rx_data *rdata);
2777 void ast_sip_add_usereqphone(
const struct ast_sip_endpoint *endpoint, pj_pool_t *
pool, pjsip_uri *uri);
2810 void ast_sip_cleanup_auths(
struct ast_sip_auth *auths[],
size_t num_auths);
2846 #define ast_sip_cleanup_auth_objects_vector(auth_objects) AST_VECTOR_RESET(auth_objects, ao2_cleanup)
2861 int ast_sip_is_content_type(pjsip_media_type *content_type,
char *type,
char *subtype);
2913 const char* req_type);
2923 int ast_sip_add_global_request_header(
const char *name,
const char *value,
int replace);
2924 int ast_sip_add_global_response_header(
const char *name,
const char *value,
int replace);
2934 void *ast_sip_dict_get(
void *ht,
const char *key);
2946 #define ast_sip_mod_data_get(mod_data, id, key) \
2947 ast_sip_dict_get(mod_data[id], key)
2962 void *ast_sip_dict_set(pj_pool_t*
pool,
void *ht,
2963 const char *key,
void *
val);
2978 #define ast_sip_mod_data_set(pool, mod_data, id, key, val) \
2979 mod_data[id] = ast_sip_dict_set(pool, mod_data[id], key, val)
2990 int ast_sip_for_each_contact(
const struct ast_sip_aor *aor,
3001 int ast_sip_contact_to_str(
void *
object,
void *arg,
int flags);
3031 const char *ast_sip_auth_type_to_str(
enum ast_sip_auth_type type);
3065 struct ast_str *ast_sip_create_ami_event(
const char *
event,
3101 int ast_sip_sorcery_object_to_ami(const
void *obj, struct
ast_str **buf);
3122 int ast_sip_format_contact_ami(
void *obj,
void *
arg,
int flags);
3149 const
char *ast_sip_get_device_state(const struct
ast_sip_endpoint *endpoint);
3177 enum ast_sip_supplement_priority {
3179 AST_SIP_SUPPLEMENT_PRIORITY_FIRST = 0,
3184 AST_SIP_SUPPLEMENT_PRIORITY_CHANNEL = 1000000,
3186 AST_SIP_SUPPLEMENT_PRIORITY_LAST = INT_MAX,
3200 enum ast_sip_supplement_priority priority;
3218 int (*incoming_request)(
struct ast_sip_endpoint *endpoint,
struct pjsip_rx_data *rdata);
3234 void (*incoming_response)(
struct ast_sip_endpoint *endpoint,
struct pjsip_rx_data *rdata);
3275 unsigned int ast_sip_get_mwi_tps_queue_high(
void);
3284 int ast_sip_get_mwi_tps_queue_low(
void);
3292 unsigned int ast_sip_get_mwi_disable_initial_unsolicited(
void);
3299 unsigned int ast_sip_get_allow_sending_180_after_183(
void);
3307 unsigned int ast_sip_get_use_callerid_contact(
void);
3314 unsigned int ast_sip_get_norefersub(
void);
3322 unsigned int ast_sip_get_ignore_uri_user_options(
void);
3330 unsigned int ast_sip_get_send_contact_status_on_update_registration(
void);
3349 #define AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(str) \
3351 char *__semi = strchr((str), ';'); \
3352 if (__semi && ast_sip_get_ignore_uri_user_options()) { \
3364 char *ast_sip_get_debug(
void);
3375 char *ast_sip_get_regcontext(
void);
3384 char *ast_sip_get_endpoint_identifier_order(
void);
3394 char *ast_sip_get_default_voicemail_extension(
void);
3405 void ast_sip_get_default_realm(
char *realm,
size_t size);
3417 void ast_sip_get_default_from_user(
char *from_user,
size_t size);
3424 unsigned int ast_sip_get_keep_alive_interval(
void);
3431 unsigned int ast_sip_get_contact_expiration_check_interval(
void);
3439 unsigned int ast_sip_get_disable_multi_domain(
void);
3446 unsigned int ast_sip_get_max_initial_qualify_time(
void);
3454 const char *ast_sip_get_contact_status_label(
const enum ast_sip_contact_status_type status);
3455 const char *ast_sip_get_contact_short_status_label(
const enum ast_sip_contact_status_type status);
3464 int ast_sip_failover_request(pjsip_tx_data *tdata);
3477 int ast_sip_get_host_ip(
int af, pj_sockaddr *addr);
3491 const char *ast_sip_get_host_ip_string(
int af);
3497 long ast_sip_threadpool_queue_size(
void);
3524 pjsip_sip_uri *ast_sip_get_contact_sip_uri(pjsip_tx_data *tdata);
3560 int ast_sip_rewrite_uri_to_local(pjsip_sip_uri *uri, pjsip_tx_data *tdata);
3583 int ast_sip_set_tpselector_from_transport(
const struct ast_sip_transport *transport, pjsip_tpselector *selector);
3596 int ast_sip_set_tpselector_from_transport_name(
const char *transport_name, pjsip_tpselector *selector);
3604 void ast_sip_tpselector_unref(pjsip_tpselector *selector);
3615 int ast_sip_transport_state_set_transport(
const char *transport_name, pjsip_transport *transport);
3626 int ast_sip_transport_state_set_preferred_identity(
const char *transport_name,
const char *identity);
3648 void ast_sip_message_apply_transport(
const char *transport_name, pjsip_tx_data *tdata);
3672 int ast_sip_set_id_connected_line(
struct pjsip_rx_data *rdata,
struct ast_party_id *
id);
3684 int ast_sip_set_id_from_invite(
struct pjsip_rx_data *rdata,
struct ast_party_id *
id,
struct ast_party_id *default_id,
int trust_inbound);
3693 void ast_sip_modify_id_header(pj_pool_t *
pool, pjsip_fromto_hdr *id_hdr,
3767 struct ast_sip_endpoint *ast_sip_get_endpoint(
const char *to,
int get_default_outbound,
char **uri);
3777 int ast_sip_update_to_uri(pjsip_tx_data *tdata,
const char *to);
3793 int ast_sip_update_from(pjsip_tx_data *tdata,
char *from);
3803 void ast_sip_get_unidentified_request_thresholds(
unsigned int *count,
unsigned int *period,
3804 unsigned int *prune_interval);
3824 pjsip_sip_uri *sip_uri,
char *buf,
size_t buf_len);
3837 int ast_sip_set_tpselector_from_ep_or_uri(
const struct ast_sip_endpoint *endpoint,
3838 pjsip_sip_uri *sip_uri, pjsip_tpselector *selector);
3856 int ast_sip_dlg_set_transport(
const struct ast_sip_endpoint *endpoint, pjsip_dialog *dlg,
3857 pjsip_tpselector *selector);
3871 int ast_sip_dtmf_to_str(
const enum ast_sip_dtmf_mode
dtmf,
3872 char *buf,
size_t buf_len);
3884 int ast_sip_str_to_dtmf(
const char *dtmf_mode);
3896 const char *ast_sip_call_codec_pref_to_str(
struct ast_flags pref);
3909 int ast_sip_call_codec_str_to_pref(
struct ast_flags *pref,
const char *pref_str,
int is_outgoing);
3919 typedef void (*ast_transport_monitor_shutdown_cb)(
void *data);
3931 typedef int (*ast_transport_monitor_data_matcher)(
void *a,
void *b);
3933 enum ast_transport_monitor_reg {
3935 AST_TRANSPORT_MONITOR_REG_SUCCESS,
3937 AST_TRANSPORT_MONITOR_REG_REPLACED,
3942 AST_TRANSPORT_MONITOR_REG_NOT_FOUND,
3944 AST_TRANSPORT_MONITOR_REG_FAILED,
3965 ast_transport_monitor_shutdown_cb cb,
void *ao2_data);
3984 const char *transport_key, ast_transport_monitor_shutdown_cb cb,
4009 ast_transport_monitor_shutdown_cb cb,
void *ao2_data, ast_transport_monitor_data_matcher matches);
4031 const char *transport_key, ast_transport_monitor_shutdown_cb cb,
4032 void *ao2_data, ast_transport_monitor_data_matcher matches);
4050 ast_transport_monitor_shutdown_cb cb,
void *data, ast_transport_monitor_data_matcher matches);
4067 ast_transport_monitor_shutdown_cb cb,
void *data, ast_transport_monitor_data_matcher matches);
4083 void *data, ast_transport_monitor_data_matcher matches);
4088 pjsip_tp_state_callback cb;
4117 int ast_sip_is_uri_sip_sips(pjsip_uri *uri);
4128 int ast_sip_is_allowed_uri(pjsip_uri *uri);
4141 const pj_str_t *ast_sip_pjsip_uri_get_username(pjsip_uri *uri);
4154 const pj_str_t *ast_sip_pjsip_uri_get_hostname(pjsip_uri *uri);
4179 struct pjsip_param *ast_sip_pjsip_uri_get_other_param(pjsip_uri *uri, const pj_str_t *param_str);
4186 unsigned int ast_sip_get_all_codecs_on_empty_reinvite(
void);
4196 const
int ast_sip_hangup_sip2cause(
int cause);
4209 int ast_sip_str2rc(const
char *name);
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.
struct ast_sip_endpoint_pickup_configuration pickup
Call pickup configuration options for endpoints.
Information needed to identify an endpoint in a call.
int tcp_keepalive_idle_time
enum ast_sip_dtmf_mode dtmf
struct ast_sip_mwi_configuration mwi
struct stat privkey_file_stat
struct ast_dnsmgr_entry * external_address_refresher
unsigned int send_history_info
ast_sip_scheduler_task_flags
Task flags for the res_pjsip scheduler.
const ast_string_field mailboxes
unsigned int sess_expires
const ast_string_field fromuser
char name[0]
Friendly name of the taskprocessor. Subsystem is appended after the name's NULL terminator.
The task is scheduled at multiples of interval.
Endpoint configuration options for INFO packages.
int( ao2_callback_fn)(void *obj, void *arg, int flags)
Type of a generic callback function.
const ast_string_field oauth_secret
int ast_sip_security_mechanism_vector_init(struct ast_sip_security_mechanism_vector *security_mechanisms, const char *value)
Initialize security mechanism vector from string of security mechanisms.
struct timeval last_start
unsigned int remove_existing
const ast_string_field transport
void ast_sip_report_auth_success(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Send a security event notification for when authentication succeeds.
unsigned int devicestate_busy_at
struct ast_sip_endpoint_nat_configuration nat
int ast_sip_sched_task_cancel(struct ast_sip_sched_task *schtd)
Cancels the next invocation of a task.
const ast_string_field md5_creds
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.
unsigned int max_contacts
enum ast_t38_ec_modes error_correction
char * voicemail_extension
Endpoint subscription configuration.
int tcp_keepalive_probe_count
const ast_string_field external_media_address
unsigned int ignore_183_without_sdp
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.
struct ast_sip_auth_vector outbound_auths
struct ast_sip_info_recording_configuration recording
unsigned int asymmetric_rtp_codec
struct ast_sip_endpoint_subscription_configuration subscription
const ast_string_field context
Full structure for sorcery.
pjsip_tpfactory * factory
Potential pointer to the transport factory itself, if TCP/TLS.
struct timeval when_queued
#define SORCERY_OBJECT(details)
Macro which must be used at the beginning of each sorcery capable object.
Background DNS update manager.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
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.
Wrapper for an ast_acl linked list.
int(* create_request_with_auth)(const struct ast_sip_auth_vector *auths, struct pjsip_rx_data *challenge, struct pjsip_tx_data *old_request, struct pjsip_tx_data **new_request)
Create a new request with authentication credentials.
Endpoint configuration for SIP extensions.
enum ast_sip_check_auth_result(* check_authentication)(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata, pjsip_tx_data *tdata)
Check that an incoming request passes authentication.
const ast_string_field outbound_proxy
void ast_sip_transport_monitor_unregister_key(const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *data, ast_transport_monitor_data_matcher matches)
Unregister a reliable transport shutdown monitor.
const ast_string_field mailboxes
struct ast_sip_transport_state * state
int ast_sip_security_mechanisms_to_str(const struct ast_sip_security_mechanism_vector *security_mechanisms, int add_qvalue, char **buf)
Writes the security mechanisms of an endpoint into a buffer as a string and returns the buffer...
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 tcp_keepalive_interval_time
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.
Socket address structure.
ast_endpoint_state
Valid states for an endpoint.
void ast_sip_security_mechanisms_vector_copy(struct ast_sip_security_mechanism_vector *dst, const struct ast_sip_security_mechanism_vector *src)
Duplicate a security mechanism.
enum ast_sip_endpoint_identifier_type ident_method
int ast_sip_sched_is_task_running(struct ast_sip_sched_task *schtd)
Checks if the task is currently running.
char * voicemail_extension
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.
unsigned int inband_progress
const ast_string_field oauth_clientid
struct ast_sockaddr external_address
struct ast_acl_list * acl
struct stat cert_file_stat
int ast_sip_add_security_headers(struct ast_sip_security_mechanism_vector *security_mechanisms, const char *header_name, int add_qval, pjsip_tx_data *tdata)
Add security headers to transmission data.
struct ast_sip_security_mechanism_vector security_mechanisms
struct ast_sip_endpoint_media_configuration media
internal representation of ACL entries In principle user applications would have no need for this...
const ast_string_field password
struct ast_sockaddr external_media_address
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_key(const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *ao2_data)
Register a reliable transport shutdown monitor callback.
unsigned int qualify_frequency
char * preferred_identity
Structure representing a security mechanism as defined in RFC 3329.
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.
unsigned int remove_unavailable
struct ast_sip_identify_by_vector ident_method_order
Structure for SIP nat hook information.
const ast_string_field ca_list_path
int local_port
Local port for transport.
Structure for SIP transport information.
struct ast_namedgroups * named_pickupgroups
General Asterisk PBX channel definitions.
void(* outgoing_external_message)(struct pjsip_tx_data *tdata, struct ast_sip_transport *transport)
int ast_sip_sched_task_get_next_run_by_name(const char *name)
Gets the number of milliseconds until the next invocation.
void ast_sip_remove_headers_by_name_and_value(pjsip_msg *msg, const pj_str_t *hdr_name, const char *value)
Removes all headers of a specific name and value from a pjsip_msg.
struct ast_acl_list * contact_acl
struct pjsip_transport * transport
Transport itself.
const ast_string_field language
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.
unsigned int subscribe_replaces_unsolicited
struct ast_sip_endpoint * ast_sip_dialog_get_endpoint(pjsip_dialog *dlg)
Get the endpoint associated with this dialog.
#define AST_STRING_FIELD(name)
Declare a string field.
const ast_string_field accountcode
In case you didn't read that giant block of text above the mansession_session struct, the 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.
unsigned int notify_early_inuse_ringing
unsigned int rpid_immediate
unsigned int nonce_lifetime
const ast_string_field offfeature
int(* requires_authentication)(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
Check if a request requires authentication See ast_sip_requires_authentication for more details...
struct ast_namedgroups * named_callgroups
A set of macros to manage forward-linked lists.
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.
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.
#define AST_VECTOR(name, type)
Define a vector structure.
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.
An entity with which Asterisk communicates.
unsigned int support_path
enum ast_sip_session_refresh_method refresh_method
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.
pjsip_transport * transport
Potential pointer to the transport itself, if UDP.
unsigned int trust_outbound
unsigned int send_connected_line
A snapshot of an endpoint's state.
enum ast_transport type
Type of transport.
const ast_string_field zone
enum ast_sip_security_negotiation security_negotiation
const ast_string_field outbound_proxy
struct ast_sip_endpoint_id_configuration id
struct ast_sip_endpoint_info_configuration info
const ast_string_field external_signaling_address
struct ast_sip_auth_vector inbound_auths
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.
Support for dynamic strings.
int ast_sip_sched_is_task_running_by_name(const char *name)
Checks if the task is currently running.
const ast_string_field realm
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.
const ast_string_field message_context
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.
unsigned int async_operations
enum ast_sip_scheduler_task_flags flags
struct ast_taskprocessor * ast_sip_create_serializer(const char *name)
Create a new serializer for SIP tasks.
userdata associated with baseline taskprocessor test
unsigned int trust_inbound
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace_key(const char *transport_key, ast_transport_monitor_shutdown_cb cb, void *ao2_data, ast_transport_monitor_data_matcher matches)
Register a reliable transport shutdown monitor callback replacing any duplicate.
struct ast_taskprocessor * ast_sip_get_distributor_serializer(pjsip_rx_data *rdata)
Determine the distributor serializer for the SIP message.
unsigned int faxdetect_timeout
const ast_string_field ca_list_file
#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.
unsigned int rewrite_contact
unsigned int preferred_codec_only
int ast_sip_sched_task_get_next_run(struct ast_sip_sched_task *schtd)
Gets the number of milliseconds until the next invocation.
const ast_string_field privkey_file
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.
struct pjsip_tpfactory * factory
Transport factory.
Endpoint configuration for unsolicited MWI.
unsigned int moh_passthrough
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.
const ast_string_field auth_pass
unsigned int refer_blind_progress
struct ao2_container * permanent_contacts
enum ast_sip_auth_type type
unsigned int allowtransfer
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.
Vector container support.
pj_str_t local_address
Local address for transport.
const ast_string_field domain
An entity responsible for identifying the source of a SIP message.
const ast_string_field refresh_token
const ast_string_field stir_shaken_profile
Structure used to handle boolean flags.
AST_STRING_FIELD_EXTENDED(geoloc_incoming_call_profile)
The scheduled task's events are tracked in the debug log.
struct ast_sockaddr external_signaling_address
unsigned int external_signaling_port
struct ast_endpoint * persistent
unsigned int allow_overlap
const ast_string_field onfeature
An interchangeable way of handling digest authentication for SIP.
A ast_taskprocessor structure is a singleton by name.
const ast_string_field incoming_mwi_mailbox
enum ast_sip_100rel_mode rel100
const ast_string_field fromuser
const ast_string_field domain
A supplement to SIP message processing.
An opaque threadpool structure.
const ast_string_field mohsuggest
pj_ssl_cipher ciphers[SIP_TLS_MAX_CIPHERS]
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.
unsigned int allow_unauthenticated_options
struct ast_sip_endpoint_extensions extensions
unsigned int trust_connected_line
unsigned int bind_udptl_to_media_address
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_str_to_security_mechanism(struct ast_sip_security_mechanism **security_mechanism, const char *value)
Allocate a security mechanism from a string.
struct ast_sip_service_route_vector * service_routes
Structure which contains information about a transport.
struct ast_variable * channel_vars
String vector definitions.
void ast_sip_header_to_security_mechanism(const pjsip_generic_string_hdr *hdr, struct ast_sip_security_mechanism_vector *security_mechanisms)
Append to security mechanism vector from SIP header.
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.
void ast_sip_transport_state_unregister(struct ast_sip_tpmgr_state_callback *element)
Unregister a transport state notification callback element.
const ast_string_field aors
void ast_sip_security_mechanisms_vector_destroy(struct ast_sip_security_mechanism_vector *security_mechanisms)
Free contents of a security mechanism vector.
struct ast_dnsmgr_entry * external_media_address_refresher
Pluggable RTP Architecture.
unsigned int minimum_expiration
unsigned int default_expiration
unsigned int suppress_q850_reason_headers
unsigned int maximum_expiration
enum ast_sip_session_redirect redirect_method
const ast_string_field auth_user
void ast_sip_transport_state_register(struct ast_sip_tpmgr_state_callback *element)
Register a transport state notification callback element.
struct ast_dnsmgr_entry * external_signaling_address_refresher
DTLS configuration structure.
int ast_sip_sched_task_cancel_by_name(const char *name)
Cancels the next invocation of a task by name.
const ast_string_field cert_file
Sorcery Data Access Layer API.
const ast_string_field fromdomain
pj_ssl_cipher ciphers[SIP_TLS_MAX_CIPHERS]
Configuration for one-touch INFO recording.
unsigned int send_diversion