git-svn-id: http://svn.openzap.org/svn/openzap/trunk@1050 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Moises Silva 2010-03-05 20:14:44 +00:00
parent 18d3477131
commit 737597eba6
2 changed files with 53 additions and 0 deletions

6
libs/openzap/bootstrap Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
autoheader
libtoolize --force --copy
aclocal
automake -f --copy --add-missing
autoconf

View File

@ -1824,6 +1824,49 @@ static ZIO_SIGNAL_CB_FUNCTION(on_r2_signal)
return status;
}
static ZIO_SIGNAL_CB_FUNCTION(on_common_signal)
{
switch_event_t *event = NULL;
switch (sigmsg->event_id) {
case ZAP_SIGEVENT_ALARM_CLEAR:
case ZAP_SIGEVENT_ALARM_TRAP:
{
if (zap_channel_get_alarms(sigmsg->channel) != ZAP_SUCCESS) {
zap_log(ZAP_LOG_ERROR, "failed to retrieve alarms\n");
return ZAP_FAIL;
}
if (switch_event_create(&event, SWITCH_EVENT_TRAP) != SWITCH_STATUS_SUCCESS) {
zap_log(ZAP_LOG_ERROR, "failed to create alarms events\n");
return ZAP_FAIL;
}
if (sigmsg->event_id == ZAP_SIGEVENT_ALARM_CLEAR) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "condition", "zap-alarm-clear");
} else {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "condition", "zap-alarm-trap");
}
}
break;
default:
return ZAP_SUCCESS;
break;
}
if (zap_test_alarm_flag(sigmsg->channel, ZAP_ALARM_RED)) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm", "red");
}
if (zap_test_alarm_flag(sigmsg->channel, ZAP_ALARM_YELLOW)) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm", "yellow");
}
if (zap_test_alarm_flag(sigmsg->channel, ZAP_ALARM_BLUE)) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm", "blue");
}
switch_event_fire(&event);
return ZAP_BREAK;
}
static ZIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
{
switch_core_session_t *session = NULL;
@ -1831,6 +1874,10 @@ static ZIO_SIGNAL_CB_FUNCTION(on_clear_channel_signal)
zap_log(ZAP_LOG_DEBUG, "got clear channel sig [%s]\n", zap_signal_event2str(sigmsg->event_id));
if (on_common_signal(sigmsg) == ZAP_BREAK) {
return ZAP_SUCCESS;
}
switch(sigmsg->event_id) {
case ZAP_SIGEVENT_START:
{