]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add reuse-connections sofia profile param to allow users to turn off TPTAG_REUSE...
authorMathieu Rene <mrene@avgs.ca>
Fri, 10 Dec 2010 19:30:47 +0000 (14:30 -0500)
committerMathieu Rene <mrene@avgs.ca>
Fri, 10 Dec 2010 19:30:47 +0000 (14:30 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 6970a7ab05a6d3d3e9d1a370a142bbdf516d57a8..61d165753c60fc9b4b956656cbca7c1adba257ba 100644 (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;
index 2e13b544d0cd35472d595d2420c1238304bfb840..e34d7aef9de01ca1b4b138cfd523b1f6d1c88173 100644 (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);
+                                               }
                                        }
                                }