Add reuse-connections sofia profile param to allow users to turn off TPTAG_REUSE, thus not re-using TCP connections

This commit is contained in:
Mathieu Rene 2010-12-10 14:30:47 -05:00
parent 3406d05ba7
commit 98ed05cc98
2 changed files with 10 additions and 0 deletions

View File

@ -225,6 +225,7 @@ typedef enum {
PFLAG_DEL_SUBS_ON_REG,
PFLAG_IGNORE_183NOSDP,
PFLAG_PRESENCE_PROBE_ON_REGISTER,
PFLAG_NO_CONNECTION_REUSE,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;

View File

@ -1486,6 +1486,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
TAG_IF(profile->timer_t2, NTATAG_SIP_T2(profile->timer_t2)),
TAG_IF(profile->timer_t4, NTATAG_SIP_T4(profile->timer_t4)),
SIPTAG_ACCEPT_STR("application/sdp, multipart/mixed"),
TAG_IF(sofia_test_pflag(profile, PFLAG_NO_CONNECTION_REUSE),
TPTAG_REUSE(0)),
TAG_END()); /* Last tag should always finish the sequence */
if (!profile->nua) {
@ -3673,6 +3675,13 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
profile->timer_t4 = 4000;
}
} else if (!strcasecmp(var, "reuse-connections")) {
switch_bool_t value = switch_true(val);
if (!value) {
sofia_set_pflag(profile, PFLAG_NO_CONNECTION_REUSE);
} else {
sofia_clear_pflag(profile, PFLAG_NO_CONNECTION_REUSE);
}
}
}