aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-02-14remove unused dyn_ts_allow_tch_f VTY optionHarald Welte4-32/+0
This belongs into the BSC and has no relevance in the MSC, as the MSC has no clue about dynamic timeslots. Related: OS#2528 Change-Id: Iaa41d22db81120572d4cd2c0c4c75d258947a42f
2018-02-14dead code removalHarald Welte4-105/+2
Related: OS#2528 Change-Id: I89157c446d66e11adbe3cad587eb34ec40271c12
2018-02-14remove bsc_api.h and all users - they're all dead codeHarald Welte9-77/+1
Related: OS#2528 Change-Id: I332aa8697c98a0d7b3db65f98711275da3d381d7
2018-02-14gsm_data: remove unused gsm_subscriber_connection membersHarald Welte1-2/+0
The mncc_rtp_create_pending and mncc_rtp_connect_pending members were unused, let's remove them. Related: OS#2528 Change-Id: I417e23ec53323ddd8e1e5d18952566fe8fd6ac24
2018-02-12MNCC: Copy bearer_cap from MNCC to gsm_transHarald Welte1-1/+6
When we receive bearer capabilities from MNCC and encode thme into a CC message, we have to also update our "cache" inside 'struct gsm_trans'. Only that way, the BSSMAP ASSIGNMENT code is aware of the actual current/present bearer capabilities such as permitted speech codecs. This will in practise only work if the related CC/MNCC message with berer_cap IE will happen before the MSC performs the BSSMAP ASSIGNMENT procedure. Our logic still needs to change in a way that the CC/MNCC code in gsm_04_08.c detects if trans->bearer_cap != new bearer_cap, and in that case triggers a new follow-up BSSMAP ASSIGNMENT. Change-Id: I6838dc0c8c4c2c6bba385da548c92f3fc91060c1 Closes: OS#2854
2018-02-12MT Calls: Copy bearer capabilities from NNCC primitive to transHarald Welte1-1/+5
When we receive a MNCC_SETUP_REQ primitive from the external MNCC handler, we must not only encode it into the TS 04.08 CC SETUP, but also keep it around in the "trans" structure representing this voice call, as it is needed e.g. at BSSMAP ASSIGNMENT time. Change-Id: Ib6919d148ff6687112e8166dbde947be19e70a76 Related: OS#2322 Closes: OS#2929
2018-02-12a_iface: Consistent and understandable function namesHarald Welte1-4/+4
Change-Id: I36894e68e4b1f25f266e941c39a44e0171d24689
2018-02-12a_iface: s/Abis/L3/ for speech version/preference fieldsHarald Welte1-6/+6
There is no encoding of speech version / preference on Abis, only on L3. L3 is carried on Um, Abis and A. Hence, referrin to Abis in function names and comments is irritating. Change-Id: Id226cd1414ca2a92356801bc71f43102d03ba37e
2018-02-10MGCP: Response code 250 is *not* an error for DLCXHarald Welte1-1/+2
Change-Id: I9f64996bfff09561f253115681ed63ee87b90ef3 Closes: OS#2923
2018-02-10a_iface: Fix heap-use-after-free in a_clear_all()Harald Welte1-3/+5
We cannot use conn->a.conn_id after conn has been free'd inside msc_clear_request(). Let's store conn_id before that call to ensure we avoid an use-after-free situation. A more elegant (but more intrusive) solution would be to move the SCCP connection clearing into the FSM itself. Change-Id: Ibe41aa503e9f7cbeb05dce4b1a20b3eac85e619f Closes: OS#2922
2018-02-09Add VTY command to configure destination MSISDN for emergency callsHarald Welte3-0/+38
As in GSM/3GPP networks emergency calls carry no explicit destination number/address, add a VTY commadn to patch in some destination handler in the EMERGENCY SETUP before delivering to [internal or external] MNCC. Change-Id: I7c9f43ba312fadda2b9a9483b3cf50e4abca9599
2018-02-09a_iface: Fix heap-use-after-free by cleaning up msgb ownershipHarald Welte2-70/+20
When we receive a msgb-wrapped primitive from the SCCP provider (stack), it transfers msgb ownership to us (the SCCP user). The existing code passed the msgb ownership down into all the various downstream functions, which each then had to take care of msgb free'ing. Not all of the paths did eventually free the msgb. And at least one path used data from the primitive *after* the free Let's restructure this in a way that no msgb ownership is transferred down the call chain. Instead, there's one common msgb_free() in sccp_sap_up(). We can do this as nobody is queueing or otherwise keeping the msgb. Change-Id: Ie65616ccb55ec58a0224bbe3c8e004e6029ef3e6 SUMMARY: AddressSanitizer: heap-use-after-free /home/laforge/projects/git/osmo-msc/src/libmsc/a_iface.c:538 in sccp_sap_up
2018-02-09Introduce new BSSAP logging category/subsystemHarald Welte5-42/+49
Having all BSSAP related logs in the "DMSC" category is overly generic, and dosn't provide useful granularity. Change-Id: Id1e52dad03840dfd026fb23f3845a8771c8cc308
2018-02-09a_iface: Add copyright statement (after recent contributions)Harald Welte2-0/+2
Change-Id: I3f5dedb045a9ae9b93b00a8388a73ed77e67f19f
2018-02-09cosmetic: a_iface: More logging harmonizationHarald Welte1-4/+4
Change-Id: I66139862c4d821fcce0334207ce84fffbd08b4e3
2018-02-09a_iface: centralize lookup of subscriber_connHarald Welte1-73/+42
There's little point in resolving the gsm_subscriber_connection in each and every function handling connection-oriented messages. We can resolve it once and dispatch the already-resolved conn into the function, instead of passing the raw sccp_user and a_conn_info. Change-Id: Iea85527ea4d4cde7b36cc28a8027362c1570518f
2018-02-09cosmetic: No need for 'break' after 'return'Harald Welte2-20/+0
This just makes the code longer with no added benefit. Change-Id: If689b8284a669021219eff0397c6e90570e2aaa4
2018-02-09cosmetic: a_iface: Harmonize log statementsHarald Welte2-13/+13
Clean up the log statements in a_iface*.c, which was very inconsistent. For example "BSC sending" is very confusing. We are receiving from the BSC, and it did already send the message, it is no longer in the process of sending it if we have already received it in the MSC. Change-Id: Id50e964d86713ae506d4e7657159797e09501d99
2018-02-09a_sccp_rx_dt(): Don't print hexdump of message multiple timesHarald Welte1-2/+0
We don't need to hexdump it in a_sccp_rx_dt() and then again in rx_bssmap() or rx_dtap(). Change-Id: I2caa8e0af236983430155f9c808de913377d5780
2018-02-09a_iface_bssap.c: Use LOGPCONN() whenever possibleHarald Welte3-26/+27
Change-Id: Ic1c9d14b892154d51165598338d23a924a772265
2018-02-09a_iface: Reduce log levelsHarald Welte2-18/+18
During normal operation, regular messages occurring during processing of a call / transaction should not be higher than LOGL_INFO. Change-Id: Ibd04ade47b249406696c7d0b660474afc4f4adee
2018-02-09cosmetic: Use msgb_hexdump*() rather than manual osmo_hexdump() on msgHarald Welte6-18/+16
This requires libosmocore Change-Id I98e85397fb541ee0fd711f2e1852f63f3bb87359 Change-Id: Ieeb97a9f1eba2fdef84294b8c8c7ac0984ae5c70
2018-02-09Don't answer to BSC-originated RESET with another RESETHarald Welte4-56/+120
If the BSC is contacting us for the first time and sending a BSSMAP RESET, then we should simply ACK that and transition into the "connected" state, where connection-oriented and connectionless procedures are permitted. This patch is a bit large for such a seemingly simple behavioural change, but the existing data model didn't permit a more straight-forward implementation. Change-Id: Ie67e7ed20a6c42afe99bafef96d85a4e083dd057 Closes: OS#2914
2018-02-09a_reset: Add additional "a_reset_alloc" argumentHarald Welte3-5/+12
Using this argument we can create the state machine in the "already connected" state, i.e. without starting an outbound RESET procedure. Change-Id: Ibf569d57300965cd47084fa0bff54aa67679e2a1
2018-02-09VTY: Add 'show connections' and 'show transactions' commandsHarald Welte1-0/+112
It is quite important to have some way of runtime state introspection about the major objects inside osmo-msc. This patch adds some basic capabilities to dump the most important information about subscriber_connections and transactions (like calls/sms). OsmoMSC> show connection --ConnId ------------Subscriber RAN --LAC Use --Tokens CSA A5 State 00000001 IMSI:26242000000006 A 23 1 00000004 --- /0 SUBSCR_CONN_S_COMMUNICATING Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4
2018-02-08increase RAN timeout in MGCP FSMPhilipp Maier1-3/+2
The MGCP FSM implements a timeout when waiting for the RAN to complete the call (assignment complete, alerting, connect...). This timeout is currently set to 10sec. This means if the other end did not pick up after 10sec, the MGCP connection will be lost while the phone keeps ringing. When the other end finally picks up, the call gets disconnected. This behavior is odd and requires a proper fix. For now increasing the timeout to 120sec. will decrese the probability that he problem occurs. - Increas RAN timeout to 120sec (2 min). Change-Id: I5a11d53f9701d9b11b18d7026ff2241c7c0b57f5
2018-02-08GSUP: check osmo_gsup_encode() resultMax6-29/+69
Check and handle gracefully any error which might appear in osmo_gsup_encode() - mark corresponding functions with warn_unused_result attribute to make sure this failure is always checked against. Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5 Related: OS#2864
2018-02-07VLR tests: move network init into functionMax1-15/+25
That's a preparation step for properly splitting main function of different tests in follow-up function. Change-Id: I68a2e94cf79fcb83286eef981a8d88bdbe10ef69 Related: OS#2864
2018-02-07VLR tests: always print test parametersMax24-299/+293
For each test print: * the test number * IMSI Unfortunately tests are organized in such a way that we don't know the number of particular test in advance. Nevertheless, it make sense to always print it regardless of -v option presense. Related: OS#2864 Change-Id: I2e1d7701f5322d2311f32b796148a8b414f53b8e
2018-02-07VLR tests: remove weird codeMax1-1/+1
Having while(0) as a body for for() cycle generate too much WTF while looking at the code while not serving any obvious purpose. Let's just drop it to avoid confusing developers. Change-Id: I1f571ec319ff3231fd9acd4066e470476c3b1f78 Related: OS#2864
2018-02-07VLR tests: don't fail via assertMax1-4/+13
Don't fail tests using thwart_rx_non_initial_requests() via OSMO_ASSERT. Instead log extended error which will fail the test eventually but allows to gather additional info helpful for debugging. Change-Id: I2607cb1ac60941dbc22fca532ed2b3738bfbcc63 Related: OS#2864
2018-02-07Expand VLR testsMax12-6/+18
Print the IMSI used for each test. This enables expansion to tests with several IMSIs in follow-up patches. Change-Id: I7958608e5136351f7b7c0c57fe79791d989ce9c3 Related: OS#2864
2018-02-07VLR tests: mark static test functions as suchMax2-14/+7
Related: OS#2864 Change-Id: I5eac4c24257fd38068ba629d3c21848181703220
2018-02-07Move IMSI into test parametersMax8-52/+32
This makes test routines more flexible and allows to easier re-use them for tests with different IMSIs. Change-Id: I74d46fdb7e87dc04c6b82a0b6f3ce6bef60bde58 Related: OS#2864
2018-02-07Constify msc_subscr_conn_is_accepted() parameterMax2-2/+2
Related: OS#2864 Change-Id: I8af50a8847a5b438cf2ef660399d4c8bbac86a71
2018-02-06Fix whitespace issuesMax5-6/+6
We don't usually put space before in-place increment or decrement. Let's make code look similar to other Osmocom projects. Change-Id: I5962431ad16c97e412939dc1b8949f6361a5c26e
2018-02-05mgcp: use osmo-mgw to switch rtp streamsPhilipp Maier15-325/+1316
in the current implementation we still use osmo-bsc_mgcp, which has many problems and is also obsoleted by osmo-mgw. integrate osmo-mgw and re-implement the current switching using an osmo fsm. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062 Closes: OS#2605 Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538
2018-02-05a_iface: correct data type for a.conn_id in gsm_subscriber_connectionPhilipp Maier1-1/+1
conn_id is modeled as int, but should be uint32_t. - change conn_id from int to uint32_t Change-Id: Ibf14d7c9a547c4eeb873975e7dcddef223e7df46 Related: OS#2769
2018-02-05Wrap osmo_strlcpy() callsMax7-36/+34
Using following semantic patch: @@ expression A, B, C; @@ - osmo_strlcpy(A, B, sizeof(A)); + OSMO_STRLCPY_ARRAY(A, B); Which was applied using following command: spatch --dir src -I src --sp-file strlcpy.spatch --in-place --recursive-includes All the calls to osmo_strlcpy() which use destination buffer obtained via sizeof() were replaced with the corresponding wrapper macro. Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Related: OS#2864
2018-02-03Implement checks for duplicate uplink UL L3 messageHarald Welte3-0/+137
According to TS 24.007 Section 11.2.3.2.3, it is possible that uplink L3 messages are duplicated in some scenarios, particularly during assignment/handover procedure. To avoid L3 entities from seeing duplicated messages, there's a modulo-2 or modulo-4 message sequence counter, based on which the MSC can detect and suppress such duplicate messages. It appears that even our unit tests were wrong in that regard so far. Rather than manually adjusting each and every message, let's make sure that the sequence number generation always increments as expected, and that during matching of incoming messages, sequence numbers are masked out. Note: the tests will only pass from libosmocore Change-Id Iec875a77f5458322dfbef174f5abfc0e8c09d464 onwards, due to gsm48_hdr_msg_type() being broken in earlier versions. Change-Id: Id15e399ab7e1b05dcd426b292886fa19d36082b1 Closes: #2908
2018-01-31Make sending an SMS to an unknown subscriber B work over SMPP.Stefan Sperling1-3/+9
Make the submit_to_sms() funcion aware of the message mode. If the message does not require real-time "transactional/forward mode" we can store it in the SMS database even if subscriber B cannot be found in the VLR at this point in time. This should should make the esme_ms_sms_storeforward test in osmo-gsm-tester pass (a tweak to this test's expectations will be needed as well, because the test currently assumes that an invalid phone number for subscriber B will fail immediately, rather than cause the message to eventually expire). Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Related: OS#2354
2018-01-30Remove unused codeMax4-127/+0
The socket.* is unused leftover from pre-split time. Fixes: CID57645 Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0
2018-01-28Change GSUP re-connect interval to 1sHarald Welte1-1/+4
This leads to faster recovery in case of link loss. It also makes the TTCN-3 test suite run much faster, as each test case will inherently terminate the GSUP connection. Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf
2018-01-28MSC: Intersect configured A5 algorithms with MS-supported onesHarald Welte1-1/+65
There's no point of ever asking a MS to perform ciphering using an algorithm it advertises no support for. Let's hence use CLASSMARK information to figure out the intersection between MSC policy (VTY command) and MS-reported CLASSMARK. Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3
2018-01-28Permit a set of multiple different A5 ciphersHarald Welte8-30/+49
So far, the administrator had to pick one particular cipher which would then be used throughout all subscribers/phones. This is a bit impractical, as e.g. not all phones support A5/3. Extend the VTY command syntax in a backwards-compatible way to permit for multiple ciphers. NOTE: Like the previous code, OsmoMSC does *not yet check* whether the configured cipher is compatible with the MS capabilities as reported in CLASSMARK! The network hence might choose an algorithm not supported by the phone. Fixing this is subject to another patch. Closes: OS#2460 Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b
2018-01-28Shift ciphering algorithm selection from VLR to MSCHarald Welte10-73/+47
The VLR code seems to have the assumption that there is one particular algorithm to be used, as opposed to one of a set of algorithms. What's missing is basically to decide when/where to pick the best algorithm within the capabilities of the phone (classmark) and the network configuration (net->a5_encryption_mask). So far, libvlr has no notion of classmark. Rather, libmsc has. Why does the VLR care about the particular algorithm at all? The VLR should probably simply decide if it should use encryption or not, and if so, the MSC will figure which algorithm to use. Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89
2018-01-25Delete expired SMS automatically.Stefan Sperling3-14/+48
Delete expired SMS whenever we are done processing an SMS-related signal. In order to minimize additional latency only one SMS is removed at a time. Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Related: OS#2354
2018-01-25Accept SMS for any receiverStefan Sperling1-3/+4
Accept any SMS and store it in the database, even if the receiver of the message cannot be determined when the message arrives at the MSC. This fixes https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Depends: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Depends: I56cbe716e52b679c4b94f6cbb4a171306975be2e Depends: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Related: OS#2354
2018-01-25Add a VTY command which deletes all expired SMS.Stefan Sperling5-7/+85
We already delete SMS which have been sent successfully. However, there are plans to accept SMS for any subscriber in order to fix the problem described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). This means we may end up storing SMS which never get sent, e.g. because the B subscriber doesn't actually exist. This could lead to a higher degree of SMS database growth over time, and therefore we need a way to keep database size under control. As a first step, introduce a DB function which removes an expired SMS, and add a VTY command which removes all expired SMS from the DB. Later commits will build upon this to remove expired SMS automatically. The SMS expiry time period is currently hard-coded to 2 weeks. We could make this configurable in the future if desired. Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354
2018-01-25debug: Remove dead log categoriesHarald Welte5-94/+4
Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Related: OS#2528