]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11706 [core] add some extra information to troubleshoot 'too many stacked extensions'
authorChris Rienzo <chris@signalwire.com>
Thu, 14 Mar 2019 21:20:11 +0000 (17:20 -0400)
committerChris Rienzo <chris@rienzo.com>
Tue, 19 Mar 2019 16:12:26 +0000 (12:12 -0400)
src/include/switch_types.h
src/switch_core_session.c
src/switch_ivr.c

index 589f9ec1d9a40f5c4261a7a3e00838150fbe09e0..35745ef5a0e84e1f5a60f8497f0686cfa48cbdf9 100644 (file)
@@ -556,7 +556,7 @@ struct switch_filenames {
 typedef struct switch_filenames switch_filenames;
 SWITCH_DECLARE_DATA extern switch_filenames SWITCH_GLOBAL_filenames;
 
-#define SWITCH_MAX_STACKS 16
+#define SWITCH_MAX_STACKS 32
 #define SWITCH_THREAD_STACKSIZE 240 * 1024
 #define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
 #define SWITCH_MAX_INTERVAL 120        /* we only do up to 120ms */
index 66b2a5c237501448296d3536f4d91b39c5d3aa73..fda41a53e6a2b3b9b8a84206be27b0a7fffd971f 100644 (file)
@@ -2810,11 +2810,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
 
 
        if ( switch_core_test_flag(SCF_DIALPLAN_TIMESTAMPS) ) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "EXECUTE %s %s(%s)\n",
-                                         switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "EXECUTE [depth=%d] %s %s(%s)\n",
+                                         session->stack_count, switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
        } else {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG, "EXECUTE %s %s(%s)\n",
-                                         switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG, "EXECUTE [depth=%d] %s %s(%s)\n",
+                                         session->stack_count, switch_channel_get_name(session->channel), app, switch_str_nil(expanded));
        }
 
        if ((var = switch_channel_get_variable(session->channel, "verbose_presence")) && switch_true(var)) {
@@ -2928,8 +2928,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
        }
 
        if (session->stack_count > SWITCH_MAX_STACKS) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions\n",
-                                                 switch_channel_get_name(session->channel));
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions [depth=%d]\n",
+                                                 switch_channel_get_name(session->channel), session->stack_count);
                return SWITCH_STATUS_FALSE;
        }
 
@@ -2997,7 +2997,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_se
        }
 
        while (switch_channel_ready(channel) && extension->current_application) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Execute %s(%s)\n",
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Execute [depth=%d] %s(%s)\n",
+                                                 session->stack_count,
                                                  extension->current_application->application_name, switch_str_nil(extension->current_application->application_data));
 
                if (switch_core_session_execute_application(session,
index 0743f824ce569568057ee5fcd1ef5023ab84d684..e8bd712f44e9ed7cf340491662252c4e625f46b6 100644 (file)
@@ -623,8 +623,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
                        for (x = 0; x < loops || loops < 0; x++) {
                                switch_time_t b4, aftr;
 
-                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Command Execute %s(%s)\n",
-                                                                 switch_channel_get_name(channel), app_name, switch_str_nil(app_arg));
+                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Command Execute [depth=%d] %s(%s)\n",
+                                                                 switch_channel_get_name(channel), switch_core_session_stack_count(session, 0), app_name, switch_str_nil(app_arg));
                                b4 = switch_micro_time_now();
 
                                if (event_uuid) {
@@ -901,12 +901,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_signal_data(switch_core_se
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session)
 {
-       int x = 0;
        switch_channel_t *channel;
-
        if (switch_core_session_stack_count(session, 0) > SWITCH_MAX_STACKS) {
-               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions\n",
-                                                 switch_core_session_get_name(session));
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions [depth=%d]\n",
+                                                 switch_core_session_get_name(session), switch_core_session_stack_count(session, 0));
                return SWITCH_STATUS_FALSE;
        }
 
@@ -924,9 +922,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_
                }
        }
 
-       while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS) {
-               x++;
-       }
+       while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS) {}
 
  done:
        switch_core_session_stack_count(session, -1);