mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
[mod_sofia] Add db-spin-up-wait-ms profile parameter.
This commit is contained in:
@@ -727,6 +727,7 @@ struct sofia_profile {
|
||||
uint32_t max_recv_requests_per_second;
|
||||
uint32_t rtp_timeout_sec;
|
||||
uint32_t rtp_hold_timeout_sec;
|
||||
uint32_t db_spin_up_wait_ms;
|
||||
char *odbc_dsn;
|
||||
char *pre_trans_execute;
|
||||
char *post_trans_execute;
|
||||
|
||||
@@ -4650,6 +4650,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||
profile->tls_version |= SOFIA_TLS_VERSION_TLSv1_2;
|
||||
profile->tls_version |= SOFIA_TLS_VERSION_TLSv1_3;
|
||||
profile->tls_timeout = 300;
|
||||
profile->db_spin_up_wait_ms = 1000;
|
||||
profile->mflags = MFLAG_REFER | MFLAG_REGISTER;
|
||||
profile->server_rport_level = 1;
|
||||
profile->client_rport_level = 1;
|
||||
@@ -4788,6 +4789,8 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||
}
|
||||
} else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
|
||||
profile->odbc_dsn = switch_core_strdup(profile->pool, val);
|
||||
} else if (!strcasecmp(var, "db-spin-up-wait-ms") && !zstr(val)) {
|
||||
profile->db_spin_up_wait_ms = atoi(val);
|
||||
} else if (!strcasecmp(var, "db-pre-trans-execute") && !zstr(val)) {
|
||||
profile->pre_trans_execute = switch_core_strdup(profile->pool, val);
|
||||
} else if (!strcasecmp(var, "db-post-trans-execute") && !zstr(val)) {
|
||||
@@ -6351,7 +6354,7 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
|
||||
launch_sofia_profile_thread(profile);
|
||||
if (profile->odbc_dsn) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Connecting ODBC Profile %s [%s]\n", profile->name, url);
|
||||
switch_yield(1000000);
|
||||
switch_yield(profile->db_spin_up_wait_ms * 1000);
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Started Profile %s [%s]\n", profile->name, url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user