aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc
AgeCommit message (Collapse)AuthorFilesLines
2015-07-28nitb: Rename "use-tmsi" into "assign-tmsi", add a missing space after "no"ciaby/2015-07-28Ciaby1-2/+2
2015-07-14nitb: Add a mode to not use TMSI for normal operationzecke/features/no-tmsiHolger Hans Peter Freyther2-31/+85
In case foreign simcards are used we can not do authentication and ciphering. In case a TMSI is re-used too early and we do page using TMSI we can't know which of the two MS is responding to us. We could change the "secure channel" routine to ask for the IMSI and only then stop the paging. As we don't have ciphering there is not much use in using the TMSI. Add a mode "no assign-tmsi" that will not assign the TMSI during LU. Now CM Service Request and Paging Response will work using the IMSI. There can't be a clash with that.
2015-07-13nitb: Be less strict about the reject causeHolger Hans Peter Freyther1-1/+1
When we can't find the TMSI then the subscriber is not in our VLR. We have not consulted with the HLR and it is better to not use such a severe error code.
2015-07-13sms: Do not go through the routing a second timeHolger Hans Peter Freyther1-1/+7
If we have tried SMPP first and it was not routable, and then tried the local delivery there is no point in trying SMPP with the same parameters again. Leave early and return unknown sub to the caller.
2015-07-06sms: Add a way to always route SMS through SMPP systemsHolger Hans Peter Freyther4-0/+51
default-route would only be looked at after there has been no subscriber in the local database. Depending on the setup this is not what one wants. This has been discussed at the OsmoDevCon and there have been hacks in some branches. Let's introduce a VTY command to select if SMPP should be consulted first and then fallback to the current behavior.
2015-07-06sms: Simplify the return handling for SMPP routes/unroutableHolger Hans Peter Freyther1-2/+1
2015-07-06sms: Put the try_deliver into the header fileHolger Hans Peter Freyther2-2/+8
Even if it is using BSC/NITB types let's put it in the header file than just declaring it at a place that could bitrot in a way that doesn't lead a warning.
2015-07-06sms: Move the routing of the sms to a separate functionHolger Hans Peter Freyther1-39/+50
The "default-route" for SMPP will be used after a local subscriber look-up. Sometimes we want to route everything to SMPP. Make this possible by changing this routine.
2015-05-29gsm_04_08: Use osmo_assert for transt->conn and conn only in case of paging ↵Ivan Kluchnikov1-1/+1
succeeded setup_trig_pag_evt function can receive parameter conn = NULL, if T3113 expires.
2015-04-29sub: Remove the queue from the subscriber codeHolger Hans Peter Freyther6-190/+84
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 Freyther2-122/+4
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.
2015-04-29mncc: Select the codec similar to the modify handlingHolger Hans Peter Freyther1-1/+1
In case the default TCH/F codec is "EFR" and we do an early assignment from SDCCH to a TCH we would assign the TCH/H codec. This is because the lchan_type will be neither a TCH/H nor a TCH/F. At the same time the _gsm48_lchan_modify code to check for half vs. full-rate is the other way around. Align both. It is full-rate if it is not a TCH_H. This will have some other complications down the way (early assignment on cells with only TCH/H). So the mode should not depend on the _current_ channel but the kind of channel we want.
2015-04-10nitb: Fix IMSI/IMEI buffer handling (Coverity)Jacob Erlbeck1-2/+2
Currently the handling of the buffers is not done consistently. Some code assumes that the whole buffer may be used to store the string while at other places, the last buffer byte is left untouched in the assumption that it contains a terminating NUL-character. The latter is the correct behaviour. This commit changes to code to not touch the last byte in the buffers and to rely on the last byte being NUL. So the maximum IMSI/IMEI length is GSM_IMSI_LENGTH-1/GSM_IMEI_LENGTH-1. For information: We assume that we allocate the structure with talloc_zero. This means we have NULed the entire imsi array and then only write sizeof - 1 characters to it. So the last byte remains NUL. Fixes: Coverity CID 1206568, 1206567 Sponsored-by: On-Waves ehf
2015-04-07nitb: Check source string length before calling strncpy (Coverity)Jacob Erlbeck1-0/+14
Currently some VTY command do neither check the length of the source string before calling strncpy nor ensure NUL-termination afterwards. This can to destination string buffers whose contents are not NUL-teminated. This commit adds checks and corresponding warnings to the VTY commands 'subscriber TYPE ID name .NAME" and "subscriber TYPE ID extension EXTENSION". Fixes: Coverity CID 1206570, 1206569 Sponsored-by: On-Waves ehf
2015-03-28write_queue: Check the result of osmo_wqueue_enqueue and freeHolger Hans Peter Freyther2-2/+9
The write_queue is designed to have a maximum amount of pending messages and will refuse to take new messages when it has been reached. The caller can decide if it wants to flush the queue and add the message again, create a log. But in all cases the ownership of the msgb has not been transferred. Fix the potential memory leak in the failure situation.
2015-02-08smpp: Fix potential crash in handling submitSMHolger Hans Peter Freyther1-3/+4
In case: * No message_payload and a 0 sm_length was used * esm_class indicates UDH being present * 7bit encoding was requested The code would execute: ud_len = *sms_msg + 1; Which is a NULL pointer dereference and would lead to a crash of the NITB. Enforce the limits of the sm_length parameter and reject the messae otherwise. Fixes: Coverity CID 1042373
2015-02-08smpp: Do not check conn for being nullHolger Hans Peter Freyther1-1/+1
We are deferencing conn earlier in this function without doing a null check. At the time deliver_to_esme is called the conn will always exist and even the lchan is likely to be present. Remove the null check for conn right now. Fixes: Coverity CID 1210594
2015-01-31meas: Install the scenario command and test itHolger Hans Peter Freyther1-0/+6
2015-01-31meas: Add VTY documentation for the measurement commandsHolger Hans Peter Freyther1-2/+3
Document the parameters that can be passed on.
2015-01-27nitb: Make the last change configurableHolger Hans Peter Freyther1-0/+47
Introduce a NITB node and add the subscriber creation as config name in there.
2015-01-27nitb: Allow the network to decide if a subscriber should be createdHolger Hans Peter Freyther1-9/+20
2015-01-05SMS: Attempting to send SMS is not a NOTICEable eventHarald Welte1-1/+1
2015-01-02logging: Only compare the subscr addressHolger Hans Peter Freyther1-0/+28
Move the "logging filter imsi IMSI" into the BTS/NITB code to allow to set the gsm_subscriber and only compare it. This way we simply compare the subscriber address and don't have to care if the subscriber data is still valid.
2015-01-02logging: Set the context for paging requests as well.Holger Hans Peter Freyther1-0/+1
2015-01-01meas_feed.c: Fix compiler warningHarald Welte1-1/+1
2015-01-01Initial support for export + curses-visualization of measurementsHarald Welte4-2/+209
This extends osmo_nitb to offer a UDP feed of real-time measurement reports, which can be used by (a variety of) external tools for visualization or other processing. We also add a small ncurses based tool (meas_vis) which shows a baragraph display of the last few mobile stations that were active, indicating their uplink/downlink receive level and quality. <WARNING> This sends non-portable structures like gsm_meas_rep over UDP and assumes the receiver has identical alignment and endianness! Before this feature is merged, it either needs to be converted to a unix domain socket (but they don't do multicast, which would be nice) or the wire format needs to change into something portable with defined alignment and encoding </WARNING>
2015-01-01convert away from deprecated gsm_7bit_{encode,decode}() functionsHarald Welte2-3/+4
which removes yet another bunch of compiler warnings.
2014-12-09msc: Add net parameter to trans_allocJacob Erlbeck3-6/+9
The trans_alloc function still uses the subscr object to access the network object. This patch adds an explicit net parameter to this function and removes the access to subscr to obtain it. Sponsored-by: On-Waves ehf
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck11-56/+65
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-12-05msc: Don't use the subscriber to access the net objectJacob Erlbeck3-11/+11
Sponsored-by: On-Waves ehf
2014-12-05msc: Add net back pointer to gsm_transJacob Erlbeck2-33/+35
Currently the net pointer is obtained from trans->subscr->net. On the other hand, the list gsm_trans object is managed by the net object. This patch adds the back pointer to the structure and replaces all trans->subscr->net by trans->net expressions. In trans_alloc() the trans->net pointer is obtained from the subscr object. Sponsored-by: On-Waves ehf
2014-10-28nitb/ctrl: Fix access to freed memory in verify_subscriber_modifyJacob Erlbeck1-7/+9
Currently the temporary string 'tmp' is freed before parts of it are referenced. This lets address sanitizer complain when evaluating strlen(imsi), where imsi points into the 'tmp' data block. This patch moves the talloc_free to the end of the function and uses a rc variable instead of using early returns. Addresses: testSubscriberAddRemove (__main__.TestCtrlNITB) ... Launch: ./src/osmo-nitb/osmo-nitb -c ./doc/examples/osmo-nitb/nanobts/openbsc.cfg -l test_hlr.sqlite3 Connecting to host 127.0.0.1:4249 Sending "SET 1000 subscriber-modify-v1 2620345,445566" Decoded replies: {} ERROR Sponsored-by: On-Waves ehf
2014-10-03nitb: Add subscriber delete commandRuben Pollan1-1/+33
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte1-1/+1
2014-08-04MNCC: Add IMSI to CALL CONFIRM messageAndreas Eversberg1-0/+4
LCR requires IMSI to correlate calls for MPTY (multi party conference) and ECT (call transfer).
2014-08-02vty: Fix interactive VTY help for silent-sms transmissionHarald Welte1-3/+3
2014-08-02DB: produce a backtrace in case of a DB errorHarald Welte1-0/+1
This helps us to identify where exactly in our code the DB error originates from.
2014-07-19smpp: Fix small typo in the commentHolger Hans Peter Freyther1-1/+1
2014-07-03db: Use ulonglong to access the database for sqlite3Holger Hans Peter Freyther1-14/+14
The type in the schema is integer but we need to use ulonglong to read it as otherwise the read will fail. DBI: -7: The requested variable type does not match what libdbi thinks it should be
2014-06-18nitb: Only print channel activations once in show statisticsHolger Hans Peter Freyther1-3/+0
openbsc_vty_print_statistics will already print these counters for us. No need to print them again.
2014-05-18Add support for AMR frames to MNCC/RTP interfaceAndreas Eversberg1-0/+1
AMR rate is currently fixed to 5.9k.
2014-05-18bsc_api/NITB: If TCH/H channel is used, indicate it to bsc_apiAndreas Eversberg1-1/+2
If we don't do this, OsmoNITB will send an assignment command from a TCH/H to another TCH/H without any need.
2014-05-18Add check to tch_map(), if RTP sockets existAndreas Eversberg1-0/+11
2014-04-30db: Fix fall-out with the subscriber removal in the subscriber deletion codeHolger Hans Peter Freyther1-2/+2
The sender_id is gone so the code that attempted to delete SMS didn't work anymore. Delete the SMS based on src_addr or the dest_addr. Fixes: ====================================================================== ERROR: testSubscriberAddRemove (__main__.TestCtrlNITB) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/ctrl_test_runner.py", line 379, in testSubscriberAddRemove r = self.do_set('subscriber-delete-v1', '2620345') File "tests/ctrl_test_runner.py", line 114, in do_set return self.recv_msgs()[id] KeyError: 1002
2014-04-30db: Add testcase for the db migration.Holger Hans Peter Freyther1-0/+2
2014-04-30sms: Add code to migrate the database to the new schemaHolger Hans Peter Freyther1-16/+193
This is mostly based on Alexander's migration code. The code adds transaction handling and some sanity checks and cleanups to the code. We made the decision to fork the sms_from_result method and freeze it to that version. This way sms_from_result can move forward without having to deal with legacy.
2014-04-30sms: Do not store received id in the SMS database.Alexander Chemeris1-21/+10
That was a bad idea from the very beginning. A visible result of this is a wrong SMS routing when you change subscriber extensions, while having queued SMS. It's also a very wrong thing from the code layering perspective. I think the next logical step should be to remove "receiver" pointer from the gsm_sms structure into a structure, special for the internal SMS queue.
2014-04-30sms: Kill the sms->sender and use addr/ton/npi throughout the codeHolger Hans Peter Freyther3-34/+42
This is an incompatible database schema change. Store the type of the address in the database for both the sender and the receiver. Currently it is possible to use SMPP to store a SMS and the NPI and TON will be lost on the delivery of the SMS. The schema is changed to make the delivery always use the right NPI/TON. This patch is not ready for the master branch as there is no upgrade path for the HLR yet.
2014-04-04bsc/msc: Extension can never be NULL use strlen insteadHolger Hans Peter Freyther1-1/+1
Fixes: Coverity CID 1040717
2014-04-04msc: Name is never NULL use strlen to check if it is emptyHolger Hans Peter Freyther1-1/+1
Fixes: Coverity CID 1040716