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;
181 if (!system_sorcery) {
186 ast_sorcery_apply_default(system_sorcery,
"system",
"config",
"pjsip.conf,criteria=type=system,single_object=yes,explicit_name=system");
189 ast_log(
LOG_ERROR,
"Failed to register with sorcery (is res_sorcery_config loaded?)\n");
191 system_sorcery =
NULL;
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) {
275 ast_log(
LOG_ERROR,
"Could not create DNS resolver(%d), resorting to system resolution\n", status);
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) {
306 ast_log(
LOG_ERROR,
"Could not set DNS resolver in PJSIP(%d), resorting to system resolution\n", status);
struct ast_str * output_buffer
int auto_increment
Number of threads to increment pool by.
unsigned int disable_rport
int sip_cli_print_system(struct ast_sip_cli_context *context)
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
int idle_timeout
Time limit in seconds for idle threads.
int initial_size
Number of threads the pool will start with.
int max_size
Maximum number of threads a pool may have.
#define AST_THREADPOOL_OPTIONS_VERSION
Perform no matching, return all objects.
static void * system_alloc(const char *name)
Full structure for sorcery.
Type for a default handler that should do nothing.
unsigned int compactheaders
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
Return all matching objects.
static int system_create_resolver_and_set_nameservers(void *data)
void ast_sip_initialize_dns(void)
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.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
#define ast_sorcery_object_register_no_reload(sorcery, type, alloc, transform, apply)
Register an object type that is not reloadable.
struct ao2_container * ast_dns_get_nameservers(void)
Retrieve the configured nameservers of the system.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Type for default option handler for unsigned integers.
#define ao2_ref(o, delta)
static int system_apply(const struct ast_sorcery *sorcery, void *obj)
unsigned int disable_tcp_switch
unsigned int follow_early_media_fork
int ast_sip_initialize_system(void)
void sip_get_threadpool_options(struct ast_threadpool_options *threadpool_options)
Type for default option handler for bools (ast_true/ast_false)
#define ast_sorcery_apply_default(sorcery, type, name, data)
#define ao2_iterator_next(iter)
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
static struct ast_sorcery * system_sorcery
static struct ast_threadpool_options sip_threadpool_options
static struct system_config * get_system_cfg(void)
#define ao2_find(container, arg, flags)
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.
#define ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object.
pjsip_endpoint * ast_sip_get_pjsip_endpoint(void)
Get a pointer to the PJSIP endpoint.
void ast_sorcery_load(const struct ast_sorcery *sorcery)
Inform any wizards to load persistent objects.
static struct ast_sorcery * sorcery
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
struct system_config::@478 threadpool
#define ast_sorcery_open()
static char context[AST_MAX_CONTEXT]
static struct aco_type * threadpool_options[]
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
void ast_sip_destroy_system(void)
int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
Prints a sorcery object's ast_variable list.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
unsigned int accept_multiple_sdp_answers
DNS support for Asterisk.
Sorcery Data Access Layer API.