aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/src/abis_rsl.c3
-rw-r--r--openbsc/src/debug.c6
-rw-r--r--openbsc/src/gsm_04_08.c3
-rw-r--r--openbsc/src/rtp_proxy.c2
-rw-r--r--openbsc/src/system_information.c14
-rwxr-xr-xopenbsc/tools/26c3-guru-import.py95
6 files changed, 119 insertions, 4 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index 667313b0a..dbe3540cf 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -1288,6 +1288,9 @@ static int rsl_rx_chan_rqd(struct msgb *msg)
counter_inc(bts->network->stats.chreq.total);
+ if (lctype == GSM_LCHAN_TCH_H)
+ lctype = GSM_LCHAN_TCH_F;
+
/* check availability / allocate channel */
lchan = lchan_alloc(bts, lctype);
if (!lchan) {
diff --git a/openbsc/src/debug.c b/openbsc/src/debug.c
index 90a9fc7e3..dc270d86e 100644
--- a/openbsc/src/debug.c
+++ b/openbsc/src/debug.c
@@ -35,13 +35,13 @@
/* default categories */
static struct debug_category default_categories[Debug_LastEntry] = {
[DRLL] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DCC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DCC] = { .enabled = 1, .loglevel = LOGL_INFO },
[DNM] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DRR] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DRSL] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMM] = { .enabled = 1, .loglevel = LOGL_INFO },
[DMNCC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DSMS] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DSMS] = { .enabled = 1, .loglevel = LOGL_INFO },
[DPAG] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMEAS] = { .enabled = 0, .loglevel = LOGL_NOTICE },
[DMI] = { .enabled = 0, .loglevel = LOGL_NOTICE },
@@ -51,7 +51,7 @@ static struct debug_category default_categories[Debug_LastEntry] = {
[DSCCP] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMSC] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DMGCP] = { .enabled = 1, .loglevel = LOGL_NOTICE },
- [DHO] = { .enabled = 1, .loglevel = LOGL_NOTICE },
+ [DHO] = { .enabled = 1, .loglevel = LOGL_INFO },
[DDB] = { .enabled = 1, .loglevel = LOGL_NOTICE },
[DREF] = { .enabled = 0, .loglevel = LOGL_NOTICE },
};
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 6eeddbf90..0ad80106c 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -3316,12 +3316,15 @@ int mncc_send(struct gsm_network *net, int msg_type, void *arg)
if (transt == trans ||
transt->subscr != subscr)
continue;
+#if 0
+ bts = entry->lchan->ts->trx->bts;
DEBUGP(DCC, "(bts %d trx - ts - ti -- sub %s) "
"Received '%s' from MNCC with "
"unallocated channel, paging already "
"started.\n", bts->nr,
data->called.number,
get_mncc_name(msg_type));
+#endif
subscr_put(subscr);
trans_free(trans);
return 0;
diff --git a/openbsc/src/rtp_proxy.c b/openbsc/src/rtp_proxy.c
index 83b774f97..78bb79af9 100644
--- a/openbsc/src/rtp_proxy.c
+++ b/openbsc/src/rtp_proxy.c
@@ -226,6 +226,7 @@ int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame)
return -EINVAL;
}
+#if 0
{
struct timeval tv, tv_diff;
long int usec_diff, frame_diff;
@@ -246,6 +247,7 @@ int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame)
rs->transmit.timestamp += frame_diff_excess * duration;
}
}
+#endif
msg = msgb_alloc(sizeof(struct rtp_hdr) + payload_len, "RTP-GSM-FULL");
if (!msg)
diff --git a/openbsc/src/system_information.c b/openbsc/src/system_information.c
index 6493794ef..c8c5fb5cf 100644
--- a/openbsc/src/system_information.c
+++ b/openbsc/src/system_information.c
@@ -169,6 +169,9 @@ static int generate_cell_chan_list(u_int8_t *chan_list, struct gsm_bts *bts)
return bitvec2freq_list(chan_list, bv, bts);
}
+/* hand-computed frequency list consisting of 868, 540, 871, 536, 870 */
+static const u_int8_t range1024[] = { 0x83, 0x64, 0x5c, 0x00, 0xff, 0x3f, 0xc0 };
+
/* generate a cell channel list as per Section 10.5.2.1b of 04.08 */
static int generate_bcch_chan_list(u_int8_t *chan_list, struct gsm_bts *bts)
{
@@ -176,14 +179,23 @@ static int generate_bcch_chan_list(u_int8_t *chan_list, struct gsm_bts *bts)
struct bitvec *bv = &bts->si_common.neigh_list;
/* first we generate a bitvec of the BCCH ARFCN's in our BSC */
+#if 0
llist_for_each_entry(cur_bts, &bts->network->bts_list, list) {
if (cur_bts == bts)
continue;
bitvec_set_bit_pos(bv, cur_bts->c0->arfcn, 1);
}
-
/* then we generate a GSM 04.08 frequency list from the bitvec */
return bitvec2freq_list(chan_list, bv, bts);
+#else
+ bitvec_set_bit_pos(bv, 868, 1);
+ bitvec_set_bit_pos(bv, 540, 1);
+ bitvec_set_bit_pos(bv, 871, 1);
+ bitvec_set_bit_pos(bv, 536, 1);
+ bitvec_set_bit_pos(bv, 870, 1);
+ memcpy(chan_list, range1024, sizeof(range1024));
+ return 0;
+#endif
}
static int generate_si1(u_int8_t *output, struct gsm_bts *bts)
diff --git a/openbsc/tools/26c3-guru-import.py b/openbsc/tools/26c3-guru-import.py
new file mode 100755
index 000000000..11604f0c2
--- /dev/null
+++ b/openbsc/tools/26c3-guru-import.py
@@ -0,0 +1,95 @@
+#!/usr/bin/python2.5
+
+# Based loosely on hlrsync.py from Jan Luebbe
+# (C) 2009 Daniel Willmann
+# All Rights Reserved
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from __future__ import with_statement
+
+import urllib
+from pysqlite2 import dbapi2 as sqlite3
+import sys
+
+hlr = sqlite3.connect(sys.argv[1])
+web = urllib.urlopen(sys.argv[2]).read()
+
+# switch to autocommit
+hlr.isolation_level = None
+
+hlr.row_factory = sqlite3.Row
+
+web = web.split("\n")
+
+# Remove last empty newline
+# List of extension - imei/imsi tuples from GURU2
+web_tuple = [ (int(i.split(" ")[0]), int(i.split(" ")[1])) for i in web if len(i) > 0 ]
+
+for x in web_tuple:
+ exten = x[0]
+ imxi = x[1]
+
+ # Enforce numering plan of 26c3
+ if exten < 9100 or exten > 9999:
+ continue
+
+ # Test if it is an IMSI and hasn't yet been authorized
+ subscr = hlr.execute("""
+ SELECT * FROM Subscriber WHERE imsi=="%015u"
+ """ % (imxi) ).fetchall()
+
+ #and authorized==0
+
+ # Not an IMSI
+ if len(subscr) == 0:
+ equip = hlr.execute("""
+ SELECT id,imei FROM Equipment WHERE imei LIKE "%u%%"
+ """ % (imxi/10) ).fetchall();
+ #print equip
+
+ if len(equip) == 0:
+ continue
+
+ subscrid = hlr.execute("""
+ SELECT * FROM EquipmentWatch WHERE equipment_id=%u ORDER BY created LIMIT 1
+ """ % (int(equip[0]['id'])) ).fetchall();
+
+ #print subscrid
+
+ if len(subscrid) == 0:
+ continue
+
+ subscr = hlr.execute("""
+ SELECT * FROM Subscriber WHERE id==%u
+ """ % subscrid[0]['subscriber_id']).fetchall();
+ # and authorized==0
+
+ if len(subscr) == 0:
+ continue
+
+ subscr = subscr[0]
+ # Now we have an unauthorized subscriber for the imXi
+ print exten, imxi
+ print subscr
+
+ hlr.execute("""UPDATE Subscriber SET authorized = 0, extension=NULL \
+ WHERE extension = "%s"
+ """ % (str(exten)));
+ hlr.execute("""UPDATE Subscriber SET authorized = 1,extension="%s" \
+ WHERE id = %u
+ """ % (str(exten), subscr['id']) );
+
+hlr.close()