]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
d'oh
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 16 Dec 2011 20:41:48 +0000 (14:41 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 16 Dec 2011 20:41:48 +0000 (14:41 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c

index 1dfe82a62d48e005fd7b2fbf2a2af1a163c31b7d..30eadc821f16a9cad05cc2d2168f6a834251bc78 100644 (file)
@@ -4306,11 +4306,6 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
 
        *new_session = NULL;
 
-       if (sofia_test_pflag(profile, PFLAG_STANDBY)) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "System Paused\n");
-               goto error;
-       }
-
        if (!outbound_profile || zstr(outbound_profile->destination_number)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid Empty Destination\n");
                goto error;
@@ -4412,6 +4407,13 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                }
 
                profile = gateway_ptr->profile;
+
+               if (profile && sofia_test_pflag(profile, PFLAG_STANDBY)) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "System Paused\n");
+                       cause = SWITCH_CAUSE_SYSTEM_SHUTDOWN;
+                       goto error;
+               }
+               
                tech_pvt->gateway_name = switch_core_session_strdup(nsession, gateway_ptr->name);
                switch_channel_set_variable(nchannel, "sip_gateway_name", gateway_ptr->name);
 
@@ -4490,6 +4492,12 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
                        goto error;
                }
 
+               if (profile && sofia_test_pflag(profile, PFLAG_STANDBY)) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "System Paused\n");
+                       cause = SWITCH_CAUSE_SYSTEM_SHUTDOWN;
+                       goto error;
+               }
+
                if (profile->domain_name && strcmp(profile->domain_name, profile->name)) {
                        profile_name = profile->domain_name;
                }