*/
#define switch_core_session_execute_application(_a, _b, _c) switch_core_session_execute_application_get_flags(_a, _b, _c, NULL)
+SWITCH_DECLARE(uint32_t) switch_core_session_stack_count(switch_core_session_t *session, int x);
+
/*!
\brief Run a dialplan and execute an extension
\param session the current session
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_DECLARE(uint32_t) switch_core_session_stack_count(switch_core_session_t *session, int x)
+{
+ if (x > 0) session->stack_count++;
+ else if (x < 0) session->stack_count--;
+
+ return session->stack_count;
+}
+
SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_session_t *session, const char *exten, const char *dialplan,
const char *context)
{
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));
+ return SWITCH_STATUS_FALSE;
+ }
+
+ switch_core_session_stack_count(session, 1);
+
switch_ivr_parse_all_messages(session);
channel = switch_core_session_get_channel(session);
x++;
}
+ switch_core_session_stack_count(session, -1);
+
return SWITCH_STATUS_SUCCESS;
}