From 823ff1608885a0199dc460d5aaca28cd2ba2c1d7 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 18 Nov 2009 22:26:05 +0100 Subject: [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. --- openbsc/include/openbsc/gsm_data.h | 3 +++ openbsc/src/bsc_msc_ip.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'openbsc') 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 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); -- cgit v1.2.3