]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Allow reincarnation from mod_sofia's shutdown-on-fail
authorTravis Cross <tc@traviscross.com>
Fri, 27 Jun 2014 22:14:14 +0000 (22:14 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 27 Jun 2014 22:18:39 +0000 (22:18 +0000)
mod_sofia's parameter shutdown-on-fail now accepts the value
"reincarnate-now".  This will cause the switch to exit immediately
with a non-zero exit code so that the supervisor can recover the
switch.  For this to work you have to pass in -reincarnate or
-reincarnate-reexec to freeswitch.

src/mod/endpoints/mod_sofia/sofia.c

index b2019041ed784781b13e25c530e677ddc9e77e74..f53149f3fd22633ed86ada046e85547e41800fea 100644 (file)
@@ -2478,6 +2478,9 @@ static void sofia_perform_profile_start_failure(sofia_profile_t *profile, char *
                } else if (!strcasecmp(profile->shutdown_type, "asap")) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile %s could not load! Shutting down ASAP!\n", profile->name);
                        switch_core_session_ctl(SCSC_SHUTDOWN_ASAP, &arg);
+               } else if (!strcasecmp(profile->shutdown_type, "reincarnate-now")) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile %s could not load! Asking for reincarnation now!\n", profile->name);
+                       switch_core_session_ctl(SCSC_REINCARNATE_NOW, &arg);
                }
        }