]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
option to turn of auto_restart of sofia profiles on ip change
authorBrian West <brian@freeswitch.org>
Thu, 11 Dec 2008 20:16:32 +0000 (20:16 +0000)
committerBrian West <brian@freeswitch.org>
Thu, 11 Dec 2008 20:16:32 +0000 (20:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10715 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/autoload_configs/sofia.conf.xml
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c

index 50c31acf488b94e73f42527617dd50b6b964e0e6..24252d08ce3dcc83ff34959833068593501a9e3e 100644 (file)
@@ -2,6 +2,8 @@
 
   <global_settings>
     <param name="log-level" value="0"/>
+    <!-- <param name="auto-restart" value="false"/> -->
+    <param name="debug-presence" value="0"/>
   </global_settings>
 
   <!--
index 70b56b6ca94894612495482cefddf13bde08ff9c..21bd84391a883b2e85d87d5f40a3d2dca02a3dae 100644 (file)
@@ -2686,7 +2686,7 @@ static void general_event_handler(switch_event_t *event)
                {
                        const char *cond = switch_event_get_header(event, "condition");
 
-                       if (cond && !strcmp(cond, "network-address-change")) {
+                       if (cond && !strcmp(cond, "network-address-change") && mod_sofia_globals.auto_restart) {
                                sofia_glue_restart_all_profiles();
                        }
                        
index 55b8a6de62098ef3db2fcef69dd6a63a8d56d9f1..89d85bed56db74d85402598f03e8af36c53c8025 100644 (file)
@@ -243,6 +243,7 @@ struct mod_sofia_globals {
        switch_event_node_t *custom_node;
        switch_event_node_t *mwi_node;
        int debug_presence;
+       int auto_restart;
 };
 extern struct mod_sofia_globals mod_sofia_globals;
 
index d15cd05b83a2788ecfbda20d0e16723546a9c7f1..8d33176d4fee30fc214479e86f2f56cc9a331b1c 100644 (file)
@@ -1571,6 +1571,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                goto done;
        }
 
+       mod_sofia_globals.auto_restart = SWITCH_TRUE;
+
        if ((settings = switch_xml_child(cfg, "global_settings"))) {
                for (param = switch_xml_child(settings, "param"); param; param = param->next) {
                        char *var = (char *) switch_xml_attr_soft(param, "name");
@@ -1579,6 +1581,8 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                su_log_set_level(NULL, atoi(val));
                        } else if (!strcasecmp(var, "debug-presence")) {
                                mod_sofia_globals.debug_presence = atoi(val);
+                       } else if (!strcasecmp(var, "auto-restart")) {
+                               mod_sofia_globals.auto_restart = switch_true(val);
                        }
                }
        }