aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-11-18 22:26:05 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-20 17:35:46 +0100
commit823ff1608885a0199dc460d5aaca28cd2ba2c1d7 (patch)
treeb70bb003bed5a99ad223dbd06ec537183fc8891e /openbsc
parent6f93c6a1e0d3e4e189aacc0ea8fcc0f55246c896 (diff)
[bsc] Send the SCCP IT message in a given interval
Send the message every 60 seconds on every SCCP connection. The 60 seconds were taken from a protocol trace obtained on the network.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/src/bsc_msc_ip.c18
2 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index a8973ef73..8a49a5dc7 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -127,6 +127,9 @@ struct bss_sccp_connection_data {
/* for assginment command */
struct timer_list T10;
+ /* for SCCP ... */
+ struct timer_list sccp_it;
+
/* audio handling */
int rtp_port;
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index 97dc42de0..9bce39aad 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -47,6 +47,9 @@
#include <sccp/sccp.h>
+/* SCCP helper */
+#define SCCP_IT_TIMER 60
+
/* MCC and MNC for the Location Area Identifier */
struct gsm_network *bsc_gsmnet = 0;
static const char *config_file = "openbsc.cfg";
@@ -76,11 +79,21 @@ struct bss_sccp_connection_data *bss_sccp_create_data()
void bss_sccp_free_data(struct bss_sccp_connection_data *data)
{
bsc_del_timer(&data->T10);
+ bsc_del_timer(&data->sccp_it);
bsc_free_queued(data->sccp);
bts_free_queued(data);
talloc_free(data);
}
+static void sccp_it_fired(void *_data)
+{
+ struct bss_sccp_connection_data *data =
+ (struct bss_sccp_connection_data *) _data;
+
+ sccp_connection_send_it(data->sccp);
+ bsc_schedule_timer(&data->sccp_it, SCCP_IT_TIMER, 0);
+}
+
/* GSM subscriber drop-ins */
extern struct llist_head *subscr_bsc_active_subscriber(void);
@@ -201,6 +214,11 @@ int open_sccp_connection(struct msgb *layer3)
sccp_connection->data_ctx = con_data;
layer3->lchan->msc_data = con_data;
+ /* start the inactivity test timer */
+ con_data->sccp_it.cb = sccp_it_fired;
+ con_data->sccp_it.data = con_data;
+ bsc_schedule_timer(&con_data->sccp_it, SCCP_IT_TIMER, 0);
+
/* FIXME: Use transaction for this */
use_lchan(layer3->lchan);
sccp_connection_connect(sccp_connection, &sccp_ssn_bssap, data);