aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/src/chan_alloc.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index a3ebbbc9..e0d33707 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -288,6 +288,9 @@ struct gsm_lchan {
/* release reason */
u_int8_t release_reason;
+
+ /* timestamp */
+ struct timeval alloc_time;
};
struct gsm_e1_subslot {
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 623069ff..c6d4e9bc 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <time.h>
#include <openbsc/gsm_data.h>
#include <openbsc/chan_alloc.h>
@@ -287,6 +288,9 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type,
memset(&lchan->conn, 0, sizeof(lchan->conn));
lchan->conn.lchan = lchan;
lchan->conn.bts = lchan->ts->trx->bts;
+
+ /* set the alloc time */
+ gettimeofday(&lchan->alloc_time, NULL);
} else {
struct challoc_signal_data sig;
sig.bts = bts;