mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
add execute_on_answer magic variable
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8003 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -1533,7 +1533,17 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
|
||||
status = switch_core_session_receive_message(channel->session, &msg);
|
||||
|
||||
if (status == SWITCH_STATUS_SUCCESS) {
|
||||
const char *var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE);
|
||||
char *app;
|
||||
switch_channel_perform_mark_answered(channel, file, func, line);
|
||||
if (var) {
|
||||
char *arg = NULL;
|
||||
app = switch_core_session_strdup(channel->session, var);
|
||||
if ((arg = strchr(app, ' '))) {
|
||||
*arg++ = '\0';
|
||||
}
|
||||
switch_core_session_execute_application(channel->session, app, arg);
|
||||
}
|
||||
} else {
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
|
||||
}
|
||||
|
Reference in New Issue
Block a user