Commit Graph

5594 Commits

Author SHA1 Message Date
Harald Welte 4724f99d19 Implementation of GSM12.21 LOAD SOFTWARE (BS11 dialect thereof) 2009-01-18 18:01:49 +00:00
Harald Welte 978cb42911 add BTS TYPE field to facilitate future non-BS11 BTS support 2009-01-18 17:57:27 +00:00
Harald Welte 85770c7aa4 * use #define for number of TS in one TRX
* use data structure to indicate E1 timeslot/subslot for every TRX:TS
2009-01-18 17:47:32 +00:00
Harald Welte 6f676a3541 abis_nm: use correct length in 08.59 OML header for all messages 2009-01-18 14:27:48 +00:00
Harald Welte 1bc0906436 abis_nm: more BS11 specific messages for configuration 2009-01-18 14:17:52 +00:00
Harald Welte 05188ee7a7 * prefix all BS11 specific OML functions with proper name
* add more BS11 specific OML commands (TRX power, logon, OML TEI, ...)
2009-01-18 11:39:08 +00:00
Harald Welte adaf08bec8 add some more BS11 specific OML definitions 2009-01-18 11:08:10 +00:00
Harald Welte d08de2f9e4 fix typo 2009-01-11 04:38:55 +00:00
Harald Welte 9bb7c70016 If there is already a subscriber and it does not equal to us -> moan
And unreference the gsm_subscriber object otherwise we would leak.
2009-01-10 03:21:41 +00:00
Harald Welte 4ed0e92464 Make mi_to_string parse the TMSI we generate, finish CM Service Request implementation
The TMSI encoding is up to us but generate_mid_from_tmsi and mi_to_string
did not agree on the encoding. Adjust mi_to_string to properly decode the
TMSI generated by generate_mid_from_tmsi. Check that the four bits are '1111'
and that the length is five. Memcpy the bytes to tmsi (to work with ARM or such)
and convert the number to host order...

Implement the CM Service Request. Try to get the subscriber from the TMSI and
assign it to the gsm_lchan. There is a small issue that will be fixed in the
next commit.

(done by z.)
2009-01-10 03:17:30 +00:00
Harald Welte ba4cf164b0 Start working on CM Service Request
Be able to send Accept/Reject the Service Request. Use mi_string
instead of the the msgb buffer (even if it is memsetted and such)...

The TMSI allocation seems to be a bit problematic and needs some
further checking. The rough idea is that we try to find the subscriber
for a CM Service Request and then decide based on the subscriber
if we want to handle the call.
2009-01-10 01:49:35 +00:00
Harald Welte c627afceaa Reset the use_count to zero in chan_free
It is possible that the BTS is closing the channel even when
our upper layers are doing work. Reset the use_count add a fixme
to call cancellations for pending operations. Cancellation of the
call state (state machines in general) and such come into mind...
2009-01-09 21:39:17 +00:00
Harald Welte 498b0bbd9b Use use_lchan/put_lchan for call handling to keep the channel up
Increase when the refcount of the lchan when we initiate a call,
get a SETUP message and put it when we want to release the call...

Once we have proper Q.931 support the use/put needs to be improved,
e.g. we currently do not allow to hangup from the network, and it
will ring until the end of time...
2009-01-09 21:27:43 +00:00
Harald Welte 626fe9c42b Print the refcount of the lchan as well 2009-01-09 21:24:53 +00:00
Harald Welte 2f1311b90e [paging] Page pagegroup one...
Currently we get OVERLOAD (8.6.3 of 08.58) and no CCCH LOAD INDICATION...
we will have to handle the OVERLOAD somehow...
2009-01-06 23:50:39 +00:00
Harald Welte 38c2f13098 Hook the paging code into bsc_hack.c and telnet_interface.c
Wrote and test code to add and remove paging requests... This
will be using the fact that the linux list is building a circle
on each tick we can send one/x paging requests and continue round
robin...
2009-01-06 23:10:57 +00:00
Harald Welte b68899d3e3 Start creating a paging layer...
You can request to open a channel to a MS and the paging layer
will call you once the channel is allocated. Internally the CCCH
Load Indication will be handled and retry to page a terminal.
2009-01-06 21:47:18 +00:00
Harald Welte 69b2af293e Handle TMSI reallocation complete by printing the subscriber
It looks like that certain phones that send their old TMSI from
a different network and we assign them a new one with LOCATION
UPDATING ACCEPT will send us a TMSI Reallocation Complete. Print out
the the imsi.
2009-01-06 19:47:00 +00:00
Harald Welte 9898188ca7 Allow to set a different ARFCN
Add the -f option to use a different channel. This is done
by patching the various tables before the OML and RSL is brought
up. It looks like it is working...


