mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip: disable multi domain to improve realtime performace
This patch added new global pjsip option 'disable_multi_domain'. Disabling Multi Domain can improve Realtime performance by reducing number of database requests. ASTERISK-25930 #close Change-Id: I2e7160f3aae68475d52742107949a799aa2c7dc7
This commit is contained in:
committed by
Richard Mudgett
parent
5f78801859
commit
df3639700a
@@ -37,6 +37,7 @@
|
||||
#define DEFAULT_FROM_USER "asterisk"
|
||||
#define DEFAULT_REGCONTEXT ""
|
||||
#define DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL 30
|
||||
#define DEFAULT_DISABLE_MULTI_DOMAIN 0
|
||||
#define DEFAULT_VOICEMAIL_EXTENSION ""
|
||||
|
||||
static char default_useragent[256];
|
||||
@@ -64,6 +65,8 @@ struct global_config {
|
||||
unsigned int max_initial_qualify_time;
|
||||
/* The interval at which to check for expired contacts */
|
||||
unsigned int contact_expiration_check_interval;
|
||||
/*! Nonzero to disable multi domain support */
|
||||
unsigned int disable_multi_domain;
|
||||
};
|
||||
|
||||
static void global_destructor(void *obj)
|
||||
@@ -222,6 +225,21 @@ unsigned int ast_sip_get_contact_expiration_check_interval(void)
|
||||
return interval;
|
||||
}
|
||||
|
||||
unsigned int ast_sip_get_disable_multi_domain(void)
|
||||
{
|
||||
unsigned int disable_multi_domain;
|
||||
struct global_config *cfg;
|
||||
|
||||
cfg = get_global_cfg();
|
||||
if (!cfg) {
|
||||
return DEFAULT_DISABLE_MULTI_DOMAIN;
|
||||
}
|
||||
|
||||
disable_multi_domain = cfg->disable_multi_domain;
|
||||
ao2_ref(cfg, -1);
|
||||
return disable_multi_domain;
|
||||
}
|
||||
|
||||
unsigned int ast_sip_get_max_initial_qualify_time(void)
|
||||
{
|
||||
unsigned int time;
|
||||
@@ -373,6 +391,8 @@ int ast_sip_initialize_sorcery_global(void)
|
||||
ast_sorcery_object_field_register(sorcery, "global", "contact_expiration_check_interval",
|
||||
__stringify(DEFAULT_CONTACT_EXPIRATION_CHECK_INTERVAL),
|
||||
OPT_UINT_T, 0, FLDSET(struct global_config, contact_expiration_check_interval));
|
||||
ast_sorcery_object_field_register(sorcery, "global", "disable_multi_domain", "no",
|
||||
OPT_BOOL_T, 1, FLDSET(struct global_config, disable_multi_domain));
|
||||
|
||||
if (ast_sorcery_instance_observer_add(sorcery, &observer_callbacks_global)) {
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user