Commit Graph

47 Commits

Author SHA1 Message Date
Harald Welte bf5e8df424 cosmetic fixes / more comments 2009-02-03 12:59:45 +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 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 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
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 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 67b4b9a017 Do not call rsl_chan_release directly but use the use_count of the lchan
Call use_lchan early in allocate_loc_updating_req, do not directly call
rsl_chan_release but go through channel alloc to take the use_count into
account.
2009-01-01 03:46:11 +00:00
Holger Freyther 3eaa792b21 Speculative fix for not sending LOCATION UPDATING REJECT
As reported by the operator the rejecting didn't work after the
first fix (wrong logic/missing negation). The hypothesis is that
that the lchan was released before the reject timeout was fired.

Fix it by getting a reference on the lchan when allocating a
logical operation and release the reference when the operation
is finished or timed out.
2009-01-01 02:59:03 +00:00
Harald Welte e872cb1221 get rid of some more gcc warnings 2009-01-01 00:33:37 +00:00
Harald Welte 179f064cbe * fix check for null-pointer in release_loc_updating_req()
* fix endianness of operator name
2008-12-31 23:59:18 +00:00
Holger Freyther 73487a23da Introduce logical updating request operation on the gsm_lchan
We are going to have logical operations like Phone Call, SMS,
Paging, Updating Request on a logical channel and for each of
these operations we might need to store state. For now pointers
in gsm_lchan look like the best way of doing this and we start
by introducing an operation for the location updating request.

The new flow of things are:
    - We get the location updating request and update/create
      the subscriber and maybe send the identity requests to
      the mobile station
    - We start the updating timer, if it times out we will
      reject the mobile station.
    - Once we get the Identity Responses we have asked for
      and the reject timer did not fire yet we might accept
      the user.
2008-12-31 18:53:57 +00:00
Holger Freyther e97f7fba97 Add an option to set the global reject cause
This will need to be moved into bsc_hack.c together with the
policy to accept/reject a UPDATING LOCATION REQUEST.
2008-12-31 18:52:11 +00:00
Holger Freyther 1bc7de50be Fix the compile the timer got renamed 2008-12-31 18:50:58 +00:00
Holger Freyther c6ea9dbeba Recylce a gsm_lchan when the refcount drops to zero
When a channel is allocated, start a timeout, when a lchan_use
is used the timer will be restarted, when the timeout fires
we will try to recycle or restart the timer.
2008-12-30 19:18:21 +00:00
Holger Freyther ea889020e2 Fix indenting... use tabs here 2008-12-30 19:10:47 +00:00
Harald Welte db253af1aa * fix IMSI parsing of last two digits
* add MM INFO packet support and send it after LOCATION ACCEPT
* send 'ALL YOUR BASE ARE BELONG TO US'
2008-12-30 17:56:55 +00:00
Holger Freyther 89824fc466 Add an option to allow everyone to the network.
This should move out of gsm_04_08 and the accept, reject
policy should be controllable by the higher levels.
2008-12-30 16:18:18 +00:00
Holger Freyther eab55416f8 Fix regression and send the accept message again
I removed gsm48_sendmsg(msg) when removing the send_sms from the
_acc method. This is obviously wrong. Fix the regression, spotted
while testing with LaF0rge. This regression was introduced in r120.
2008-12-30 16:18:15 +00:00
Holger Freyther 429e77612a Fix documentation so one is finding it in GSM04.08
UPDATE => UPDATING
2008-12-30 13:28:30 +00:00
Holger Freyther b7193e4e94 Introduce new callbacks, remember that we have LOC UPD REQ, reject things only once
gsm_data.h add new callbacks, add some parameters, update bsc_hack and
other call sites.

Remember that we need to ACCEPT/REJECT the LOCATION UPDATE REQUEST and
then send the ACCEPT or schedule the sending of the reject. Currently
it is possible that for a new subscriber that we do not have a !subscbr
yet, we will trigger an IDENTITY REQUEST and schedule the reject timer.
This may lead to rejecting AND accepting (a new subscriber). This issue
is triggered when allowing everyone to connect to the network.
2008-12-29 17:44:08 +00:00
Daniel Willmann fad5d0db83 Regenerate a valid TPDU and send it at first registration 2008-12-29 16:04:14 +00:00
Holger Freyther 2eafef599c Up on call released release the channel and take the next item
Once a call is released, release the gsm_lchan and move to the
next item in pending_stations or wait for more work.
2008-12-29 06:42:17 +00:00
Holger Freyther 07cc8d8bee Improve page command handling in the bsc_hack
Add a callback to the gsm_network. When updating the location and
assigning a new tmsi callback into the bsc_hack.c and have a queue
of mobile stations to page, allocate a channel for and ultimately
dial.
2008-12-29 06:23:46 +00:00
Holger Freyther ba4d28a36e [gsm_04_08] Do not automatically initiate a call
Do not automatically dial but release the channel immediately. The
idea is that this was the paging command will be handled by the mobile
station.
2008-12-29 06:23:44 +00:00
Daniel Willmann 6fe997e9dd Implement sending SMS and send one on network registration 2008-12-29 04:20:41 +00:00
Harald Welte e14a57cc0e Create request channel reason to see channel requests originating from PAG 2008-12-29 04:08:28 +00:00
Harald Welte 65e74ccb04 disable paging, send SETUP after LOCATION UPDATE ACCEPT 2008-12-29 01:55:35 +00:00
Harald Welte 6f4b753000 turn gsm_cc_tx_simple into gsm_tx_simple 2008-12-29 00:39:37 +00:00
Holger Freyther 177466199f [gsm0408] Make the generate_lai usable by other code
Prefix generate_lai with gsm0408 and update call sites. It will
be used from within bsc_hack.c
2008-12-28 16:32:44 +00:00
Harald Welte 255539c742 working state up to location update and classmark inquiry 2008-12-28 02:26:27 +00:00
Daniel Willmann 8b3390effd Start implementing GSM 04.11 (short message service) 2008-12-28 00:31:09 +00:00
Harald Welte 1a4121882e fix TMSI length in Mobile Identity IE of LOCATION UPDATE ACCEPT 2008-12-27 22:13:43 +00:00
Harald Welte bcae43fe1b SMS stub 2008-12-27 21:45:37 +00:00
Harald Welte 75a983fab0 * add database handling
* fix IMSI handling
2008-12-27 21:34:06 +00:00
Harald Welte 10b487b1c0 * fix location update reject (actually reject, not accept) 2008-12-27 19:53:37 +00:00
Harald Welte 98243f8e48 * release channel after LOCATION UPDATE REJECT 2008-12-27 19:46:41 +00:00
Harald Welte 4bc90a160a add minimal MO call state transitions 2008-12-27 16:32:52 +00:00
Harald Welte 6125306e73 fix typo 2008-12-27 11:25:50 +00:00
Harald Welte 231ad4f9c1 Send IDENTITY REQUEST after LOCATION UPDATE REQUEST 2008-12-27 11:15:38 +00:00
Harald Welte fc977a8b8b * translate MOBILE IDENTITY into string
* add empty handler for GPRS SUSPENSION REQUEST
2008-12-27 10:19:37 +00:00
Harald Welte 4b634544e6 now we get up to the SETUP of MO calls 2008-12-27 01:55:51 +00:00
Harald Welte 702d8707a9 working state up to location update and classmark inquiry 2008-12-26 20:25:35 +00:00
Harald Welte 8470bf200d no reasonable commit message possible. tons of changes of the last 2 days 2008-12-25 23:28:35 +00:00
Harald Welte 52b1f98889 initial commit of current OpenBSC state 2008-12-23 20:25:15 +00:00