]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-2748
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 1 Oct 2010 14:30:32 +0000 (09:30 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 1 Oct 2010 14:30:32 +0000 (09:30 -0500)
conf/sip_profiles/internal.xml
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 1c2ef1216c26797777d17ed33fad7e050732bb54..50833bfbec88a70d8bb6e04a0930cc6a8e1117a8 100644 (file)
     <!--all inbound reg will stored in the db using this domain -->
     <param name="force-register-db-domain" value="$${domain}"/>
 
+    <!--<param name="delete-subs-on-register" value="false"/>-->
+
     <!-- enable rtcp on every channel also can be done per leg basis with rtcp_audio_interval_msec variable set to passthru to pass it across a call-->
     <!--<param name="rtcp-audio-interval-msec" value="5000"/>-->
     <!--<param name="rtcp-video-interval-msec" value="5000"/>-->
index 0cd4b27a51433c1832104fdc5a34a3c6951efad3..567404607475631ed13f74c6e2bcc035e7ad8a03 100644 (file)
@@ -220,6 +220,7 @@ typedef enum {
        PFLAG_T38_PASSTHRU,
        PFLAG_CID_IN_1XX,
        PFLAG_IN_DIALOG_CHAT,
+       PFLAG_DEL_SUBS_ON_REG,
        /* No new flags below this line */
        PFLAG_MAX
 } PFLAGS;
index 562a091562ed9ad989a82c2a7700c423d07d8aa5..aa208c2aee757db7981da1341ff7b92adf6b23df 100644 (file)
@@ -2265,6 +2265,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
                                                }
+                                       } else if (!strcasecmp(var, "delete-subs-on-register")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
+                                               }
                                        } else if (!strcasecmp(var, "in-dialog-chat")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_IN_DIALOG_CHAT);
@@ -2949,6 +2955,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                } else {
                                                        sofia_clear_pflag(profile, PFLAG_IN_DIALOG_CHAT);
                                                }
+                                       } else if (!strcasecmp(var, "delete-subs-on-register")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
+                                               }
                                        } else if (!strcasecmp(var, "t38-passthru")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_T38_PASSTHRU);
index 4f35ac0e3c736369154981374f70dcb763652c54..285dc8ae3a0ec03687e9412a1b24526616fb8ab4 100644 (file)
@@ -820,9 +820,10 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
        switch_event_t *auth_params = NULL;
        int r = 0;
        long reg_count = 0;
-       int delete_subs = 1;
+       int delete_subs;
        const char *agent = "unknown";
                
+       delete_subs = sofia_test_pflag(profile, PFLAG_DEL_SUBS_ON_REG);
 
        /* all callers must confirm that sip, sip->sip_request and sip->sip_contact are not NULL */
        switch_assert(sip != NULL && sip->sip_contact != NULL && sip->sip_request != NULL);
@@ -841,10 +842,6 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
 
        if (sip->sip_user_agent) {
                agent = sip->sip_user_agent->g_string;
-
-               if (switch_stristr("snom", agent)) {
-                       delete_subs = 0;
-               }
        }
 
        if (from) {