diff --git a/conf/sip_profiles/internal.xml b/conf/sip_profiles/internal.xml index c27a87ffa4..7b52ce0990 100644 --- a/conf/sip_profiles/internal.xml +++ b/conf/sip_profiles/internal.xml @@ -207,6 +207,34 @@ + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 6ccd286ca5..41948628b5 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -479,6 +479,10 @@ struct sofia_profile { uint32_t ob_calls; uint32_t ib_failed_calls; uint32_t ob_failed_calls; + uint32_t timer_t1; + uint32_t timer_t1x64; + uint32_t timer_t2; + uint32_t timer_t4; }; struct private_object { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index abefb6954a..630edd7f8f 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -775,6 +775,10 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void NTATAG_DEFAULT_PROXY(profile->outbound_proxy), NTATAG_SERVER_RPORT(profile->rport_level), TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), + TAG_IF(profile->timer_t1, NTATAG_SIP_T1(profile->timer_t1)), + TAG_IF(profile->timer_t1x64, NTATAG_SIP_T1X64(profile->timer_t1x64)), + TAG_IF(profile->timer_t2, NTATAG_SIP_T2(profile->timer_t2)), + TAG_IF(profile->timer_t4, NTATAG_SIP_T4(profile->timer_t4)), TAG_END()); /* Last tag should always finish the sequence */ if (!profile->nua) { @@ -1780,6 +1784,38 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) profile->dtmf_duration = SWITCH_DEFAULT_DTMF_DURATION; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Duration out of bounds, using default of %d!\n", SWITCH_DEFAULT_DTMF_DURATION); } + } else if (!strcasecmp(var, "timer-T1")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1 = v; + } else { + profile->timer_t1 = 500; + } + nua_set_params(profile->nua, NTATAG_SIP_T1(profile->timer_t1), TAG_END()); + } else if (!strcasecmp(var, "timer-T1X64")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1x64 = v; + } else { + profile->timer_t1x64 = 32000; + } + nua_set_params(profile->nua, NTATAG_SIP_T1X64(profile->timer_t1x64), TAG_END()); + } else if (!strcasecmp(var, "timer-T2")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t2 = v; + } else { + profile->timer_t2 = 4000; + } + nua_set_params(profile->nua, NTATAG_SIP_T2(profile->timer_t2), TAG_END()); + } else if (!strcasecmp(var, "timer-T4")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t4 = v; + } else { + profile->timer_t4 = 4000; + } + nua_set_params(profile->nua, NTATAG_SIP_T4(profile->timer_t4), TAG_END()); } } } @@ -2408,6 +2444,34 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { profile->tls_version = 0; } + } else if (!strcasecmp(var, "timer-T1")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1 = v; + } else { + profile->timer_t1 = 500; + } + } else if (!strcasecmp(var, "timer-T1X64")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t1x64 = v; + } else { + profile->timer_t1x64 = 32000; + } + } else if (!strcasecmp(var, "timer-T2")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t2 = v; + } else { + profile->timer_t2 = 4000; + } + } else if (!strcasecmp(var, "timer-T4")) { + int v = atoi(val); + if (v > 0) { + profile->timer_t4 = v; + } else { + profile->timer_t4 = 4000; + } } }