aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_subscriber.h
AgeCommit message (Collapse)AuthorFilesLines
2017-03-16paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr1-0/+2
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. Remove paging_request_stop() call from subscr_paging_dispatch(), which stops paging on all BTSs, which is not the responsibility of libmsc. Change-Id: Ic2c785c9cc48b2c2c6557cbe1060d25afa89e38d
2017-03-16subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr1-3/+4
Change-Id: Ife8e10b240693a8d369139881774f1892044aa65
2017-03-16move subscr_request to gsm_subscriber.hNeels Hofmeyr1-2/+14
Change-Id: Idbbd39b0e068da17aafa97e315143509c69c50ea
2017-03-16gsm_04_08, gsm_subscriber: decouple lac from btsNeels Hofmeyr1-1/+1
The idea is to not have a direct pointer to a bts struct (into BSC land), but a LAC to resolve the BSC or RNC depending on the appropriate A or IuCS interface. subscr_update(): remove bts arg, add lac arg. Pass conn->lac to gsm48_generate_lai() instead of bts->location_area_code. Change-Id: I9f2b298a785bf4b2a1b3fcdd91b8256106b2d9de
2017-03-16Use libvlr in libmsc (large refactoring)Neels Hofmeyr1-86/+6
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
2017-02-25add struct gprs_subscr, separating gprs from gsm_subscriberNeels Hofmeyr1-1/+0
Prepare for replacing gsm_subscriber with vlr_subscriber. vlr_subscriber will not make sense to be used in gprs, so have a dedicated GPRS subscriber struct. (Could change if the gprs code were to use libvlr; is currently independent). Related: OS#1592 Change-Id: Ia8b391ee009c8545763cba04505be3947835120e
2016-09-18properly #include <openbsc/gsm_data.h> from gsm_subscriber.hNeels Hofmeyr1-2/+3
Don't use quoted, local include, use <> style include. Cosmetic: also move stdbool.h include to the top to keep osmocom and openbsc includes grouped. Change-Id: Iaa3dc36768f96f6b8c91010a2ba389fdc37f1503
2016-07-09Make random MSISDN assignment optionalMax1-2/+3
Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Fixes: OS#1658 Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb
2016-06-14Make random extension range configurableMax1-1/+2
Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658
2016-04-29use new libosmocore gsm_23_003.h for IMEI/IMSI lengthHarald Welte1-4/+3
... rather than our private definitions everwhere. As an added benefit, gprs_gsup_messages.h is now free of any header dependencies within openbsc.
2016-03-17Revert "move to hex TMSI representation"Harald Welte1-1/+1
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy1-1/+1
In OpenBSC, we traditionally displayed a TMSI in its integer representation, which is quite unusual in the telecom world. A TMSI is normally printed as a series of 8 hex digits. This patch aligns OpenBSC with the telecom industry standard. Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2015-04-29sub: Remove the queue from the subscriber codeHolger Hans Peter Freyther1-4/+10
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-5/+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-09sgsn: Put SGSN related subscriber data into separate structJacob Erlbeck1-1/+2
There will be an increasing number of SGSN related fields per subscriber. Instead of extending gsm_subscriber accordingly, a single struct sgsn_subscriber_data object is assigned to it. The talloc context used to allocated that object is the subscr object itself. Therefore it will be freed automatically along with the subscr object. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gprs_subscriber.cJacob Erlbeck1-0/+1
This patch adds GPRS specific functions for gsm_subscriber objects (allocation, retrieval, deletion) and subscriber data requests/updates. The sgsn_update_subscriber_data callback is used to notify the sgsn about updates and is extended by a parameter that passes a reference to a gsm_subscriber. Sponsored-by: On-Waves ehf
2014-12-09msc: Add per subscriber keep_in_ram flagJacob Erlbeck1-0/+3
Currently the keep_subscr flag in gsm_subscriber_group refers to a whole group of subscribers which makes it difficult to really delete single entries if the flag is set. This patch adds a keep_in_ram field to gsm_subscriber which allows for keeping subscriber objects in RAM while deleting others. Note that really deleting an entry requires that both flags (subscr_group->keep_subscr and subscr->keep_in_ram) are set to 0. So only the latter should be used if a specification requires the deletion of a subscriber entry. Sponsored-by: On-Waves ehf
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-11/+17
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
2014-11-14sgsn: Cross-link gsm_subscriber and sgsn_mm_ctxJacob Erlbeck1-0/+4
To implement subscriber based authorization a data structure is needed that keeps the subscriber data. The MSC already uses a similar struct named gsm_subscriber whose implementation is split into a generic part (allocation, retrieval, reference counting, list maintenance) and MSC related parts. For GPRS, only the generic part will be used and specific fields may be added when needed. This patch adds a field mm to struct gsm_subscriber that will be used by the SGSN to store a reference to the current MM context (or NULL if there is none). This also adds a field subscr to struct sgsn_mm_ctx that reversely points to a gsm_subscriber (or NULL if there is none). Either both fields are NULL or both fields are non-NULL. Note that subscr is being reference counted. Sponsored-by: On-Waves ehf
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-0/+2
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-0/+2
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-0/+1
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-01-01libmsc: Track and update the location update expiryJan Luebbe1-0/+2
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.
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther1-1/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-8/+8
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-01-06subscr: Add a vty option to kick the queue.Holger Hans Peter Freyther1-0/+1
2011-01-06subscr: Dump the pending requests to help with debugging state.Holger Hans Peter Freyther1-0/+3
2011-01-06subscr: Make it possible to clear pending requests for a subscriberHolger Hans Peter Freyther1-0/+1
2011-01-06subscr: Show the number of pending requests on this subscriber.Holger Hans Peter Freyther1-0/+2
2011-01-06subscr: Make the subscr_put_channel work with the subscrHolger Hans Peter Freyther1-1/+1
The active channel might or might not be gone when the transaction has been released. Instead of passing an invalid subscriber conn we will pass the subscr that is ref-counted and guranteed to be valid at this point. subscr_put_channel could search the connections for an active connection if that is ever needed.
2010-12-24subscr: Add a VTY command to update the subscriber from the database.Holger Hans Peter Freyther1-0/+1
2010-12-24subscr: Introduce subscr_purge_inactive to free unused subscribersHolger Hans Peter Freyther1-0/+2
Introduce a method that will remove all subscribers that have a zero use count. This is useful if someone wants to purge subscribers from memory or wants to disable the everything in RAM feature.
2010-11-15subscr: Add method to find an active subscriberHolger Hans Peter Freyther1-0/+4
This is used by the paging code of the osmo_bsc. When we get a paging response there should be an active subscriber with the TMSI or IMSI and we can stop paging. There is no need to allocate a new subscriber.
2010-11-15subscr: Add the subscr_get_or_create from the on-waves/bsc-master branchHolger Hans Peter Freyther1-0/+2
Create a subscriber based on a known IMSI, search the list of active subscribers if there is already someone like this.
2010-11-15subscr: Move the TMSI reserved into the gsm_dataHolger Hans Peter Freyther1-4/+0
Put it into the gsm_data.h to avoid requiring MSC code in the BSC code paths.
2010-07-26gsm_subscriber: Increase the name to 160 charachtersHolger Hans Peter Freyther1-1/+1
160 charachters is the limit of the subscriber name inside the notifySS nameIndicator/callingName.
2010-06-16bsc_api: Operate on the subscriber connection for subscriber managementHolger Hans Peter Freyther1-1/+1
2010-02-20split 'libosmocore' from openbsc codebaseHarald Welte1-1/+1
This library is intended to collect all generic/common funcitionality of all Osmocom.org projects, including OpenBSC but also OsmocomBB The library currently includes the following modules: bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer, tlv_parse, linuxlist msgb allocation error debugging had to be temporarily disabled as it depends on 'debug.c' functionality which at the moment remains in OpenBSC
2009-12-24add (and use) new subscr_name() function to get name or IMSIHarald Welte1-0/+2
2009-10-26[USSD] various USSD improvementsMike Haben1-3/+4
- Improved handling of extension-number string (as per review) - Guard against a buffer-overflow if mobile sends a too-long USSD - declare some function-parameters const - fix gsm_ts_name function to display the right BTS number (bts->nr rather than bts->bts_nr)
2009-09-28[tmsi] Make the tmsi a 4 octet numberHolger Hans Peter Freyther1-3/+6
tmsi is four octets long, there is no need to make it a string and then jump through hoops to convert it to a number. Keep the database using it as a string to benefit from the NULL handling of the db. Introduce the reserved tmsi which has all bits set to 1 according to GSM 03.03 ยง2.4 and start checking for it and make sure the db code will never allocate such a tmsi.
2009-08-20[subscr] Change the signature... the gsm_network is in the subscrHolger Hans Peter Freyther1-2/+1
Remove the extra parameter from the method, the network can be taken from the subscriber.
2009-08-14add 'show subscriber cache' vty command to debug subscriber refcount leaksHarald Welte (local)1-0/+1
2009-08-12allocate an extension when creating the subscriberJan Luebbe1-0/+3
2009-08-12flag new subscriber structs in memory and send a signalJan Luebbe1-0/+5
2009-08-08first 'working' SMS implementationHarald Welte1-0/+2
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
2009-07-23make sure subscr->net is always setHarald Welte1-3/+6
since a subscriber is an element of the gsm_network, we have to ensure subscr->net is always set correctly. We do this by using gsm_network as an argument to all functions that resolve or create a subscriber.
2009-07-05Merge branch 'master' into smsHarald Welte1-8/+17
2009-07-05Store classmark1/2/3 in equipment SQL tableHarald Welte1-8/+17
For further evaluation/analysis, this patch stores the classmark 1, 2 and 3 values of every equipment in the SQL database. We can use this non-volatile data to determine the supported features for each handset that we've ever seen on our network.