aboutsummaryrefslogtreecommitdiffstats
path: root/src/e1_recorder.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-07-29 14:26:50 +0200
committerHarald Welte <laforge@gnumonks.org>2016-07-29 14:26:50 +0200
commitb7e40238d75754a00ac5dd57627b08980d032cbe (patch)
tree25b702d8c349e97a2623982acc6a27d0f46a17cd /src/e1_recorder.c
parent0e91aa1ec5a74704044a9cbb06964d47a1861d24 (diff)
first functional version that actually records + mirrors data
Diffstat (limited to 'src/e1_recorder.c')
-rw-r--r--src/e1_recorder.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/e1_recorder.c b/src/e1_recorder.c
index 5c53205..d8dccfe 100644
--- a/src/e1_recorder.c
+++ b/src/e1_recorder.c
@@ -3,6 +3,7 @@
#include <osmocom/core/application.h>
#include <osmocom/vty/vty.h>
#include <osmocom/vty/telnet_interface.h>
+#include <osmocom/vty/logging.h>
#include <osmocom/abis/abis.h>
#include <osmocom/abis/e1_input.h>
@@ -35,7 +36,15 @@ void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg)
e1frame_store(ts, msg, cap_mode);
if (rline->mirror.enabled) {
+ struct e1inp_line *other_line =
+ e1inp_line_find(rline->mirror.line_nr);
+ struct e1inp_ts *other_ts;
+ other_ts = &other_line->ts[ts->num-1];
+ if (!other_ts)
+ return;
/* forward data to destination line */
+ OSMO_ASSERT(other_ts->type == ts->type);
+ msgb_enqueue(&other_ts->raw.tx_queue, msg);
}
}
@@ -49,11 +58,10 @@ static int inp_sig_cb(unsigned int subsys, unsigned int signal,
return 0;
}
-// e1inp_ts_config_raw(ts, line, &e1ts_raw_recv);
-
static const struct log_info_cat recorder_categories[] = {
[DMAIN] = {
.name = "MAIN",
+ .description = "Osmocom E1 Recorder",
.enabled = 1, .loglevel = LOGL_DEBUG,
},
};
@@ -79,6 +87,7 @@ int main(int argc, char **argv)
osmo_init_logging(&info);
vty_init(&vty_info);
+ logging_vty_add_cmds(&info);
osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
libosmo_abis_init(rec_tall_ctx);
e1inp_vty_init();