making private events fire (please test)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4327 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d0cda3c757
commit
5e4396a46e
|
@ -746,6 +746,7 @@ typedef enum {
|
||||||
SWITCH_EVENT_CODEC - Codec Change
|
SWITCH_EVENT_CODEC - Codec Change
|
||||||
SWITCH_EVENT_BACKGROUND_JOB - Background Job
|
SWITCH_EVENT_BACKGROUND_JOB - Background Job
|
||||||
SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
|
SWITCH_EVENT_DETECTED_SPEECH - Detected Speech
|
||||||
|
SWITCH_EVENT_PRIVATE_COMMAND - A private command event
|
||||||
SWITCH_EVENT_ALL - All events at once
|
SWITCH_EVENT_ALL - All events at once
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -785,6 +786,7 @@ typedef enum {
|
||||||
SWITCH_EVENT_CODEC,
|
SWITCH_EVENT_CODEC,
|
||||||
SWITCH_EVENT_BACKGROUND_JOB,
|
SWITCH_EVENT_BACKGROUND_JOB,
|
||||||
SWITCH_EVENT_DETECTED_SPEECH,
|
SWITCH_EVENT_DETECTED_SPEECH,
|
||||||
|
SWITCH_EVENT_PRIVATE_COMMAND,
|
||||||
SWITCH_EVENT_ALL
|
SWITCH_EVENT_ALL
|
||||||
} switch_event_types_t;
|
} switch_event_types_t;
|
||||||
|
|
||||||
|
|
|
@ -1909,6 +1909,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_queue_private_event(switch_c
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session->private_event_queue) {
|
if (session->private_event_queue) {
|
||||||
|
(*event)->event_id = SWITCH_EVENT_PRIVATE_COMMAND;
|
||||||
if (switch_queue_trypush(session->private_event_queue, *event) == SWITCH_STATUS_SUCCESS) {
|
if (switch_queue_trypush(session->private_event_queue, *event) == SWITCH_STATUS_SUCCESS) {
|
||||||
*event = NULL;
|
*event = NULL;
|
||||||
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
|
switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
|
||||||
|
|
|
@ -130,6 +130,7 @@ static char *EVENT_NAMES[] = {
|
||||||
"CODEC",
|
"CODEC",
|
||||||
"BACKGROUND_JOB",
|
"BACKGROUND_JOB",
|
||||||
"DETECTED_SPEECH",
|
"DETECTED_SPEECH",
|
||||||
|
"PRIVATE_COMMAND",
|
||||||
"ALL"
|
"ALL"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
|
||||||
unsigned long CMD_NOMEDIA = apr_hashfunc_default("nomedia", &hlen);
|
unsigned long CMD_NOMEDIA = apr_hashfunc_default("nomedia", &hlen);
|
||||||
|
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
|
assert(event != NULL);
|
||||||
|
|
||||||
if (switch_strlen_zero(cmd)) {
|
if (switch_strlen_zero(cmd)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Command!\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Command!\n");
|
||||||
|
@ -170,7 +171,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
|
||||||
|
|
||||||
if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
|
if (switch_core_session_dequeue_private_event(session, &event) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_ivr_parse_event(session, event);
|
switch_ivr_parse_event(session, event);
|
||||||
switch_event_destroy(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_channel_has_dtmf(channel)) {
|
if (switch_channel_has_dtmf(channel)) {
|
||||||
|
|
Loading…
Reference in New Issue