<!--force suscription expires to a lower value than requested-->
<!--<param name="force-subscription-expires" value="60"/>-->
+
+ <!-- add a random deviation to the expires value of the 202 Accepted -->
+ <!--<param name="sip-subscription-max-deviation" value="120"/>-->
+
<!-- disable register and transfer which may be undesirable in a public switch -->
<!--<param name="disable-transfer" value="true"/>-->
<!--<param name="disable-register" value="true"/>-->
<!-- force suscription expires to a lower value than requested -->
<!-- <param name="force-subscription-expires" value="60"/> -->
+
+ <!-- add a random deviation to the expires value of the 202 Accepted -->
+ <!--<param name="sip-subscription-max-deviation" value="120"/>-->
+
<!-- disable register and transfer which may be undesirable in a public
switch -->
<!-- <param name="disable-transfer" value="true"/> -->
su_strlst_t *tls_verify_in_subjects;
uint32_t sip_force_expires;
uint32_t sip_expires_max_deviation;
+ uint32_t sip_subscription_max_deviation;
int ireg_seconds;
sofia_paid_type_t paid_type;
uint32_t rtp_digit_delay;
profile->rtp_digit_delay = 40;
profile->sip_force_expires = 0;
profile->sip_expires_max_deviation = 0;
+ profile->sip_subscription_max_deviation = 0;
profile->tls_version = 0;
profile->tls_timeout = 300;
profile->mflags = MFLAG_REFER | MFLAG_REGISTER;
} else {
profile->sip_expires_max_deviation = 0;
}
+ } else if (!strcasecmp(var, "sip-subscription-max-deviation")) {
+ int32_t sip_subscription_max_deviation = atoi(val);
+ if (sip_subscription_max_deviation >= 0) {
+ profile->sip_subscription_max_deviation = sip_subscription_max_deviation;
+ } else {
+ profile->sip_subscription_max_deviation = 0;
+ }
} else if (!strcasecmp(var, "reuse-connections")) {
switch_bool_t value = switch_true(val);
if (!value) {
long exp_delta = 0;
char exp_delta_str[30] = "";
+ uint32_t sub_max_deviation_var = 0;
sip_to_t const *to;
const char *from_user = NULL, *from_host = NULL;
const char *to_user = NULL, *to_host = NULL;
}
}
+ if ((sub_max_deviation_var = profile->sip_subscription_max_deviation)) {
+ if (sub_max_deviation_var > 0) {
+ int sub_deviation;
+ srand( (unsigned) ( (unsigned)(intptr_t)switch_thread_self() + switch_micro_time_now() ) );
+ /* random negative number between 0 and negative sub_max_deviation_var: */
+ sub_deviation = ( rand() % sub_max_deviation_var ) - sub_max_deviation_var;
+ if ( (exp_delta + sub_deviation) > 45 ) {
+ exp_delta += sub_deviation;
+ }
+ }
+ }
+
if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "DELTA %ld\n", exp_delta);
}