path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2014-03-12sms: WIP implementation of a delivery report aka SMS-STATUS-REPachemeris/sms_fixesAlexander Chemeris2-2/+118
2014-03-12sms: Use gsm_7bit_decode_n() in gsm340_rx_tpdu().Alexander Chemeris1-1/+1
gsm_7bit_decode() is deprecated and should not be used.
2014-03-12sms: Rename gsm340_gen_oa() to gsm340_gen_address_field().Alexander Chemeris1-3/+3
2014-03-12sms: Send the actual TP-Service-Centre-Time-Stamp with SMS-DELIVER instead ↵Alexander Chemeris1-1/+1
of a bogus current time.
2014-03-12sms,db: Update DB scheme to support more features in our SMSC.Alexander Chemeris5-12/+50
Do not store delivered messages in the DB. In a production system we should not store messages longer than needed, as it will quickly bloat our DB. In case one wants to store messages for debug purposes, we could add one of the following capabilities later: - hexdump to a log file - send to an SMPP entry on delivery - send to Wireshark sms,db: Store SMS Message Reference in the DB, since we need it to generate SMS-STATUS-REPORT. 03.40 (TP-MR) The SMS-STATUS-REPORT also contains a TP-Message-Reference field. The value sent to the MS will be the sameas the TP-Message-Reference value generated by the MS in the earlier SMS-SUBMIT or SMS-COMMAND to whichthe status report relates. sms,db: Add a 'type' filed to gsm_sms structure to be able diffrentiate normal DELIVER/SUBMIT messages from STATUS-REP messages.
2014-03-12sms: Rename gsm340_gen_tpdu() to gsm340_gen_sms_deliver_tpdu() to show that ↵Alexander Chemeris1-5/+5
it generates SMS-DELIVER TPDU and is not a generic function.
2014-03-12db,sms: Rename db_sms_mark_sent() to db_sms_mark_delivered(), as that's what ↵Alexander Chemeris3-4/+4
it does.
2014-03-12db: Add more tests for retrieving subscribers from a DB.Alexander Chemeris1-2/+36
2014-03-12libmsc,sms: Properly calculate and store validity and received timestamps ↵achemeris/sms-validity-fixAlexander Chemeris4-11/+28
for incoming SMS.
2014-03-08db: Add testcase for the db migration.Holger Hans Peter Freyther6-2/+42
2014-03-08sms: Add code to migrate the database to the new schemaHolger Hans Peter Freyther2-16/+199
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-03-07sms: 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-03-07db: Add testcase for storing/loading/comparing a smsHolger Hans Peter Freyther1-0/+61
Use the already created subscriber, create a sms and read it back from the subscriber.
2014-03-07sms: Kill the sms->sender and use addr/ton/npi throughout the codeHolger Hans Peter Freyther4-36/+41
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-03-07db: Remove the german from the log messageAlexander Chemeris1-1/+1
2014-03-06nitb/smpp: Add simple test runner for the issues found by danielHolger Hans Peter Freyther2-1/+140
Send the two strings that caused the read handling to misbehave. Verify that we handle this correctly by still being able to issue a VTY command. The CPU load issue could not be verified like this.
2014-03-06smpp_smsc: Fix integer overflow in read return value and msgb_alloc()Daniel Willmann1-6/+6
The size parameter of msgb_alloc is uint16_t so any length value above 65535 will allocate a msgb with incorrect size. This patch changes the type of rdlen and rc to ssize_t (the return value of read) and guards against the read length being larger than UINT16_MAX. To reproduce the issue run: echo -en "\x00\x01\x00\x01\x01" |socat stdin tcp:localhost:2775
2014-03-06smpp_smsc: Check that the size is large enough to hold actual dataDaniel Willmann1-0/+6
The first 4 bytes are the length including the length field. For length < 4 the subsequent msgb_put(msg, sizeof(uint32_t)) will fail, resulting in an abort. The code also expects (in smpp_msgb_cmdid()) the existence of 4 more bytes for the SMPP command ID. This patch checks that the length received is large enough to hold all 8 bytes in the msgb and drops the connection if that's not the case. The issue is reproducible with: echo -e "\x00\x00\x00\x02\x00" |socat stdin tcp:localhost:2775
2014-03-06smpp_smsc: Fix socket read() error handlingDaniel Willmann1-16/+31
Read returning -1 is an error here so make sure to print the actual reason and close the socket. Before this patch we just looped over the fd with read returning -1 every time. EINTR is handled to not cause an error and we don't need to check EAGAIN/EWOULDBLOCK since the callback is only called in case there is something to read. To avoid copy&paste issues the check is implemented as a macro and the log message moved into a separate if.
2014-03-06nitb: Add a test for "show network" in the python testsuite.Ciaby2-3/+11
Make sure that bsc_gsmnet->bsc_data->rf_ctrl is initialized for NITB. In commit a9fae1ae66df57f76a0aedbd0b56228959d37d56 the conditions for the rf_ctrl was removed but it was still needed for the NITB. Fixes regression from: a9fae1ae66df57f76a0aedbd0b56228959d37d56 bsc: rf_ctrl will always be created, remove the NULL checks
2014-03-06nat: Add CTRL command test case for the new control commandsHolger Hans Peter Freyther3-3/+50
2014-03-04nat: Introduce command to remove an access-list-nameHolger Hans Peter Freyther1-0/+5
2014-03-04nat: Implement setting the access-control-name through CTRL interfaceHolger Hans Peter Freyther1-19/+99
For operation we want to switch the access-list of a BSC at runtime in a programatic way. Sponsored-by: On-Waves ehf
2014-03-04bsc: Include the MCC/MNC in the location trapHolger Hans Peter Freyther1-1/+5
It is of interest to know the MCC/MNC that is broadcasted at the specific position. Sponsored-by: On-Waves ehf
2014-03-04libbsc: Add command to set MNC/MCC and apply it if something changedHolger Hans Peter Freyther2-1/+104
Change the splitting of the ctrl_test_runner.py. Make sure that we get one element and all the rest.
2014-03-04libbsc: Add ctrl command to apply the configurationHolger Hans Peter Freyther1-0/+31
Right now this only works for IP based BTS like the sysmoBTS and by dropping the OML link.
2014-03-04libbsc: Add ctrl command for MNC, MCC, short-name and long-nameHolger Hans Peter Freyther5-1/+87
Add the framework for adding more setting commands.
2014-02-24sms: Address the TODO and schedule the next SMS for an active subscriberHolger Hans Peter Freyther1-6/+45
When one SMS has been delivered check if a second SMS can be scheduled to that subscriber. If nothing can be scheduled kick the normal SMS queue as one slot has become free now. Otherwise send the SMS and create a pending entry.
2014-02-24sms: Do not interfere with the SMS queue from within gsm_04_11Holger Hans Peter Freyther2-17/+6
It was possible that two SMS would be delivered at the same time which violates GSM 04.11. We should solely rely on the sms queue to schedule more SMS to the subscriber.
2014-02-22bsc: Add vty command to send location trap through VTYHolger Hans Peter Freyther3-6/+38
I have manually tested this by entering the VTY command and observing the CTRL interface using wireshark. Ticket: OW#1129
2014-02-21SMPP: UCS2 data_coding is 0x08, not 0x80!Harald Welte1-1/+1
As can clearly be seen from SMPP Spec v3.4 Chapter 5.2.19, a SUBMIT-SM with data_coding == 0x08 is UCS2, not with 0x80. Thanks to ciaby@rhizomatica.org for reporting the bug.
2014-02-20sms: Increment the RP Message Reference for each transactionHolger Hans Peter Freyther7-3/+74
Each RP-DATA should have a unique msg reference. Currently 42 is used for all of these. Remember the last reference we used and increment it on the next SMS. Do not track if the reference is still in use a clash is a lot less likely now. First unless SMPP is used only one SMS is delivered at a time, second the transaction space is a lot smaller than the one for the reference.
2014-02-20trau: Fix compiler warning about decoded_trau_frameHolger Hans Peter Freyther1-0/+2
In file included from bsc_api.c:34:0: ../../include/openbsc/trau_mux.h:62:15: warning: ‘struct decoded_trau_frame’ declared inside parameter list [enabled by default] const struct decoded_trau_frame *tf); ^ ../../include/openbsc/trau_mux.h:62:15: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] ../../include/openbsc/trau_mux.h:64:15: warning: ‘struct decoded_trau_frame’ declared inside parameter list [enabled by default] const struct decoded_trau_frame *tf); ^ ../../include/openbsc/trau_mux.h:66:2: warning: ‘struct decoded_trau_frame’ declared inside parameter list [enabled by default] const unsigned char *data); ^ ../../include/openbsc/trau_mux.h:68:2: warning: ‘struct decoded_trau_frame’ declared inside parameter list [enabled by default] const unsigned char *data);
2014-02-20tests: Remove unused fileHolger Hans Peter Freyther1-50/+0
2014-02-08bsc: rf_ctrl will always be created, remove the NULL checksHolger Hans Peter Freyther3-8/+4
2014-02-08libbsc: Create the RF interface all the timeHolger Hans Peter Freyther3-28/+31
The interface can be accessed through CTRL and a socket. But currently it is only available when the socket interface has been configured. Create the interface all the time but only listen on the socket when a path has been specified.
2014-02-04ctrl: Make it possible to re-use the string get and set routineHolger Hans Peter Freyther1-3/+7
This can be used for the description field that requires some special handling for newlines.
2014-02-04ctrl: Make the int range set, get and verify methods availableHolger Hans Peter Freyther1-4/+12
For the max power reduction we will need to have a different range method. It will need to check if the value is even. Make the set, get and verify methods available through a macro.
2014-02-03mgcp: Round the frame time otherwise we have porting issuesHolger Hans Peter Freyther3-70/+71
With the current multiplication we might end up with 19999 as time on i386. When we round it ends up as 20000 on i386 and should work the same on AMD64.
2014-02-03mgcp: transit is a signed variable and should be printed like thisHolger Hans Peter Freyther2-89/+89
On AMD64 we had a difference in the test result most likely due the bigger size of integers.
2014-02-03mgcp: Use the length modifier for the size_t in the printfHolger Hans Peter Freyther1-1/+1
Should fix on AMD64: mgcp_test.c: In function ‘sendto’: mgcp_test.c:318:10: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat]
2014-01-31mgcp/rtp: Base jitter calculation on input timestampsJacob Erlbeck2-80/+82
So far, the jitter computation has been based on output timestamps. This patch uses the input timestamps instead and resets jitter computation on SSRC changes. Sponsored-by: On-Waves ehf
2014-01-31mgcp/rtp: Compute delta timestamp based on wallclockJacob Erlbeck3-10/+19
Currently, when the SSRC changes within a stream and SSRC fixing is enabled, the RTP timestamp between the last packet that has been received with the old SSRC and the first packet of the new SSRC is always incremented by one packet duration. This can lead to audio muting (at least with the nanoBTS) when the wallclock interval between these packets is too large (> 1s). This patch changes the implementation to base the RTP timestamp offset on the wallclock interval that has passed between these two packets. Ticket: OW#466 Sponsored-by: On-Waves ehf
2014-01-31mgcp/rtp: Fix transit computation unitsJacob Erlbeck2-124/+128
Currently micro-secs and RTP rate get mixed when the transit value is computed in mgcp_patch_and_count(). This patch changes get_current_ts() to accept the desired rate as argument and to use it for the time conversion instead of always converting to microseconds. If microseconds are needed, get_current_ts(1000) can be used. The arrival_time is now measured in 1/rtp_end->rate seconds so that it can be directly compared to RTP timestamps as required by RFC3550 (section 6.4.1, see definition of 'interarrival jitter'). Sponsored-by: On-Waves ehf
2014-01-31mgcp/test: Fake wallclock for RTP timing/stats testsJacob Erlbeck2-0/+184
Currently the stats (jitter, transit) cannot be checked properly, since they depend on the wallclock time. This patch fakes clock_gettime (CLOCK_MONOTONIC) to reflect the scheduling time of the RTP packets. In addition, the RTP statistical value are written to stdout. A RTP test case with a SSRC change along with a reference time delay has been added. Sponsored-by: On-Waves ehf
2014-01-31mgcp/test: Only include conn_mode into test outputJacob Erlbeck2-15/+24
Currently the conn_mode and the output_enabled flags are printed to stdout. This patch modifies this to print the output_enabled flags to stderr instead. The bits in conn_mode are shown as RECV, SEND, and LOOP. This does not reduce the significance of the test, since there is an assertion already that verifies the values of the output_enabled flags with respect to the conn_mode. Sponsored-by: On-Waves ehf
2014-01-31sms/dtap: Add log messages to analyse SMS message lossJacob Erlbeck3-0/+10
Incoming DTAP messages from MS are discarded during silent calls, which leads to the repeated delivery of SMS since the ACKs are not being processed. This patch adds some log messages that have been helpful to track this down. Sponsored-by: On-Waves ehf
2014-01-27Add function to update TRAU muxer after assignment or handoverAndreas Eversberg6-5/+61
E1 based BTS use TRAU muxer to decode TRAU frames. After changing channel from one timeslot to another (due to handover or assignment), the TRAU muxer must be updated. The call reference of the call is disconnected from the old channel and connected to the new channel.
2014-01-26Use 'defines' for length and duration of RTP payloadAndreas Eversberg2-7/+17
2014-01-20nat: Make the access-list deny cause configurableHolger Hans Peter Freyther2-4/+50
Add two optional arguments to the imsi-deny rule for the reject cause and verify that it is saved out.