Project

General

Profile

OsmoNITB » History » Version 22

fixeria, 08/05/2018 04:33 PM

1 22 fixeria
h1. OsmoNiTB
2 21 laforge
3 22 fixeria
{{include(cellular-infrastructure:MacroLegacy)}}
4 15 laforge
5 17 laforge
{{>toc}}
6 1 zecke
7 17 laforge
[[OsmoNITB:]] (formerly called _bsc_hack_) is the name of [[OpenBSC:]] in NITB (network in the box) mode.
8 1 zecke
9 18 laforge
See [[OpenBSC:OpenBSC#Configurations-Modes|OpenBSC Configurations and Modes]] to understand the difference between [[OsmoNITB:]] and [[OsmoBSC:]] mode.
10 1 zecke
11 20 laforge
{{include(cellular-infrastructure:MacroBinaryPackages)}}
12
13 17 laforge
h2. Manuals
14 1 zecke
15 17 laforge
* User Manual: http://ftp.osmocom.org/docs/latest/osmonitb-usermanual.pdf
16
* VTY Reference: http://ftp.osmocom.org/docs/latest/osmonitb-vty-reference.pdf
17
18 1 zecke
h2. Configuration
19
20
21 17 laforge
[[OsmoNITB:]] has a configuration file.  The default config file name is @openbsc.cfg@ in the current working directory of the osmo-nitb process.
22 15 laforge
23
You can specify an alternate config file location by using the @--config-file@ command line argument.
24 1 zecke
25 17 laforge
For more information, please see the User manual linked above.
26 15 laforge
27
28 1 zecke
h2. Dealing with the HLR
29 4 laforge
30 17 laforge
We currently use a quite simple sqlite3 database for the HLR.  In fact, it is more than just a HLR, since it actually stores entries even about any subscriber or phone that tries to log into your network.
31 1 zecke
32 17 laforge
We obtain the IMSI and IMEI of every LOCATION UPDATING REQUEST, and then if neccessary create a new entry for the equipment as well as the subscribers in the respective tables.
33 1 zecke
34 4 laforge
The schama looks like:
35 15 laforge
<pre>
36 1 zecke
CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT);
37 15 laforge
CREATE TABLE [[EquipmentWatch]] (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, subscriber_id NUMERIC NOT NULL, equipment_id NUMERIC NOT NULL, UNIQUE (subscriber_id, equipment_id) );
38 1 zecke
CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL);
39
CREATE TABLE Subscriber (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imsi NUMERIC UNIQUE NOT NULL, name TEXT, extension TEXT UNIQUE, authorized INTEGER NOT NULL DEFAULT 0, tmsi TEXT UNIQUE, lac INTEGER NOT NULL DEFAULT 0);
40 15 laforge
</pre>
41 1 zecke
42 12 laforge
If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT.  Otherwise, we send
43 15 laforge
a regular LOCATION UPDATING REJECT to refuse the mobile to roam to our network.  You can change the reject cause using _--reject-cause_.
44 12 laforge
45 1 zecke
You can allow everyone to join your network by using the _auth policy accept_ config file option.
46 15 laforge
47
48
h3. HLR modification using the telnet interface
49 1 zecke
50
51 15 laforge
You can telnet to port 4242 of the machine that runs osmo-nitb and try some of the commands, e.g. for dealing with subscribers.
52 12 laforge
53 1 zecke
Then you can type statements like
54
55 15 laforge
<pre>
56 1 zecke
subscriber imsi 012340123456789 authorized 1
57 15 laforge
</pre>
58 1 zecke
 which will enable this subscriber to enter the network
59
60 15 laforge
<pre>
61 12 laforge
subscriber imsi 012340123456789 extension 5555
62 15 laforge
</pre>
63 1 zecke
 which will assign the telephone number 5555 to the subscriber with the specified IMSI
64
65 15 laforge
<pre>
66 1 zecke
subscriber imsi 012340123456789 name Peter
67 15 laforge
</pre>
68
 which will associate the name _Peter_ with the subscriber record
69 1 zecke
70 15 laforge
<pre>
71 1 zecke
show subscriber imsi 012340123456789
72 15 laforge
</pre>
73 1 zecke
 which will show you all information about the respective subscriber
74
75 15 laforge
<pre>
76 19 wirelesss
 subscriber imsi 012340123456789 sms sender imsi 987654321043210 send test123 
77 15 laforge
</pre>
78
 which will send a SMS with the content _test123_ to the respective subscriber
79 1 zecke
80 12 laforge
81 15 laforge
h3. Raw SQL access
82
83
84 1 zecke
Instead of the manual commands on the VTY, you can also directly access the underlying HLR SQL database table.
85 12 laforge
86
87 15 laforge
h4. Authorizing a particular IMSI
88
89
90 12 laforge
To authorize your mobile station you will need to execute the following comand:
91
92 15 laforge
<pre>
93 12 laforge
$ sqlite3 hlr.sqlite
94
update Subscriber set authorized=1 where imsi=YOUR_IMSI;
95 15 laforge
</pre>
96 12 laforge
97
98 15 laforge
h4. Assigning an extension number IMSI
99
100
101 5 laforge
In order to call a phone, you need to assign an extension number (phone number) for the IMSI.
102
103 15 laforge
In the following example, we assign the extension number _4444_:
104 7 laforge
105 15 laforge
<pre>
106 7 laforge
$ sqlite3 hlr.sqlite
107 12 laforge
update Subscriber set extension=4444 where imsi=YOUR_IMSI;
108 15 laforge
</pre>
109 7 laforge
110
111 15 laforge
h4. finding IMEIs for a given IMSI
112
113
114
<pre>
115 1 zecke
$ sqlite3 hlr.sqlite
116
select equipment.imei from equipment,equipmentwatch,subscriber where equipmentwatch.equipment_id=equipment.id and subscriber.id=equipmentwatch.subscriber_id and subscriber.imsi=YOUR_IMSI;
117 15 laforge
</pre>
118 13 ipse
119
120
h4. List IMSI to extensions mapping
121 15 laforge
122 13 ipse
123 1 zecke
<pre>
124 15 laforge
sqlite3 -line hlr.sqlite3 'select imsi,extension from subscriber;'
125
</pre>
126 1 zecke
127 15 laforge
128
h2. Common Problems
129
130
131
132
h3. Failed to init database
133
134
135
<pre>
136 8 laforge
$ ./osmo-nitb
137
DB: Failed to create connection.
138
DB: Failed to init database. Please check the option settings.
139 15 laforge
</pre>
140 8 laforge
141 9 laforge
This is most likely caused by one of the following problems
142 15 laforge
* the sqlite3 backend for DBD (dbd-sqlite3) has not been installed
143
* osmo-nitb does not have write permissions to the local directory
Add picture from clipboard (Maximum size: 48.8 MB)