Patch by Harald, moving of the patch_tables invocation by zecke
2009-01-06 18:59:11 +00:00
Harald Welte 8965da4fde Tabs no Spaces... at least here 2009-01-06 18:09:02 +00:00
Harald Welte ce281c0772 add initializer function for subchan_demux 2009-01-05 20:14:14 +00:00
Harald Welte 418f5a4e25 * add function to change c-bits in TRAU frame from uplink to downlink
* add function to re-encode an exploded TRAU frame into a bit-per-byte stream
2009-01-05 20:12:47 +00:00
Harald Welte 38e04372e5 handle IDLE speech frames in trau_frame code 2009-01-05 19:42:46 +00:00
Harald Welte 196a366e30 make sure we build (even if not use) subchan_demux and trau_frame code 2009-01-05 19:01:56 +00:00
Harald Welte 2a8ee52ced add (untested) TRAU frame decoder with support for FR/EFR and AMR 2009-01-05 19:01:01 +00:00
Harald Welte 54bd94d8b7 add (untested) 16kbit E1 sub-channel demux with TRAU frame sync 2009-01-05 19:00:01 +00:00
Holger Freyther ca362a6028 Make gcc happy and remove a couple of warnings
Remove the callbacks from gsm_network for now. A set of different
callbacks will be back. E.g. when the paging is completed, when the
Q.931 like call handling is there...

Remove var's or move them into #if 0, remove unused stuff that looks
like we do not need it anytime soon or #if 0 them, move stuff around.
2009-01-04 21:05:01 +00:00
Holger Freyther 7448a53ddb Be able to initiate paging from the telnet interface
The actual paging by subscriber needs to be implemented
2009-01-04 20:18:23 +00:00
Holger Freyther 4c8f114976 Fix warning 2009-01-04 20:17:07 +00:00
Holger Freyther a553d098e7 Export the gsm0411 alloc and send function 2009-01-04 20:16:25 +00:00
Holger Freyther 5e76ce61ac Some simple size check. We would not overflow but would send garbage
Check the size
2009-01-04 20:15:12 +00:00
Harald Welte ca64da984b make use of new functions to print string chreq reason and lchan type 2009-01-04 16:54:12 +00:00
Harald Welte d4fc1b29ca use get_[lp]chan_name() functions for telnet interface 2009-01-04 16:11:31 +00:00
Harald Welte a72c98eb2f functions to convert lchan/pchan type into human-readable string 2009-01-04 16:10:38 +00:00
Harald Welte 47d88aecaf Add some functions to CREATE OBJECTs in the BS-11 internal database 2009-01-04 12:02:08 +00:00
Holger Freyther 868b8cdd58 Implement sending custm GSM 04.08 commands
First you would page the IMSI and then send GSM 04.08
commands to the MS. This should help when testing new
commands
2009-01-04 03:57:27 +00:00
Holger Freyther 3e2c32322e Make gsm48_sendmsg public as well 2009-01-04 03:55:31 +00:00
Holger Freyther 819dd205a9 Make gsm48_msgb_alloc public and usable for the telnet_interface 2009-01-04 03:52:50 +00:00
Holger Freyther 3ae8fd2acb Implement the call command...
Passing of an origin is missing this will need work in
gsm_04_08.
2009-01-04 03:50:40 +00:00
Holger Freyther f87573dc4e Implement put_channel/get_channel, save on which bts we currently operate
Allow to change the refcount for a given channel. Store which
bts is our primary bts. A command to switch the primary bts will
be added as well. This makes entering and parsing of commands more
easy.
2009-01-04 03:49:41 +00:00
Holger Freyther d0e38c3cad Add implementation to find a lchan by the struct gsm_subscriber
Really compare pointers to check if the one gsm_subscriber
is equal to the other... gsm_subscriber should be unique for
a given IMSI so comparing the pointers should be fine.
2009-01-04 03:48:30 +00:00
Holger Freyther a471a41680 Define the gsm_subscriber getter functions in the header 2009-01-04 03:47:05 +00:00
Holger Freyther ae61cae9b2 Add a show command to list the channel allocation
Example output

show
BTS #0 on link 0  LOC: 1 TRX: 1 CCCH0: arfcn:123,#0
  TRX: 0 ARFCN: 123
     TS: #0 pchan: 2 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #1 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #2 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #3 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #4 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #5 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #6 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #7 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
2009-01-04 03:46:01 +00:00
Holger Freyther 5f234e4f3a Add test case that is not registering the timer again
yesterday's crash with the llist_del instead of using del_timer
was due this kind of bug. Add a test case.
2009-01-04 03:45:13 +00:00
Harald Welte 4668fdaa26 define and use enum values for BS11 (or Siemens?) specific OML message types 2009-01-03 08:19:29 +00:00
Harald Welte 227d4073fb use NM_MT_* enum instead of hard-coded values 2009-01-03 08:16:25 +00:00
Holger Freyther 52aab5445d Make wireshark happy.
Removing the P Bit from the fake LAPD frame will make wireshark
run the data through the GSM RSL dissector with the right SAPI
and LAPD preference setting.
2009-01-03 05:49:22 +00:00
Holger Freyther 460af8b794 Clean up struct gsm_network and remove the gsm_subscriber 2009-01-03 05:48:32 +00:00
Harald Welte 1272aab1cd Go through del_timer otherwise in_list will not be reset leading to crashes... 2009-01-03 04:39:51 +00:00
Harald Welte 599639eaf9 Readd the dummy lapd header... this gives valid TEI/SAPI information
Besides that the header is spoofed, we lose the information about
the channel (we will have to add our own encap type)
2009-01-03 03:28:10 +00:00