e1_recorder: Skip storing data to disk if line is in ALARM state
Change-Id: Ie4c671053d372bc700f506198d1916853da03b9e
This commit is contained in:
parent
f2d347f819
commit
5a70420b76
|
@ -28,6 +28,29 @@ static enum osmo_e1cap_capture_mode ts2cap_mode(struct e1inp_ts *ts)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sig_inp_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data)
|
||||||
|
{
|
||||||
|
struct input_signal_data *isd = signal_data;
|
||||||
|
struct e1_recorder_line *rline;
|
||||||
|
|
||||||
|
OSMO_ASSERT(subsys == SS_L_INPUT);
|
||||||
|
OSMO_ASSERT(isd->line && isd->line->num < ARRAY_SIZE(g_recorder.line));
|
||||||
|
|
||||||
|
switch (signal) {
|
||||||
|
case S_L_INP_LINE_ALARM:
|
||||||
|
LOGP(DMAIN, LOGL_NOTICE, "Line %u: ALARM\n", isd->line->num);
|
||||||
|
rline = &g_recorder.line[isd->line->num];
|
||||||
|
rline->has_alarm = true;
|
||||||
|
break;
|
||||||
|
case S_L_INP_LINE_NOALARM:
|
||||||
|
LOGP(DMAIN, LOGL_NOTICE, "Line %u: NOALARM\n", isd->line->num);
|
||||||
|
rline = &g_recorder.line[isd->line->num];
|
||||||
|
rline->has_alarm = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* receive a raw message frome the E1 timeslot */
|
/* receive a raw message frome the E1 timeslot */
|
||||||
void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg)
|
void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +58,11 @@ void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg)
|
||||||
enum osmo_e1cap_capture_mode cap_mode = ts2cap_mode(ts);
|
enum osmo_e1cap_capture_mode cap_mode = ts2cap_mode(ts);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (rline->has_alarm) {
|
||||||
|
DEBUGP(DMAIN, "Skipping storage as line %u is in ALARM\n", ts->line->num);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: special processing of TFP and PGSL */
|
/* FIXME: special processing of TFP and PGSL */
|
||||||
|
|
||||||
rc = e1frame_store(ts, msg, cap_mode);
|
rc = e1frame_store(ts, msg, cap_mode);
|
||||||
|
@ -144,6 +172,8 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
handle_options(argc, argv);
|
handle_options(argc, argv);
|
||||||
|
|
||||||
|
osmo_signal_register_handler(SS_L_INPUT, sig_inp_cbfn, NULL);
|
||||||
|
|
||||||
rc = vty_read_config_file(g_config_file, NULL);
|
rc = vty_read_config_file(g_config_file, NULL);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -17,6 +17,7 @@ enum rec_vty_node {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct e1_recorder_line {
|
struct e1_recorder_line {
|
||||||
|
bool has_alarm;
|
||||||
struct {
|
struct {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
uint8_t line_nr;
|
uint8_t line_nr;
|
||||||
|
|
Loading…
Reference in New Issue