aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_subscriber.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-04cosmetic: move subscr_conn alloc&free to gsm_04_08.cNeels Hofmeyr1-27/+0
Subscriber conn stuff doesn't really belong in gsm_subscriber.c. (I moved because I thought it would call some static functions in gsm_04_08.c, which ended up not being the case; anyway, it makes more sense to stay in gsm_04_08.c.)
2016-05-04msc subscr: add paging timeoutNeels Hofmeyr1-0/+28
In NITB, the paging timeout would be handled from the BSC side. In IuCS, we need to invalidate the paging request from libmsc alone, so add a paging timer to gsm_subscriber. Possibly, the HNB-GW should respond with a paging failure and libmsc could trigger on that, nevertheless libmsc should not rely on a failure message to expire pending pagings.
2016-05-04subscr_paging_dispatch(): add assertionsNeels Hofmeyr1-0/+5
Make sure that subscr and conn are valid: * a subscr must always be present. * on success, a conn must be present and the subscr must match the conn's subscr. Also check the hooknum.
2016-05-04comment tweakNeels Hofmeyr1-1/+1
2016-05-04debug log tweaks for pagingNeels Hofmeyr1-2/+3
2016-05-04Revert "subscr_paging_dispatch(): use conn->subscr instead of separate param"Neels Hofmeyr1-3/+3
This reverts commit 6f4e83beb05b7e4fd615504a7bf6a71afe15064d, but note: this is not a 1:1 revert since the subscr_paging_sec_cb() semantics have changed. In subscr_paging_dispatch(), the separate subscr parameter is needed in cases where paging expired and there is no conn available. For subscr_paging_sec_cb(), a conn must always be available. Hence it avoids any duplicity by only passing the conn and deriving the subscr from that. Callers of subscr_paging_sec_cb() pass NULL as param, so pass conn->subscr when calling subscr_paging_dispatch() from subscr_paging_sec_cb().
2016-05-02comments and debug log for paging responseNeels Hofmeyr1-1/+18
2016-05-02msc_paging_request(): remove unused parametersNeels Hofmeyr1-4/+2
The network is known from subscr; the type is not applicable after MSCSPLIT; cbfn and data are obsoleted by explicit subscr_rx_paging_response().
2016-05-02msc_paging_request(): make staticNeels Hofmeyr1-1/+1
it is never called outside of gsm_subscriber.c
2016-05-02paging: actually verify subscriber authorizationNeels Hofmeyr1-1/+8
Before this, any paging response would be accepted by the CN, without checking the database whether the subscriber is in fact authorized. The probability that a subscriber would be able to take unauthorized action is slim, nevertheless checking authorization status with the database should happen before we accept a connection.
2016-05-02paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr1-10/+5
Remove one layer of callback indirection in paging. When a paging response arrives, we always want to first secure the connection, thus a fixed subscr_rx_paging_response() function is more appropriate and avoids having to store a cbfn. The actual actions to be taken upon successful paging are of course still in callback functions stored with each subscriber.
2016-05-02Allow paging even though is_paging is falseNeels Hofmeyr1-2/+5
It doesn't really hurt to see whether we have paging responses queued for a given subscriber. Possibly a subscriber replied with a paging response later than we assumed the paging to be valid.
2016-05-02cosmetic: subscr_paging_dispatch() comments/indentNeels Hofmeyr1-9/+0
2016-05-02subscr_paging_dispatch(): use conn->subscr instead of separate paramNeels Hofmeyr1-3/+3
2016-05-02cosmetic: subscr_paging_dispatch() comments/indentNeels Hofmeyr1-7/+2
2016-05-02gsm_04_08 mscsplit: subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr1-2/+2
Rename subscr_request_channel() to _conn() and remove the channel_type arg. The "channel" is a term from closely tied MSC+BSC code, after separation we shall call it a "connection", i.e. over IuCS or A. The channel_type arg is already unused from a previous MSCSPLIT commit.
2016-05-02gsm_04_08: factor out subscr authorization checkNeels Hofmeyr1-0/+27
Add function subscr_authorized(), absorbing the guts of static authorize_subscriber() from gsm_04_08.c, except the parts specific to Location Updating. subscr_authorized() is a check that is to be added to validation of a paging response.
2016-04-25paging_signal_data: remove unused lac memberNeels Hofmeyr1-1/+0
2016-04-20add preliminary paging response handling, incompleteNeels Hofmeyr1-14/+0
In gsm_04_08.c, add a static handle_paging_resp() to take over from the libbsc function gsm48_handle_paging_resp(). Use the subscr->requests listing to handle a Paging Response and call the pending cbfn. In NITB, this used to be done via BTS, and I haven't entirely resolved yet how exactly to rewire this in standalone libmsc. So far, this "works for me", but is worth another visit. Still missing: enable Integrity Protection.
2016-04-20cosmetic: debug and error logging, comment tweaksNeels Hofmeyr1-1/+7
2016-04-20Add Iu pagingNeels Hofmeyr1-3/+10
Add iu_page_cs() and iu_page_ps() API, also add to libiudummy for linking in tests. Implement msc_paging_request() by calling iu_page_cs().
2016-03-15cosmetic: commentsNeels Hofmeyr1-1/+1
2016-03-14cosmeticNeels Hofmeyr1-1/+0
2016-03-04libmsc: stubify paging (A-/Iu-interfaces need to reimplement this)Neels Hofmeyr1-2/+12
2016-03-04gsm_subscriber_connection: further split between BSC and MSCNeels Hofmeyr1-0/+28
Move some Iu/A members into the MSC #ifdef. Have separate allocate and free functions for the two scopes.
2016-03-03mscsplit: remove bts and lchan pointers from libmscNeels Hofmeyr1-11/+11
The diff between this and master will probably need a lot of review and fixes. The current state does compile, but I expect pretty much everything to be broken now. Future development will reinstate proper functionality piecemeal. The first goal is to get basic signalling to work, then SMS. The voice control (RTP) is completely disabled now (see "#if BEFORE_MSCSPLIT") and will be fixed last AFAICT.
2015-08-08subscr: Fix potential subscr ref count issueHolger Hans Peter Freyther1-0/+1
In case the subscriber is currently busy we would omit the subscr_put. This seems to be very hard to hit as the subscr need to be active and at the same time be selected for the purge operation.
2015-08-03paging: Forget we were paging after the dispatchHolger Hans Peter Freyther1-1/+1
So in case somebody is starting paging from within a paging expired callback we would dispatch the paging request right away with the same failure.
2015-08-03paging: Stop paging everywhere before dispatching any signalHolger Hans Peter Freyther1-9/+9
2015-04-29sub: Remove the queue from the subscriber codeHolger Hans Peter Freyther1-114/+40
The idea of "subscriber_get_channel" was that different requests would be coordinated. At the same time we have seen that the "queue" can get stuck at both 31C3 and the rhizomatica installations. Voice calls and SMS do not need coordination. We should be able to send SMS on a voice channel and switch the MS from a SDCCH to a TCH in case we establish a voice call. The SMS code itself needs to coordinate to obey the limit of one SMS per direction but this should be enforced in the sms layer and not on the subscriber. Modify the code to have a simple paging coordination. The subscriber code will schedule the paging and register who would like to know about success/failure. This allowed to greatly simplify the paging response handling for the transaction code (and in fact we could move the transaction list into the subscriber structure now). The code gained to support to cancel the notification of a request (but not the paging itself yet). TODO: Cancel paging request in case no one cares about it anymore.
2015-04-29sub: Remove introspection of the "channel queue"Holger Hans Peter Freyther1-45/+0
Over the next commits the queuing of commits will be completely modified to remove the queue and move the scheduling/limits to the outer callers.
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-17/+18
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-4/+21
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-07-27expiration: Allow to disable the periodic location updating procedureHolger Hans Peter Freyther1-6/+7
Disable the periodic LU using "no periodic location update" VTY command. In that case set the expire_lu to 0 which will then be translated to a NULL in the database layer. This leads to a bit of copy and paste in the db_sync_subscriber method but I don't see how we could easily use 'datetime(%i, 'unixepoch')' and 'NULL' at the same time. Change the query to find expired queries to check for NOT NULL and the time being in the past. This means if there are still old subscribers in the database they might not be expired. One would need to execute a query like "UPATE Subscriber SET expire_lu = 0 WHERE expire_lu is null". The same applies when disabling the periodic LU. One would need to update the database by hand. Manual tests executed/passed: 1.) periodic LU enabled: * use gst LUTest.st to do a LU * UPDATE Subscriber SET expire_lu=datetime('now'); * observe the subscriber being expired (it was) 2.) periodic LU disabled: * use gst LUTest.st to do a LU * verify that the expire_lu is NULL in the database
2013-07-27expiration: Speculative fixes for the periodic expiring handlingHolger Hans Peter Freyther1-16/+42
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
2013-07-04gsm_subscriber: Fix compiler warning of the printf stringHolger Hans Peter Freyther1-1/+1
This fixes both a GCC and a Coverity warning: GCC: gsm_subscriber.c: In function ‘subscr_expire_callback’: gsm_subscriber.c:389:2: warning: format ‘%i’ expects argument of type ‘int’, but argument 8 has type ‘long long unsigned int’ [-Wformat] Coverity: CID 1040712
2013-01-01libmsc: Track and update the location update expiryJan Luebbe1-0/+35
Set the subscriber expiry timeout to twice the duration of the location update period and provide functions subscr_expire() and db_subscriber_expire() to mark subscribers offline that have missed two location update periods. This patch increases the DB revision to 3, so the hlr will be incompatible with prior versions. We should allow 0 for T3212 as well to disable the location update period. In that case we will need a way to indicate that in the database.
2012-12-25gsm_subscriber: change subscr_bsc_active_subscriber to pluralJan Luebbe1-5/+5
This was requested by Holger Freyther <zecke@selfish.org>.
2011-05-06src: use namespace prefix osmo_signal*Pablo Neira Ayuso1-3/+3
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-1/+1
This was done with sed on the files.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-1/+1
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-0/+410
... and make sure tests work again after restructuring