void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj)
{
sofia_profile_t *profile = (sofia_profile_t *) obj;
- uint32_t ireg_loops = IREG_SECONDS; /* Number of loop iterations done when we haven't checked for registrations */
+ uint32_t ireg_loops = profile->ireg_seconds; /* Number of loop iterations done when we haven't checked for registrations */
uint32_t gateway_loops = GATEWAY_SECONDS; /* Number of loop iterations done when we haven't checked for gateways */
void *pop = NULL; /* queue_pop placeholder */
switch_size_t sql_len = 1024 * 32; /* length of sqlbuf */
sofia_glue_parse_rtp_bugs(&profile->auto_rtp_bugs, val);
} else if (!strcasecmp(var, "manual-rtp-bugs")) {
sofia_glue_parse_rtp_bugs(&profile->manual_rtp_bugs, val);
+ } else if (!strcasecmp(var, "registration-thread-frequency")) {
+ profile->ireg_seconds = atoi(val);
+ if (profile->ireg_seconds < 0) {
+ profile->ireg_seconds = IREG_SECONDS;
+ }
} else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "auto-restart")) {
sofia_set_pflag(profile, PFLAG_CID_IN_1XX);
profile->ndlb |= PFLAG_NDLB_ALLOW_NONDUP_SDP;
profile->te = 101;
+ profile->ireg_seconds = IREG_SECONDS;
+
profile->tls_verify_policy = TPTLS_VERIFY_NONE;
/* lib default */
} else {
sofia_clear_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
}
+ } else if (!strcasecmp(var, "registration-thread-frequency")) {
+ profile->ireg_seconds = atoi(val);
+ if (profile->ireg_seconds < 0) {
+ profile->ireg_seconds = IREG_SECONDS;
+ }
} else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "auto-restart")) {
gateway_ptr->failures = 0;
- if (gateway_ptr->freq > 60) {
+ if (gateway_ptr->freq >= 60) {
gateway_ptr->expires = now + (gateway_ptr->freq - 15);
} else {
- gateway_ptr->expires = now + (gateway_ptr->freq - 2);
+ if (gateway_ptr->freq < 30 && gateway_ptr->freq >= 5) {
+ gateway_ptr->expires = now + (gateway_ptr->freq - 5);
+ } else {
+ gateway_ptr->expires = now + (gateway_ptr->freq);
+ }
}
gateway_ptr->state = REG_STATE_REGED;