31#define TIMER_T1_MIN 100
32#define DEFAULT_TIMER_T1 500
33#define DEFAULT_TIMER_B 32000
98 min_timerb = 64 * system->
timert1;
100 if (system->
timerb < min_timerb) {
102 system->
timerb = min_timerb;
105 pjsip_cfg()->tsx.t1 = system->
timert1;
106 pjsip_cfg()->tsx.td = system->
timerb;
109#ifdef HAVE_PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS
114 "The accept_multiple_sdp_answers flag is not supported in this version of pjproject. Ignoring\n");
119#ifdef HAVE_PJSIP_ENDPOINT_COMPACT_FORM
120 pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;
122 extern pj_bool_t pjsip_use_compact_form;
124 pjsip_use_compact_form = PJ_TRUE;
133 pjsip_cfg()->endpt.disable_tcp_switch =
136 pjsip_cfg()->endpt.disable_rport = system->
disable_rport ? PJ_TRUE : PJ_FALSE;
189 ast_log(
LOG_ERROR,
"Failed to register with sorcery (is res_sorcery_config loaded?)\n");
256 pj_dns_resolver *resolver;
257 pj_str_t nameservers[PJ_DNS_RESOLVER_MAX_NS];
258 unsigned int count = 0;
261 if (!discovered_nameservers) {
262 ast_log(
LOG_ERROR,
"Could not retrieve local system nameservers, resorting to system resolution\n");
267 ast_log(
LOG_ERROR,
"There are no local system nameservers configured, resorting to system resolution\n");
268 ao2_ref(discovered_nameservers, -1);
274 if (
status != PJ_SUCCESS) {
276 ao2_ref(discovered_nameservers, -1);
283 pj_strset2(&nameservers[count++], nameserver);
286 if (count == (PJ_DNS_RESOLVER_MAX_NS - 1)) {
292 status = pj_dns_resolver_set_ns(resolver, count, nameservers,
NULL);
295 ao2_ref(discovered_nameservers, -1);
297 if (
status != PJ_SUCCESS) {
298 ast_log(
LOG_ERROR,
"Could not set nameservers on DNS resolver in PJSIP(%d), resorting to system resolution\n",
305 if (
status != PJ_SUCCESS) {
Asterisk main include file. File version handling, generic pbx functions.
#define ao2_iterator_next(iter)
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
@ OPT_NOOP_T
Type for a default handler that should do nothing.
@ OPT_BOOL_T
Type for default option handler for bools (ast_true/ast_false)
static int system_apply(const struct ast_sorcery *sorcery, void *obj)
void ast_sip_destroy_system(void)
static struct ast_threadpool_options sip_threadpool_options
static struct system_config * get_system_cfg(void)
static int system_create_resolver_and_set_nameservers(void *data)
static struct ast_sorcery * system_sorcery
int sip_cli_print_system(struct ast_sip_cli_context *context)
int ast_sip_initialize_system(void)
static void * system_alloc(const char *name)
void ast_sip_initialize_dns(void)
void sip_get_threadpool_options(struct ast_threadpool_options *threadpool_options)
DNS support for Asterisk.
struct ao2_container * ast_dns_get_nameservers(void)
Retrieve the configured nameservers of the system.
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.
pjsip_endpoint * ast_sip_get_pjsip_endpoint(void)
Get a pointer to the PJSIP endpoint.
int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
Prints a sorcery object's ast_variable list.
static struct ast_sorcery * sorcery
static struct ast_threadpool * threadpool
Thread pool for observers.
Sorcery Data Access Layer API.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
@ AST_RETRIEVE_FLAG_MULTIPLE
Return all matching objects.
@ AST_RETRIEVE_FLAG_ALL
Perform no matching, return all objects.
void ast_sorcery_load(const struct ast_sorcery *sorcery)
Inform any wizards to load persistent objects.
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
#define ast_sorcery_object_register_no_reload(sorcery, type, alloc, transform, apply)
Register an object type that is not reloadable.
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
#define ast_sorcery_apply_default(sorcery, type, name, data)
#define ast_sorcery_open()
Open a new sorcery structure.
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
static struct aco_type * threadpool_options[]
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
CLI Formatter Context passed to all formatters.
Full structure for sorcery.
int idle_timeout
Time limit in seconds for idle threads.
int max_size
Maximum number of threads a pool may have.
int auto_increment
Number of threads to increment pool by.
int initial_size
Number of threads the pool will start with.
unsigned int compactheaders
struct system_config::@452 threadpool
unsigned int disable_rport
unsigned int disable_tcp_switch
unsigned int follow_early_media_fork
unsigned int accept_multiple_sdp_answers
#define AST_THREADPOOL_OPTIONS_VERSION
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.