Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk.h"
#include <pjsip.h>
#include <pjlib-util/errno.h>
#include <arpa/nameser.h>
#include "asterisk/astobj2.h"
#include "asterisk/dns_core.h"
#include "asterisk/dns_query_set.h"
#include "asterisk/dns_srv.h"
#include "asterisk/dns_naptr.h"
#include "asterisk/res_pjsip.h"
#include "include/res_pjsip_private.h"
#include "asterisk/taskprocessor.h"
#include "asterisk/threadpool.h"
Go to the source code of this file.
Data Structures | |
struct | sip_resolve |
Structure which keeps track of resolution. More... | |
struct | sip_target |
Structure which contains transport+port information for an active query. More... | |
Enumerations | |
enum | sip_resolver_transport { SIP_RESOLVER_TRANSPORT_UDP, SIP_RESOLVER_TRANSPORT_TCP, SIP_RESOLVER_TRANSPORT_TLS, SIP_RESOLVER_TRANSPORT_UDP6, SIP_RESOLVER_TRANSPORT_TCP6, SIP_RESOLVER_TRANSPORT_TLS6 } |
Our own defined transports, reduces the size of sip_available_transports. More... | |
Functions | |
void | ast_sip_initialize_resolver (void) |
AST_VECTOR (targets, struct sip_target) | |
The vector used for current targets. More... | |
static void | sip_check_transport (pj_pool_t *pool, pjsip_transport_type_e transport, const char *name) |
static int | sip_replace_resolver (void *data) |
static void | sip_resolve (pjsip_resolver_t *resolver, pj_pool_t *pool, const pjsip_host_info *target, void *token, pjsip_resolver_callback *cb) |
static int | sip_resolve_add (struct sip_resolve *resolve, const char *name, int rr_type, int rr_class, pjsip_transport_type_e transport, int port) |
static void | sip_resolve_callback (const struct ast_dns_query_set *query_set) |
static void | sip_resolve_destroy (void *data) |
static int | sip_resolve_get_ip_addr_ver (const pj_str_t *host) |
static int | sip_resolve_handle_naptr (struct sip_resolve *resolve, const struct ast_dns_record *record, const char *service, pjsip_transport_type_e transport) |
static int | sip_resolve_invoke_user_callback (void *data) |
static int | sip_transport_is_available (enum pjsip_transport_type_e transport) |
Variables | |
static pjsip_ext_resolver | ext_resolver |
External resolver implementation for PJSIP. More... | |
static int | sip_available_transports [] |
Available transports on the system. More... | |
Our own defined transports, reduces the size of sip_available_transports.
Enumerator | |
---|---|
SIP_RESOLVER_TRANSPORT_UDP | |
SIP_RESOLVER_TRANSPORT_TCP | |
SIP_RESOLVER_TRANSPORT_TLS | |
SIP_RESOLVER_TRANSPORT_UDP6 | |
SIP_RESOLVER_TRANSPORT_TCP6 | |
SIP_RESOLVER_TRANSPORT_TLS6 |
Definition at line 66 of file pjsip_resolver.c.
void ast_sip_initialize_resolver | ( | void | ) |
Definition at line 708 of file pjsip_resolver.c.
References ast_log, ast_sip_push_task_wait_servant(), LOG_NOTICE, NULL, and sip_replace_resolver().
Referenced by load_module().
AST_VECTOR | ( | targets | , |
struct sip_target | |||
) |
The vector used for current targets.
|
static |
Definition at line 636 of file pjsip_resolver.c.
References ast_sip_get_pjsip_endpoint(), ast_verb, sip_available_transports, SIP_RESOLVER_TRANSPORT_TCP, SIP_RESOLVER_TRANSPORT_TCP6, SIP_RESOLVER_TRANSPORT_TLS, SIP_RESOLVER_TRANSPORT_TLS6, SIP_RESOLVER_TRANSPORT_UDP, SIP_RESOLVER_TRANSPORT_UDP6, and sip_target::transport.
Referenced by sip_replace_resolver().
|
static |
Definition at line 683 of file pjsip_resolver.c.
References ast_sip_get_pjsip_endpoint(), ext_resolver, pool, and sip_check_transport().
Referenced by ast_sip_initialize_resolver().
|
static |
Definition at line 468 of file pjsip_resolver.c.
References sip_resolve::addresses, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, ast_copy_pj_str(), ast_debug, ast_dns_query_set_resolve_async(), ast_threadpool_serializer_get_current(), AST_VECTOR_INIT, sip_resolve::callback, host, NULL, sip_resolve::queries, sip_resolve::resolving, sip_resolve::serializer, sip_resolve_add(), sip_resolve_callback(), sip_resolve_destroy(), sip_resolve_get_ip_addr_ver(), sip_transport_is_available(), sip_resolve::token, and type.
|
static |
Definition at line 154 of file pjsip_resolver.c.
References ast_debug, ast_dns_query_set_add(), ast_dns_query_set_create(), AST_VECTOR_APPEND, sip_target::port, sip_resolve::queries, sip_resolve::resolving, and sip_target::transport.
Referenced by sip_resolve(), sip_resolve_callback(), and sip_resolve_handle_naptr().
|
static |
Definition at line 268 of file pjsip_resolver.c.
References sip_resolve::addresses, ao2_ref, ast_debug, ast_dns_naptr_get_order(), ast_dns_query_get_name(), ast_dns_query_get_result(), ast_dns_query_get_rr_type(), ast_dns_query_set_get(), ast_dns_query_set_get_data(), ast_dns_query_set_num_queries(), ast_dns_query_set_resolve_async(), ast_dns_record_get_data(), ast_dns_record_get_data_size(), ast_dns_record_get_next(), ast_dns_record_get_rr_type(), ast_dns_result_get_records(), ast_dns_srv_get_host(), ast_dns_srv_get_port(), ast_sip_push_task(), AST_VECTOR_FREE, AST_VECTOR_GET_ADDR, AST_VECTOR_INIT, NULL, order, sip_target::port, sip_resolve::queries, sip_resolve::resolving, result, sip_resolve::serializer, sip_resolve_add(), sip_resolve_handle_naptr(), sip_resolve_invoke_user_callback(), sip_transport_is_available(), and sip_target::transport.
Referenced by sip_resolve().
|
static |
Definition at line 98 of file pjsip_resolver.c.
References ao2_cleanup, ast_taskprocessor_unreference(), AST_VECTOR_FREE, sip_resolve::queries, sip_resolve::resolving, and sip_resolve::serializer.
Referenced by sip_resolve().
|
static |
|
static |
Definition at line 227 of file pjsip_resolver.c.
References ast_debug, ast_dns_naptr_get_flags(), ast_dns_naptr_get_replacement(), ast_dns_naptr_get_service(), ast_strlen_zero, sip_resolve_add(), and sip_transport_is_available().
Referenced by sip_resolve_callback().
|
static |
Definition at line 190 of file pjsip_resolver.c.
References sip_resolve::addresses, ao2_ref, ast_debug, ast_log, sip_resolve::callback, DEBUG_ATLEAST, LOG_DEBUG, and sip_resolve::token.
Referenced by sip_resolve_callback().
|
static |
Definition at line 116 of file pjsip_resolver.c.
References sip_available_transports, SIP_RESOLVER_TRANSPORT_TCP, SIP_RESOLVER_TRANSPORT_TCP6, SIP_RESOLVER_TRANSPORT_TLS, SIP_RESOLVER_TRANSPORT_TLS6, SIP_RESOLVER_TRANSPORT_UDP, and SIP_RESOLVER_TRANSPORT_UDP6.
Referenced by sip_resolve(), sip_resolve_callback(), and sip_resolve_handle_naptr().
|
static |
External resolver implementation for PJSIP.
Definition at line 672 of file pjsip_resolver.c.
Referenced by sip_replace_resolver().
|
static |
Available transports on the system.
Definition at line 76 of file pjsip_resolver.c.
Referenced by sip_check_transport(), and sip_transport_is_available().