aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status reportPablo Neira Ayuso2-2/+54
This patch adds gsm340_sms_send_status_report_tpdu() to build a status-report. Moreover, set sms->report field if we see a SMPP SUBMIT_SM with Delivery Acknowledgment esm_class, so this identifies that this is a delivery report. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | | SUBMIT-SM | | | esm_class = Delivery Ack | | |<-------------------------------| | | SUBMIT-SM-RESP | | |------------------------------->| | | | | SMS-STATUS-REPORT | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | | There is a FIXME message in this patch, that I just copied from gsm340_gen_sms_deliver_tpdu() since TP-MMS is not supported by OpenBSC. Change-Id: Ib70e534840308ed315f7add440351e649de3f907
2017-08-27utils: smpp_mirror: bounce Delivery Receipts as Delivery AcknowledgmentsPablo Neira Ayuso1-9/+8
Simple patch to test the new status-report support code, remove previous code before Delivery Acknowledgement support was in place. Use LOGL_DEBUG for logging messages here as suggested by Neels and Harald. Change-Id: I877e228d8e174430f700631edbf9955972da7892
2017-08-27libmsc: update database to accomodate SMS status-report fieldsPablo Neira Ayuso2-6/+163
SMPP DELIVER_SM messages with esm_class = Delivery Receipt need to send this message reference (that the mobile phone allocates) to the ESME. Thus, the ESME propagates it via SUBMIT_SM with esm_class = Delivery Acknoledgment so that the SMSC sends the GSM 03.40 status-report to the origin including this. Given this field is useful for status-reports, we need to store it in the HLR database. Moreover, we need a new field that specifies if the entry represents a SMS status-report, to do the right handling from the gsm411_send_sms() - such new handling comes in a follow up patch entitled "libmsc: handle delivery ack via SMPP SUBMIT SM / send GSM 03.40 status report". This patch includes the migration routines to the new database schema revision 5, it's quite a bit of dbi boilerplate code - copied-pasted and adapted. Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6
2017-08-27libmsc: add support for SMPP delivery receiptsPablo Neira Ayuso4-1/+76
If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a
2017-08-27utils: smpp_mirror: reflect message reference TLVPablo Neira Ayuso1-1/+23
Useful to test the delivery receipt support. This TLV contains the GSM03.40 message reference. Change-Id: I1b0abaa7e06ffe1bd2242c70813d8b70e9fa954f
2017-08-27utils: smpp_mirror: temporarily munch SMPP delivery receiptsPablo Neira Ayuso1-0/+8
Just munch and log SMPP delivery receipts by now, don't mirror this, it is going to break things in openbsc. Follow up patch removes this and mirrors this SMPP message as a SUBMIT_SM with esm_class = Delivery Acknowledgement. Change-Id: I78e93bc4034679e238c8642ccf6a0e844b1d6d8b
2017-08-27utils: smpp_mirror: set registered_delivery field in SMPP SUBMIT_SMPablo Neira Ayuso1-0/+1
To test delivery reports using this utility. Change-Id: I0e477407531fdd4d906e53c9b5a48a79a239966f
2017-08-27libmsc: missing bit shift in status report flag when stored in sms objectPablo Neira Ayuso1-1/+1
So we just store 0 or 1 depending on what the mobile phone requests. Change-Id: Idb7d5594219c0e458ccb561383a59604bc1a4201
2017-08-27libmsc: report status report request flag from SMPP SUBMIT_SMPablo Neira Ayuso1-0/+1
Restore the sms status report request flag from SUBMIT_SM. Change-Id: Iac05252253f8933a3875b4904599b7a225191a4b
2017-08-27libmsc: set registered_delivery field in SMPP 3.4 DELIVER_SM messagesPablo Neira Ayuso1-1/+8
Propagate the status report request field to the SMPP message through the registered_delivery field, so the ESME knows that the mobile phone is asking for explicit delivery acknowledgment is required. See SMPP 3.4 specs section 5.2.17. Change-Id: I59af60fa89cd10ae973c5e122789e3e03e3728ee
2017-08-27timer vty: also print the default value in cmd docNeels Hofmeyr1-13/+13
Rationale: allows seeing all timer defaults at once by doing OsmoBSC(config-net)# timer ? Before, defaults are visible only by doing on each timer: OsmoBSC(config-net)# timer t1234 <tab> Change-Id: I8259234e5c62e058dde56d531071440bbab11462
2017-08-27vty: add 'default' keyword to timer configNeels Hofmeyr1-3/+14
Change-Id: I4e837e8bedfad7ac4fd50048ecb016ddb37c2397
2017-08-27cosmetic: vty for timers: remove obsolete range checkNeels Hofmeyr1-6/+0
The VTY parsing already ensures the parameter range being 1..65535, no need to check the range again. Change-Id: I1cffa5b01cd5c589f1e42998e32135f1da8c960b
2017-08-27libmsc: move gsm340_rx_sms_submit() to sms_route_mt_sms()Pablo Neira Ayuso1-19/+22
Move the sms message-type-identifier (mti) handling away from the routing logic. This patch allows us to reuse the sms_route_mt_sms() function in a follow up patch for sms reports send through SMPP DELIVER_SM with esm_class = Delivery Receipt whose Change-Id is Ic1a9023074bfa938099377980b6aff9b262fab2a. Change-Id: I3f3d30e0762b91e2099243b0be1a4b67cbb5e9c0
2017-08-27libmsc: remove 'deferred' parameter in sms_route_mt_sms()Pablo Neira Ayuso3-30/+24
No need to cache the sms object, just cache what we need into the smpp_cmd structure. This simplifies what that I introduced in 93ffbd0029d1 ("libmsc: send RP-ACK to MS after ESME sends SMPP DELIVER-SM-RESP"). Change-Id: Iba5f864f9bb963baff95969e306b1b7cff00c1e3
2017-08-27libmsc: remove duplicate lines in deliver_to_esme()Pablo Neira Ayuso1-2/+0
This code is accidentally doing the same thing twice, remove it. Change-Id: I68087a850399e22951d2407e4d8a09c671a775c9
2017-08-27libmsc: remove dead code in sms_route_mt_sms()Pablo Neira Ayuso1-3/+0
The following branch: if (!rc && !gsms->receiver) rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; at the end of sms_route_mt_sms() always evaluates false. Just a bit before, in such function, we have this: if (!gsms->receiver) { ... #ifdef BUILD_SMPP ... #else ... #endif return rc; } So, if there is no receiver, we just stop running code and return the RP cause via the rc variable. Same applies to the smpp_first check under the BUILD_SMPP ifdef (that I have removed in this snippet to keep this commit message small). Change-Id: Ic3502b5b169bc7a73a67fd6ff53d8b6c0dc045c8
2017-08-27libmsc: do not leak pending SMPP command object on error pathPablo Neira Ayuso1-5/+6
Make sure the SMPP command object is released on errors. Change-Id: I474584425d23fb379a9d71b33e29ac0e24f01e61
2017-08-27gsm_04_11: get rid of unused parameter in sms_route_mt_sms()Pablo Neira Ayuso1-5/+6
This parameter is unused, remove it. Change-Id: I797abce3f91447e8f397c7cf726db7425479fe0e
2017-08-27sgsn: Convert cch_pdp to host order for libgtpHolger Hans Peter Freyther1-5/+2
libgtp is calling gtpie_tv2 which will convert this uint16_t from host to network order. So far libosmogsm and the sgsn treated the charging characteristics as opaque data. So when moving from byte array to the uint16_t do the swapping. Change-Id: I977aec2e2f8d57802e45f591754e5733562d5c2a
2017-08-27remove code disabling T3109 if configured to 0Harald Welte1-4/+0
We no longer permit timers with a 0 value, so this case can never happen. Also, if it should happen, I'd rather have a timter expiring immediately (and breaking something) than not being started in the first place. Change-Id: Ibfcdd3ddc0155caee89c501498329bde247621a0
2017-08-27bsc_vty: Don't allow timers of zero (0)Harald Welte1-2/+2
It typically doesn't make sense to configure any of the GSM RR timer to 0 (Seconds). In fact, accidentially configuring any of the timers to zero might have severe side effects, such as "stuck channels" described in https://osmocom.org/issues/2380 Change-Id: I517828f2f0c80ec01cb63648db2626f17a67fe57
2017-08-27GSM timers: User reasonable defaults; don't save if equal defaultHarald Welte4-27/+35
A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380
2017-08-27bsc_vty: Add VTY command to test CTRL TRAP featureHarald Welte1-0/+16
Using this new command (introduced in OsmoBSC + OsmoNITB), you can simulate the generation of TRAP events for testin purposes. start the control interface monitor as an example client program: ./openbsc/contrib/bsc_control.py -m -d localhost -p 4249 then start OsmoBSC or OsmoNITB, telnet to the VTY and enter 'enable' mode and issue the following (example) command: ctrl-interface generate-trap my.foo.var 2342 As a result, on the bsc_control.py you will see: Got message: TRAP 0 my.foo.var 2342 Change-Id: Ib1d2ec38290dc94797c1b365d9b733e5215ab7d1
2017-08-27gtphob: check for missing result of rate_ctr_group_alloc()Harald Welte1-0/+4
In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361
2017-08-27gsm_bts_trx_set_system_infos(): Disable non-existing SIHarald Welte1-6/+17
If we previously had a given SI present/active, we must send a zero-length BCCH FILLING for that SI type to the BTS to stop it from further transmitting this SI. Change-Id: I33e356e2fa3a69efac9080813e3e9ef4e6438ed1 Closes: OS#2368
2017-08-27RSL: Allow disabling of BCCH/SACCH filling for given SI typeHarald Welte1-4/+8
If we want to instruct the BTS to stop sending a given SI, we must be able to send the respective BCCH INFO / SACCH FILLING with a header but without any L3 data IE. This patch enables the related functions to do this whenever their data argument points to NULL. Change-Id: I88b85614951a108574f05db3b706884afe7e87a9
2017-08-27Fix regression causing loss of static system-information messagesHarald Welte1-2/+2
In commit 8b1a2f8cd7a81c6b8c7cdb0963dcf89de7c46100 we started to initialize bts->si_valid to 0. This means we are skipping the manually configured static system information. Instead, we have to initialize bts->si_valid to bts->si_mode_static, i.e. start with those that are static and not to be auto-generated. Found while developing http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo Change-Id: Iab9cc93cf6d54560a72cc393cc3721a8d10e04bf Closes: #2367
2017-08-27check for missing result of rate_ctr_group_alloc()Harald Welte5-0/+32
In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21
2017-08-27libbsc: Add VTY command to re-send the SYSTEM INFORMATION to BTSHarald Welte1-0/+33
This is useful if you are updating some configuration parameters which affect the content of the SYSTEM INFORMATION messages. Currently, we only send them at the time the RSL connection is established (i.e. when the BTS is initialized), so if you change something, you need to bring down and re-start the BTS. Using the newly-introduced "bts <0-255> resend-system-information" command, you can re-generate + re-send SYSTEM INFORMATION without bringing the BTS down, i.e. without any radio carrier downtime. Change-Id: I326df47de98f6d36c9a4d2d5475225d1e62bafb5
2017-08-27bsc_api: Fix copy+paste error in printing name of RR STATUS PDUHarald Welte1-1/+1
Change-Id: I0ef78ef046e4850346569f750693e12938b50ab5
2017-08-27transaction: reject calls from unidentified subscribersBenoit Bolsee1-0/+7
A valid subscriber is indespensible when allocating a new transaction. Return NULL if no subscriber is supplied. This will cause unidentified subscribers to be rejected. Note: Under normal conditions, the problem does not occour, but it is still possible that a misbehaving MS might trigger the problem by sending a SETUP command before authenticating the subscriber. (unencrypted networks) Change-Id: Ia8739b6e329ab02c0064270d02ad1d6ee245520d
2017-08-27Fix BTS attribute requestsMax2-3/+10
* fix BTS numbers: use 0 to indicate given BTS and 0xFF to indicate all BTS' as it's explained in 3GPP TS 52.021 ยง9.3. * only request attributes from supported (OsmoBTS) types Change-Id: I8f43055c38000248033a8ff9ddaf0910d68d794b Related: OS#2317
2017-08-27Add VTY commands for experimentation with TS 04.14 commandsHarald Welte1-0/+94
TS 04.14 (TS 44.014) specifies a series of commands specific to conformance testing. Let's add some VTY commands to play (at least initially) with closing and opening voice loops in the MS. Change-Id: I38b1ee9dbf26f5689c38cb83b1b3c5e9eaad7678
2017-08-27Support for TS 04.14 conformance test commandsHarald Welte5-0/+154
Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c
2017-08-27libmsc: Fix VTY output for handover counters.Alexander Chemeris1-5/+5
Handover countrs belong to BSC, but we mistakenly take values from MSC counters. Change-Id: I9512330f2e91d2f526751c5228e6e8e0fe17d579
2017-08-27sgsn: Fill the cch_pdp with a value coming from the tlv structureHolger Hans Peter Freyther4-5/+42
For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906
2017-08-2704.08: find a portable way to obtain the timezone offsetBenoit Bolsee1-3/+10
Portable GMT offset calculation to display correct time on GSM. Change-Id: I673f17af2550c9708c4771e4ea4eafbbfafbb824
2017-08-27jenkins.sh: Proper error message if local environment isn't set upHarald Welte1-0/+7
Change-Id: I79c2302365824d9c8783dadfa378c8eaa07e2ee7
2017-08-27smpp: fix return causeBenoit Bolsee4-12/+17
Return cause 38 when default SMPP route is unavailable. This is better than cause 1. Change-Id: If3241d50a78fa611981e55fef6ae4c72b0a2a167
2017-08-27smpp_smsc.c: Log on sending deliver_sm messagePau Espin Pedrol1-0/+3
Change-Id: Ie16294df6d5bc0065f8d2b49320ead61f535f271
2017-08-27Use value string check from osmo-ciNeels Hofmeyr1-1/+1
Necessary since libosmocore I513835be2d931d0a931cdfc996f361a451bc1a15 removes the script from libosmocore/contrib. Change-Id: I02d7e1c0151c687fd9341d21a09ca15cbf5a1938
2017-08-27examples/sgsn: Use osmo-hlr with auth-policy remote by defaultDaniel Willmann3-1/+31
For the vty tests, add osmo-sgsn-accept-all.cfg (that does not need an HLR) and use in vty_test_runner.py, otherwise the 'show sgsn' command will reply that it could not connect to the HLR, failing the vty test which expects empty. Change-Id: Ie3b2013198d3e2b780a4e31c36b89b58129dcacd
2017-08-27contrib: Change systemd requirements so the services connect properlyDaniel Willmann2-2/+6
Change-Id: Ib1b3c640ddd81927a60ee307c4b0cb90fd83eebe
2017-08-27examples: Change IP address of config filesDaniel Willmann3-5/+5
This helps in providing 3G software packages for the sysmoNITB hardware, which uses 10.23.24.1 for SGSN and 10.23.24.2 for GGSN. However, in order to not break the python tests, the osmo-sgsn.cfg example still uses 127.0.0.1 as local address. Change the GGSN address to 127.0.0.2, because SGSN and GGSN cannot co-exist on the same address (the GTP port number is fixed by spec: no IE to communicate a differing port, so it has to be the standard GTP port for both). Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530
2017-08-27contrib: Add osmo-msc service fileDaniel Willmann1-0/+13
Change-Id: Ifdaf4107167c84af8a616f4ee792d5a34495564b
2017-08-2704.08: log protocol discriminators and message types by nameNeels Hofmeyr11-907/+923
On incoming 04.08 messages, we log only the protocol discriminator in decimal. Enhance: log pdisc and message type in hex, and also log the protocol and message type as human readable string. Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions of dtap from/to the MS. Adjust the expected output of msc_vlr_tests. Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-08-27mgcp: hack RAB success from nano3G: patch first RTP payloadNeels Hofmeyr2-0/+14
The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Related: OS#2459 Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4
2017-08-27fix msc_vlr tests after libosmocore uses localtime for SMSNeels Hofmeyr1-2/+2
libosmocore change-id I4efdb1eaae43aced33961b64d4f14b0040321c10 changes the gsm340_gen_scts() from gmtime to localtime, meaning that by feeding a mere zero as timestamp, we get different results depending on the local machine's timezone setting. Instead of calling gsm340_gen_scts() with zero, simply write a bunch of bytes as time so that the tests get identical SMS bytes every time. Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c
2017-08-27Implement IuCS (large refactoring and addition)Neels Hofmeyr97-3034/+4717
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88