IMPORTANT NOTICE: This page contains information about a legacy version of the Osmocom software. This legacy version is no longer maintained. If you use it, don't be surprised if it doesn't work. It was your choice to ignore man-years worth of developments, improvements and fixes. Please migrate to the active/supported software (Osmocom CNI, consisting of OsmoBSC, OsmoMSC, OsmoHLR, OsmoSTP, OsmoMGW - a NITB style setup is described at Osmocom_Network_In_The_Box).
- Table of contents
Osmocom provides binary packages for several flavors of Debian and Ubuntu GNU/Linux on a variety of architectures (i586, x86_64, armhf, armv7l). Unless you are a software developer interested in developing on Osmocom, it is recommended you use those packages instead of building from source.
For more details see Binary_Packages
- User Manual: http://ftp.osmocom.org/docs/latest/osmonitb-usermanual.pdf
- VTY Reference: http://ftp.osmocom.org/docs/latest/osmonitb-vty-reference.pdf
OsmoNITB has a configuration file. The default config file name is
openbsc.cfg in the current working directory of the osmo-nitb process.
You can specify an alternate config file location by using the
--config-file command line argument.
For more information, please see the User manual linked above.
Dealing with the HLR¶
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.
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.
The schama looks like:
CREATE TABLE Equipment (id INTEGER PRIMARY KEY AUTOINCREMENT, created TIMESTAMP NOT NULL, updated TIMESTAMP NOT NULL, imei NUMERIC UNIQUE NOT NULL, name TEXT); 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) ); CREATE TABLE Meta (id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT UNIQUE NOT NULL, value TEXT NOT NULL); 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);
If the subscrber.authorized field is set to '1', then we allocate a TMSI and answer with LOCATION UPDATING ACCEPT. Otherwise, we send
a regular LOCATION UPDATING REJECT to refuse the mobile to roam to our network. You can change the reject cause using --reject-cause.
You can allow everyone to join your network by using the auth policy accept config file option.
HLR modification using the telnet interface¶
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.
Then you can type statements like
subscriber imsi 012340123456789 authorized 1
which will enable this subscriber to enter the network
subscriber imsi 012340123456789 extension 5555
which will assign the telephone number 5555 to the subscriber with the specified IMSI
subscriber imsi 012340123456789 name Peter
which will associate the name Peter with the subscriber record
show subscriber imsi 012340123456789
which will show you all information about the respective subscriber
subscriber imsi 012340123456789 sms sender imsi 987654321043210 send test123
which will send a SMS with the content test123 to the respective subscriber
Raw SQL access¶
Instead of the manual commands on the VTY, you can also directly access the underlying HLR SQL database table.
Authorizing a particular IMSI¶
To authorize your mobile station you will need to execute the following comand:
$ sqlite3 hlr.sqlite update Subscriber set authorized=1 where imsi=YOUR_IMSI;
Assigning an extension number IMSI¶
In order to call a phone, you need to assign an extension number (phone number) for the IMSI.
In the following example, we assign the extension number 4444:
$ sqlite3 hlr.sqlite update Subscriber set extension=4444 where imsi=YOUR_IMSI;
finding IMEIs for a given IMSI¶
$ sqlite3 hlr.sqlite select equipment.imei from equipment,equipmentwatch,subscriber where equipmentwatch.equipment_id=equipment.id and subscriber.id=equipmentwatch.subscriber_id and subscriber.imsi=YOUR_IMSI;
List IMSI to extensions mapping¶
sqlite3 -line hlr.sqlite3 'select imsi,extension from subscriber;'
Failed to init database¶
$ ./osmo-nitb DB: Failed to create connection. DB: Failed to init database. Please check the option settings.This is most likely caused by one of the following problems
- the sqlite3 backend for DBD (dbd-sqlite3) has not been installed
- osmo-nitb does not have write permissions to the local directory