if (var) {
char *arg = NULL;
app = switch_core_session_strdup(channel->session, var);
- if ((arg = strchr(app, ' '))) {
- *arg++ = '\0';
- }
- if (switch_core_session_in_thread(channel->session)) {
- switch_core_session_execute_application(channel->session, app, arg);
- } else {
+ if (strstr(app, "::")) {
switch_core_session_execute_application_async(channel->session, app, arg);
+ } else {
+ if ((arg = strchr(app, ' '))) {
+ *arg++ = '\0';
+ }
+
+ switch_core_session_execute_application(channel->session, app, arg);
}
}
(var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))) && !zstr(var)) {
char *arg = NULL;
app = switch_core_session_strdup(channel->session, var);
- if ((arg = strchr(app, ' '))) {
- *arg++ = '\0';
- }
- if (switch_core_session_in_thread(channel->session)) {
- switch_core_session_execute_application(channel->session, app, arg);
- } else {
+
+ if (strstr(app, "::")) {
switch_core_session_execute_application_async(channel->session, app, arg);
+ } else {
+ if ((arg = strchr(app, ' '))) {
+ *arg++ = '\0';
+ }
+
+ switch_core_session_execute_application(channel->session, app, arg);
}
}
(!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))))
&& !zstr(var)) {
char *arg = NULL;
- char *colon = NULL;
app = switch_core_session_strdup(channel->session, var);
- arg = strchr(app, ' ');
- colon = strchr(app, ':');
- if (colon && (!arg || arg > colon) && *(colon + 1) == ':') {
- switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s (BROADCAST)\n", channel->name, app);
- switch_ivr_broadcast(switch_core_session_get_uuid(channel->session), app, SMF_NONE);
+ if (strstr(app, "::")) {
+ switch_core_session_execute_application_async(channel->session, app, arg);
} else {
- if (arg) {
+ if ((arg = strchr(app, ' '))) {
*arg++ = '\0';
}
- switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s execute on answer: %s(%s)\n", channel->name, app,
- switch_str_nil(arg));
-
- if (switch_core_session_in_thread(channel->session)) {
- switch_core_session_execute_application(channel->session, app, arg);
- } else {
- switch_core_session_execute_application_async(channel->session, app, arg);
- }
+
+ switch_core_session_execute_application(channel->session, app, arg);
}
}