sending termination in-service/out-of-service service change for termination whenever there is alarm indication from freetdm

This commit is contained in:
root
2012-07-30 12:32:46 -04:00
parent a3b4f3ad4d
commit 22bc29b5e0
8 changed files with 167 additions and 102 deletions
+2 -5
View File
@@ -84,7 +84,7 @@ switch_io_routines_t ctdm_io_routines = {
.receive_message = channel_receive_message
};
static void ctdm_report_alarms(ftdm_channel_t *channel, const char* mg_profile_name)
static void ctdm_report_alarms(ftdm_channel_t *channel)
{
switch_event_t *event = NULL;
ftdm_alarm_flag_t alarmflag = 0;
@@ -109,8 +109,6 @@ static void ctdm_report_alarms(ftdm_channel_t *channel, const char* mg_profile_n
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "condition", "ftdm-alarm-trap");
}
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "mg-profile-name", mg_profile_name);
if (alarmflag & FTDM_ALARM_RED) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alarm", "red");
}
@@ -149,7 +147,6 @@ static void ctdm_event_handler(switch_event_t *event)
const char *chan_number = NULL;
uint32_t chan_id = 0;
const char *cond = switch_event_get_header(event, "condition");
const char *mg_profile_name = switch_event_get_header(event, "mg-profile-name");
if (zstr(cond)) {
return;
@@ -187,7 +184,7 @@ static void ctdm_event_handler(switch_event_t *event)
return;
}
ctdm_report_alarms(channel, mg_profile_name);
ctdm_report_alarms(channel);
}
}
break;