|
|
@ -33,6 +33,7 @@
|
|
|
|
#define DEFAULT_OUTBOUND_ENDPOINT "default_outbound_endpoint"
|
|
|
|
#define DEFAULT_OUTBOUND_ENDPOINT "default_outbound_endpoint"
|
|
|
|
#define DEFAULT_DEBUG "no"
|
|
|
|
#define DEFAULT_DEBUG "no"
|
|
|
|
#define DEFAULT_ENDPOINT_IDENTIFIER_ORDER "ip,username,anonymous"
|
|
|
|
#define DEFAULT_ENDPOINT_IDENTIFIER_ORDER "ip,username,anonymous"
|
|
|
|
|
|
|
|
#define DEFAULT_MAX_INITIAL_QUALIFY_TIME 0
|
|
|
|
|
|
|
|
|
|
|
|
static char default_useragent[256];
|
|
|
|
static char default_useragent[256];
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +51,8 @@ struct global_config {
|
|
|
|
unsigned int max_forwards;
|
|
|
|
unsigned int max_forwards;
|
|
|
|
/* The interval at which to send keep alive messages to active connection-oriented transports */
|
|
|
|
/* The interval at which to send keep alive messages to active connection-oriented transports */
|
|
|
|
unsigned int keep_alive_interval;
|
|
|
|
unsigned int keep_alive_interval;
|
|
|
|
|
|
|
|
/* The maximum time for all contacts to be qualified at startup */
|
|
|
|
|
|
|
|
unsigned int max_initial_qualify_time;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void global_destructor(void *obj)
|
|
|
|
static void global_destructor(void *obj)
|
|
|
@ -161,6 +164,21 @@ unsigned int ast_sip_get_keep_alive_interval(void)
|
|
|
|
return interval;
|
|
|
|
return interval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int ast_sip_get_max_initial_qualify_time(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
unsigned int time;
|
|
|
|
|
|
|
|
struct global_config *cfg;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cfg = get_global_cfg();
|
|
|
|
|
|
|
|
if (!cfg) {
|
|
|
|
|
|
|
|
return DEFAULT_MAX_INITIAL_QUALIFY_TIME;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time = cfg->max_initial_qualify_time;
|
|
|
|
|
|
|
|
ao2_ref(cfg, -1);
|
|
|
|
|
|
|
|
return time;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* \internal
|
|
|
|
* \internal
|
|
|
|
* \brief Observer to set default global object if none exist.
|
|
|
|
* \brief Observer to set default global object if none exist.
|
|
|
@ -271,6 +289,9 @@ int ast_sip_initialize_sorcery_global(void)
|
|
|
|
ast_sorcery_object_field_register(sorcery, "global", "keep_alive_interval",
|
|
|
|
ast_sorcery_object_field_register(sorcery, "global", "keep_alive_interval",
|
|
|
|
__stringify(DEFAULT_KEEPALIVE_INTERVAL),
|
|
|
|
__stringify(DEFAULT_KEEPALIVE_INTERVAL),
|
|
|
|
OPT_UINT_T, 0, FLDSET(struct global_config, keep_alive_interval));
|
|
|
|
OPT_UINT_T, 0, FLDSET(struct global_config, keep_alive_interval));
|
|
|
|
|
|
|
|
ast_sorcery_object_field_register(sorcery, "global", "max_initial_qualify_time",
|
|
|
|
|
|
|
|
__stringify(DEFAULT_MAX_INITIAL_QUALIFY_TIME),
|
|
|
|
|
|
|
|
OPT_UINT_T, 0, FLDSET(struct global_config, max_initial_qualify_time));
|
|
|
|
|
|
|
|
|
|
|
|
if (ast_sorcery_instance_observer_add(sorcery, &observer_callbacks_global)) {
|
|
|
|
if (ast_sorcery_instance_observer_add(sorcery, &observer_callbacks_global)) {
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|