summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-12 21:38:15 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-12 22:09:16 +0800
commitcc7461cefc7944948ae2f8ad9dd93bb4cf0ca172 (patch)
treea7a7abe05eb6cc4907c0626ed15d9893964510d2
parente174061d1780ba62bc83c7500c2fcdacca54be6a (diff)
bsc_msc_ip: Assign a dummy gsm_subscriber to send a SACH DEACTIVATE
This is part of fixing USSD delivered to the MS. Currently only MT services would end up with a GSM Subscriber assigned. The LCHAN code is using the GSM Subscriber to figure out if a SACH DEACTIVATE should be send to the MS. Add code to always assign a GSM Subscriber.
-rw-r--r--openbsc/src/bsc_msc_ip.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c
index 12d4c8bf3..0a7aa0dec 100644
--- a/openbsc/src/bsc_msc_ip.c
+++ b/openbsc/src/bsc_msc_ip.c
@@ -86,6 +86,19 @@ struct llist_head *bsc_sccp_connections()
return &active_connections;
}
+/*
+ * Having a subscriber in the lchan is used to indicate that a SACH DEACTIVATE
+ * should be send. We will just introduce a fake subscriber and bind it to the
+ * lchan.
+ */
+static void assign_dummy_subscr(struct gsm_lchan *lchan)
+{
+ if (!lchan->conn.subscr) {
+ lchan->conn.subscr = subscr_get_or_create(bsc_gsmnet, "2323");
+ lchan->conn.subscr->lac = 2323;
+ }
+}
+
struct bss_sccp_connection_data *bss_sccp_create_data()
{
struct bss_sccp_connection_data *data;
@@ -319,6 +332,8 @@ static int open_sccp_connection(struct msgb *layer3)
bsc_schedule_timer(&con_data->sccp_cc_timeout, 10, 0);
/* FIXME: Use transaction for this */
+ /* assign a dummy subscriber */
+ assign_dummy_subscr(layer3->lchan);
use_subscr_con(&layer3->lchan->conn);
sccp_connection_connect(sccp_connection, &sccp_ssn_bssap, data);
msgb_free(data);
@@ -426,6 +441,9 @@ static int handle_ass_compl(struct msgb *msg)
msg->lchan->msc_data->secondary_lchan = NULL;
old_chan->msc_data = NULL;
+ /* assign a dummy subscriber */
+ assign_dummy_subscr(msg->lchan);
+
/* give up the old channel to not do a SACCH deactivate */
if (old_chan->conn.subscr)
subscr_put(old_chan->conn.subscr);