aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msc_vlr/msc_vlr_test_call.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-08cosmetic: rename to sdp_audio_codecs_foreach()Neels Hofmeyr1-1/+1
Better match the pattern of sdp_audio_codecs_* instead of having foreach_ in the front. Prepare for prepending osmo_ some day, because I plan to move the SDP API to a separate library. Change-Id: Ia96190e0bdb513886663be1c8c12be3b403b71c9
2024-02-08msc_vlr_test_call.c: fix misleading commentsNeels Hofmeyr1-2/+2
The comments indicating which two "members" are identical are inaccurate. (One of them is a macro pointing at the other.) Change-Id: Ifaa2f361db77cd0ed3ad39d6ca197195b9354ea1
2023-12-13test_call: codecs: test specific PT from MO to MTNeels Hofmeyr1-0/+38
Previously added codecs tests uses non-default PT number sent by MT and adopted by MO. Also test the other direction, i.e. a non-standard PT from MO is adopted by MT. Related: OS#6258 Change-Id: I8fbabe242982441d676d09f4d0ed7557c8349f2c
2023-12-13test_call: codecs: allow specific PT numbers [2/2]Neels Hofmeyr1-6/+35
In msc_vlr_test_call.c, allow to tell MO non-default payload type numbers in the SDP, to verify that it adopts the other call leg's PT numbers. Actually apply the non-default payload type number (AMR=96 instead of the default of 112 from codec_mapping.c) and see the effects in msc_vlr_test_call.err. The diff shows that, as intended, the change in payload type number should result in modifying the MGW endpoint to change the earlier '112' to the modified '96' used in this test. Related: OS#6258 Change-Id: I25df2ed7ad792fbe66dfd0fbf08182c9cf6cfc5b
2023-12-13test_call: codecs: allow specific PT numbers [1/2]Neels Hofmeyr1-0/+37
In msc_vlr_test_call.c, allow to tell MO non-default payload type numbers in the SDP, to verify that it adopts the other call leg's PT numbers. This test differs only slightly from the first codecs test, so in this patch add the test as a 1:1 copy of the first test. The next patch [2/2] will then show only the difference the new test makes. Related: OS#6258 Change-Id: I618e3cf1b412985589a0c63bd76b7a60202f17b9
2023-12-13msc_vlr_test_call: codecs: properly test new codec matchingNeels Hofmeyr1-27/+89
In patch I8760feaa8598047369ef8c3ab2673013bac8ac8a, osmo-msc learns to handle codec mismatches reported by MT. For simplicity, that patch cuts short the msc_vlr codecs tests by validating only the first codec. Now test the full list of codecs properly. This also introduces testing the re-assignment that MO does to match MT's codec limitations, and removes the "EXPECTED FAILURE" markers. Related: OS#6258 Change-Id: Ib933554f826c1b4347dfa3f6c4f6fe086be8b133
2023-12-13msc_vlr_test_call: drop misleading logNeels Hofmeyr1-7/+7
It was true once, but not since "do CN CRCX first" Ie433db1ba0c46d4b97538a969233c155cefac21c Related: OS#6258 Change-Id: I94e430e4e5b5bf18dbb155258d82f599ada453e6
2023-12-13implement re-assignment to match codecsNeels Hofmeyr1-0/+3
This is the last missing piece that allows osmo-msc to make good TFO codecs choices. Since the codec_filter, osmo-msc properly gathers codec options and limitations. But the MO call leg still assigns a voice channel before getting a response from the MT call leg, and is then stuck with that. Add the capability to adjust the MO call leg's codec in case the MT side needs a different codec for TFO. This is only relevant for 2G; on 3G we always have AMR/IuUP. For inter-MSC handover, keep the behavior unchanged: offer only the currently assigned codec to the remote side. Codec-changing HO should be equally trivial to implement, but that is for another day. msc_vlr_test_call's codec tests are adjusted to test the new feature in Ib933554f826c1b4347dfa3f6c4f6fe086be8b133. For now, avoid change in these tests by validating the first codec in SDP lists only. Related: OS#6258 Related: osmo-ttcn3-hacks I402ed0523a2a87b83f29c5577b2c828102005d53 Change-Id: I8760feaa8598047369ef8c3ab2673013bac8ac8a
2023-03-26fix msc_vlr_test_call SDP mncc_rtpNeels Hofmeyr1-15/+38
In msc_vlr_test_call, we fail to send the right MNCC struct for MNCC_RTP_CREATE. We should pass a struct gsm_mncc_rtp. Fix that. Change-Id: Ia0b3253f85c716e45f925da3f58f025af1f15ec9
2023-03-18[codecs filter] msc_vlr_test_call: test codecs resolutionNeels Hofmeyr1-0/+725
Show that the codecs filter now works as expected in call messaging. Related: SYS#5066 Change-Id: I879ec61f523ad4ffc69a0b02810591f7c0261ff9
2023-03-18do CN CRCX firstNeels Hofmeyr1-43/+51
In order to send the MSC's RTP endpoint IP address+port in the initial SDP, move the MGCP CRCX up to an earlier point in the sequence of establishing a voice call. Update the voice call sequence chart to show the effects. Though the semantic change is rather simple, the patch is rather huge -- things have to happen in a different order, and async waits have to happen at different times. The new codec filter helps to carry codec resolution information across the newly arranged code paths. Related: SYS#5066 Change-Id: Ie433db1ba0c46d4b97538a969233c155cefac21c
2023-03-18msc_vlr_tests: confirm crcx by RAN/CN side separatelyNeels Hofmeyr1-10/+10
Upcoming patch 'do CN CRCX first' changes the ordering of MGCP. To properly show the change in behavior in the msc_vlr_test_call, first clarify which side is expected to do MGCP when. Related: SYS#5066 Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
2023-03-18[codecs filter] send + receive SDP via MNCCNeels Hofmeyr1-2/+45
Transmit and receive full SDP information via MNCC, to accurately pass codecs choices between the call legs. In msc_vlr_test_call.c test_call_mt(), show that when receiving MNCC, the codec information in SDP overrules the Bearer Cap codec information -- we expect to still receive inaccurate Bearer Cap from e.g. osmo-sip-connector, because we have chosen to add SDP to MNCC instead of trying to fix the codecs represented in Bearer Cap. For internal MNCC, the MT call leg now knows which codec the MO has chosen and assigned. For external MNCC, osmo-sip-connector receives SDP about our codecs choices and sends it in SIP messages, and we also receive the full SDP information from the remote SIP leg. Update the SDP in codec_filter every time it is received, to always have the latest SDP information from the remote leg. CC MNCC | ---ALERTING--> | add local side SDP to MNCC msg | <--ALERTING--- | store remote side SDP | <--SETUP-RESP- | store remote side SDP | --SETUP-CNF--> | add local side SDP to MNCC msg | -RTP-CREATE--> | use codec_filter, add local side SDP to MNCC msg | <-RTP-CONNECT- | store remote side SDP There still is one problem: when initiating MNCC, we do not yet know the RTP address and port to be used for the CN side, because the CN CRCX happens later. So far we send 0.0.0.0:0 as RTP endpoint in the SDP, until the CN CRCX is done. A subsequent patch moves CN CRCX to an earlier time, adding proper RTP information right from the start. Related: SYS#5066 Change-Id: Ie0668c0e079ec69da1532b52d00621efe114fc2c
2023-03-18[codecs filter] use filter result in MT DTAP CC SetupNeels Hofmeyr1-2/+2
So far, we just forwarded the Bearer Capabilities received in MNCC from the remote MO call leg, and omitted Bearer Cap if the remote call leg did not provide any. Instead, always include Bearer Cap, and compose it from the codecs filter result. Hence the Bearer Cap is now an intersection of MS, BSS and remote call leg, instead of just the remote call leg. Related: SYS#5066 Change-Id: I9586221ef56352b7ce4b2604ae0dc04554145a78
2023-03-18in ran_msg, return gsm0808_speech_codec (intra-MSC)Neels Hofmeyr1-5/+5
Do not convert to enum mgcp_codecs, but directly pass the gsm0808_speech_codec IE from the A interface to codecs handling. For Iu: - RAN side: use ran_infra.force_mgw_codecs_to_ran to keep the MGW endpoint towards RAN on IUFP. - CN side: introduce flag ran_msg.assignment_complete.codec_with_iuup, so to decide whether to forward IUFP towards CN, we don't need to test the RAN type, but use the flag from the ran_msg implementation. In msc_vlr_tests, use the SDP codec string instead of enum mgcp_codecs. So far limit to intra-MSC related messaging, adjusting inter-MSC handover follows in a separate patch. Change-Id: Ia666cb697fbd140d7239089628faed93860ce671
2021-11-05Validate the choosen UTRAN encryption algorithmAlexander Couzens1-6/+6
RANAP Security Command can include an encryption IE. If it includes it the RNC can still ignore it (e.g. unsupported encryption) and return the Security Command Complete with an choosen encryption IE: "no encryption". Validate the encryption element and ensure the encryption is included in the encryption mask. Closes: OS#4144 Change-Id: Icfc135c8b8ae862defe7114db492af600c26407f
2021-02-09fix _gsm48_cc_trans_free(): send MNCC REL.ind on Clear RequestVadim Yanitskiy1-5/+1
Calling gsm48_cc_tx_release() before mncc_release_ind() has a side effect: the former may change CC state to GSM_CSTATE_RELEASE_REQ. This makes the later send MNCC_REL_CNF instead of MNCC_REL_IND, so if one of the call leg disconnects due to RF failure, the other one will not be terminated correctly. Makes both TC_{mo,mt}_call_clear_request TTCN-3 test cases pass. Change-Id: I3ad4a99757878de3796027325627c87d9a4e93f1 Related: Id16969fe0de04445d1320a96d35cf1d48cc8cf09 Related: SYS#5340
2019-12-12gsup: indicate CN-Domain in SendAuthInfo RequestsNeels Hofmeyr1-2/+2
In order for osmo-hlr to be able to 100% guarantee distinct INDs for CS and PS, set CN-Domain = CS in all SendAuthInfo Requests. In Milenage auth, it is highly desirable that osmo-hlr guarantees use of distinct INDs for CS and PS domains. If an MSC and SGSN attached at the same time use the same IND bucket to generate Milenage SQN, that collision would rapidly waste SQNs and load osmo-hlr with requesting new auth tuples on each CS/PS Complete-Layer3. So far, osmo-msc did not indicate the CN domain in the GSUP SendAuthInfo Request, which was neither required nor evaluated. The CN-Domain is only sent for the UpdateLocation Request that usually follows later. Related: OS#4318 Change-Id: I22f44068268e62801cadbf6542efaf153423cd65
2019-11-28msc_vlr_test_call: rename lu_utran_tmsiNeels Hofmeyr1-6/+6
Change-Id: I46a41321e6d1be3672a56a6e3cc36f013fdcd396
2019-11-28msc_vlr_test_call.c: add MNCC loggingNeels Hofmeyr1-5/+7
Change-Id: I03b25c134553c620d3fa9d23a67ad39414546861
2019-11-05fix msc_vlr_test_call.cNeels Hofmeyr1-0/+97
Substantial parts of the CC / MNCC call establishment were so far completely missing from the msc_vlr_test_call.c tests. With my new insights on CC and MNCC procedures, complete the tests. Root reason: since I am going to re-order the sequence of events to enable codec negotiation via SDP in MNCC, I want to have comprehensive tests of the CC procedures to see the effect as diffs in the test output. Change-Id: Ie995e264eb1e3dd9558a1753ff6f9b55c1d084e1
2019-08-13add 'encryption uea 1 2' cfg / fix ttcn3 iu testsNeels Hofmeyr1-1/+0
Recently, the ability to run UTRAN without encryption was added, but the config for it was tied to the A5 GERAN encryption configuration. This affected osmo-msc's default behavior of Iu, breaking osmo-msc ttcn3 Iu tests: the ttcn3 test suite sets A5 to 0 (no encryption) but still expects Iu to enable air encryption. Fix this "regression". Add a separate vty config option for UEA encryption, even if it does not provide full granularity to select individual UEA algorithms yet. As a result, Iu default behavior remains to enable encryption regardless of the A5 config. UTRAN encryption can be disabled by the new cfg option "encryption uea 0" alone. Even though the new vty command already allows passing various combinations of the UEA algorithm numbers, only '0' and '1 2' are accepted as valid combinations, to reflect current osmo-msc capabilities. Revert most changes to the msc_vlr test suite in commit "do not force encryption on UTRAN" (I04ecd7a3b1cc603b2e3feb630e8c7c93fc36ccd7): use new net->iu_encryption instead of net->a5_encryption_mask. Adjust/add to test_nodes.vty transcript tests. Related: OS#4144 Change-Id: Ie138f2fcb105533f7bc06a6d2e6deccf6faccc5b
2019-08-05do not force encryption on UTRANNeels Hofmeyr1-0/+1
Remove the conditions that always enable encryption on UTRAN. We so far lack an explicit configuration for UTRAN encryption, and this patch does not add any either. Instead, whether UTRAN encryption is enabled is simply triggered on whether GERAN has A5 encryption enabled (A5/n with n > 0). Though GERAN and UTRAN encryption are not technically related at all, this makes UTRAN behave like GERAN for now, until we implement a proper separate configuration for UTRAN encryption. Adjust the msc_vlr_test_* configuration by setting the net->a5_encryption_mask such that the expected output remains unchanged. A subsequent patch (I54227f1f08c38c0bf69b9c48924669c4829b04b9) will add more tests, particularly cases of UTRAN without encryption. Adjust manual and vty doc. Related: OS#2783 Change-Id: I04ecd7a3b1cc603b2e3feb630e8c7c93fc36ccd7
2019-08-02Set coding in mncc_set_cause()Keith Whyte1-1/+1
GSM 04.08 10.5.4.11 The Release indication needs to have the Coding Standard set. For phones that would display a message on screen, such as "Number not in use", if the coding standard is not defined, the display may show "Error in Connection" Change-Id: Ib28b62a41d433e231cff5910d19455296b284df6
2019-06-03tests: share stubs.h from msc_vlr_test as stubs.cVadim Yanitskiy1-1/+0
We also need stubs for the upcoming db_sms tests. Due to a known bug of automake [1], we cannot use 'subdir-objects', so as a side effect this change introduces some autoreconf warnings. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752993 Change-Id: I8846c940f2695fd33e1007fecac83e73f508bb34
2019-05-09fix regression: fix internal MNCC operationNeels Hofmeyr1-1/+1
While developing the inter-MSC handover refactoring, I was annoyed by the fact that mncc_tx_to_cc() receives an MNCC message struct containing a msg_type, as well as a separate msg_type argument, which may deviate from each other. So, as a first step I wanted to make sure that all callers send identical values for both by inserting an OSMO_ASSERT(msg_type == msg->msg_type). Later I was going to remove the separate msg_type argument. I then forgot to - carry on to remove the argument and - to actually test with internal MNCC (it so happens that all of our ttcn3 tests also use external MNCC). As a result, the "large refactoring" patch for inter-MSC Handover breaks internal MNCC operation. Fix that: remove the separate msg_type argument and make sure that all callers of mncc_tx_to_cc() indeed pass the desired msg_type in msg->msg_type, and hence also remove the odd duality of arguments. Various functions in mncc_builtin.c also exhibit this separate msg_type argument, which are all unused and make absolutely no sense. Remove those as well. Related: OS#3989 Change-Id: I966ce764796982709ea3312e76988a95257acb8d
2019-05-08large refactoring: support inter-BSC and inter-MSC HandoverNeels Hofmeyr1-33/+27
3GPP TS 49.008 '4.3 Roles of MSC-A, MSC-I and MSC-T' defines distinct roles: - MSC-A is responsible for managing subscribers, - MSC-I is the gateway to the RAN. - MSC-T is a second transitory gateway to another RAN during Handover. After inter-MSC Handover, the MSC-I is handled by a remote MSC instance, while the original MSC-A retains the responsibility of subscriber management. MSC-T exists in this patch but is not yet used, since Handover is only prepared for, not yet implemented. Facilitate Inter-MSC and inter-BSC Handover by the same internal split of MSC roles. Compared to inter-MSC Handover, mere inter-BSC has the obvious simplifications: - all of MSC-A, MSC-I and MSC-T roles will be served by the same osmo-msc instance, - messages between MSC-A and MSC-{I,T} don't need to be routed via E-interface (GSUP), - no call routing between MSC-A and -I via MNCC necessary. This is the largest code bomb I have submitted, ever. Out of principle, I apologize to everyone trying to read this as a whole. Unfortunately, I see no sense in trying to split this patch into smaller bits. It would be a huge amount of work to introduce these changes in separate chunks, especially if each should in turn be useful and pass all test suites. So, unfortunately, we are stuck with this code bomb. The following are some details and rationale for this rather huge refactoring: * separate MSC subscriber management from ran_conn struct ran_conn is reduced from the pivotal subscriber management entity it has been so far to a mere storage for an SCCP connection ID and an MSC subscriber reference. The new pivotal subscriber management entity is struct msc_a -- struct msub lists the msc_a, msc_i, msc_t roles, the vast majority of code paths however use msc_a, since MSC-A is where all the interesting stuff happens. Before handover, msc_i is an FSM implementation that encodes to the local ran_conn. After inter-MSC Handover, msc_i is a compatible but different FSM implementation that instead forwards via/from GSUP. Same goes for the msc_a struct: if osmo-msc is the MSC-I "RAN proxy" for a remote MSC-A role, the msc_a->fi is an FSM implementation that merely forwards via/from GSUP. * New SCCP implementation for RAN access To be able to forward BSSAP and RANAP messages via the GSUP interface, the individual message layers need to be cleanly separated. The IuCS implementation used until now (iu_client from libosmo-ranap) did not provide this level of separation, and needed a complete rewrite. It was trivial to implement this in such a way that both BSSAP and RANAP can be handled by the same SCCP code, hence the new SCCP-RAN layer also replaces BSSAP handling. sccp_ran.h: struct sccp_ran_inst provides an abstract handler for incoming RAN connections. A set of callback functions provides implementation specific details. * RAN Abstraction (BSSAP vs. RANAP) The common SCCP implementation did set the theme for the remaining refactoring: make all other MSC code paths entirely RAN-implementation-agnostic. ran_infra.c provides data structures that list RAN implementation specifics, from logging to RAN de-/encoding to SCCP callbacks and timers. A ran_infra pointer hence allows complete abstraction of RAN implementations: - managing connected RAN peers (BSC, RNC) in ran_peer.c, - classifying and de-/encoding RAN PDUs, - recording connected LACs and cell IDs and sending out Paging requests to matching RAN peers. * RAN RESET now also for RANAP ran_peer.c absorbs the reset_fsm from a_reset.c; in consequence, RANAP also supports proper RESET semantics now. Hence osmo-hnbgw now also needs to provide proper RESET handling, which it so far duly ignores. (TODO) * RAN de-/encoding abstraction The RAN abstraction mentioned above serves not only to separate RANAP and BSSAP implementations transparently, but also to be able to optionally handle RAN on distinct levels. Before Handover, all RAN messages are handled by the MSC-A role. However, after an inter-MSC Handover, a standalone MSC-I will need to decode RAN PDUs, at least in order to manage Assignment of RTP streams between BSS/RNC and MNCC call forwarding. ran_msg.h provides a common API with abstraction for: - receiving events from RAN, i.e. passing RAN decode from the BSC/RNC and MS/UE: struct ran_dec_msg represents RAN messages decoded from either BSSMAP or RANAP; - sending RAN events: ran_enc_msg is the counterpart to compose RAN messages that should be encoded to either BSSMAP or RANAP and passed down to the BSC/RNC and MS/UE. The RAN-specific implementations are completely contained by ran_msg_a.c and ran_msg_iu.c. In particular, Assignment and Ciphering have so far been distinct code paths for BSSAP and RANAP, with switch(via_ran){...} statements all over the place. Using RAN_DEC_* and RAN_ENC_* abstractions, these are now completely unified. Note that SGs does not qualify for RAN abstraction: the SGs interface always remains with the MSC-A role, and SGs messages follow quite distinct semantics from the fairly similar GERAN and UTRAN. * MGW and RTP stream management So far, managing MGW endpoints via MGCP was tightly glued in-between GSM-04.08-CC on the one and MNCC on the other side. Prepare for switching RTP streams between different RAN peers by moving to object-oriented implementations: implement struct call_leg and struct rtp_stream with distinct FSMs each. For MGW communication, use the osmo_mgcpc_ep API that has originated from osmo-bsc and recently moved to libosmo-mgcp-client for this purpose. Instead of implementing a sequence of events with code duplication for the RAN and CN sides, the idea is to manage each RTP stream separately by firing and receiving events as soon as codecs and RTP ports are negotiated, and letting the individual FSMs take care of the MGW management "asynchronously". The caller provides event IDs and an FSM instance that should be notified of RTP stream setup progress. Hence it becomes possible to reconnect RTP streams from one GSM-04.08-CC to another (inter-BSC Handover) or between CC and MNCC RTP peers (inter-MSC Handover) without duplicating the MGCP code for each transition. The number of FSM implementations used for MGCP handling may seem a bit of an overkill. But in fact, the number of perspectives on RTP forwarding are far from trivial: - an MGW endpoint is an entity with N connections, and MGCP "sessions" for configuring them by talking to the MGW; - an RTP stream is a remote peer connected to one of the endpoint's connections, which is asynchronously notified of codec and RTP port choices; - a call leg is the higher level view on either an MT or MO side of a voice call, a combination of two RTP streams to forward between two remote peers. BSC MGW PBX CI CI [MGW-endpoint] [--rtp_stream--] [--rtp_stream--] [----------------call_leg----------------] * Use counts Introduce using the new osmo_use_count API added to libosmocore for this purpose. Each use token has a distinct name in the logging, which can be a globally constant name or ad-hoc, like the local __func__ string constant. Use in the new struct msc_a, as well as change vlr_subscr to the new osmo_use_count API. * FSM Timeouts Introduce using the new osmo_tdef API, which provides a common VTY implementation for all timer numbers, and FSM state transitions with the correct timeout. Originated in osmo-bsc, recently moved to libosmocore. Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Ib9af67b100c4583342a2103669732dab2e577b04 (libosmocore) Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 (libosmocore) Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 (libosmo-sccp) I26be5c4b06a680f25f19797407ab56a5a4880ddc (osmo-mgw) Ida0e59f9a1f2dd18efea0a51680a67b69f141efa (osmo-mgw) I9a3effd38e72841529df6c135c077116981dea36 (osmo-mgw) Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd
2019-04-12vlr_subscr: use osmo_use_countNeels Hofmeyr1-2/+2
Depends: Ife31e6798b4e728a23913179e346552a7dd338c0 (libosmocore) Change-Id: Ib06d030e8464abe415ff597d462ed40eeddef475
2019-02-04Add SGs InterfaceHarald Welte1-0/+1
Add an SGs interface (3GPP TS 29.118) to osmo-msc in order to support SMS tunneling and Circuit Switched Fallback (CSFB) Change-Id: I73359925fc1ca72b33a1466e6ac41307f2f0b11d Related: OS#3615
2019-01-04use osmo_rat_type from libosmocoreNeels Hofmeyr1-1/+1
Replace locally defined enum ran_type with libosmocore's new enum osmo_rat_type, and value_string ran_type_names with osmo_rat_type_names. The string representations change, which has cosmetic effects on the test suite expectations. Depends: I659687aef7a4d67ca372a39fef31dee07aed7631 (libosmocore) Change-Id: I2c78c265dc99df581e1b00e563d6912c7ffdb36b
2018-12-19Remove redundancy in LAC processingMax1-1/+1
Always use LAC which is part of Cell Global ID otherwise we might end up in a situation where separately stored LAC differs. Both are described in 3GPP TS 23.008 $2.4 as temporary subscriber data to be stored in VLR. Both are defined in 3GPP TS 23.003. The LAC is part of LAI which is part of CGI so there should be no case when those values differ for a given subscriber. Change-Id: I993ebc3e14f25e83124b6d3f8461a4b18f971f8e
2018-12-18VLR tests: avoid leaking LAC access detailsMax1-1/+1
Avoid leaking details on accessing data structure for LAC value into test output: that's irrelevant clutter which forces unnecessary test output modifications. Change-Id: I4a1d7884cf47ad513d7d6fb27c5c6f1b829dff2e
2018-11-30rename some RAN conn related stuff to ran_conn_*Neels Hofmeyr1-1/+1
Following previous rename of gsm_subscriber_connection: Some functions and #defines are still called like "msc_conn" or just "msc_", while they are clearly about a RAN conn. To avoid confusion with the future separate concepts of MSC roles and a RAN connection, rename all those to match the common "ran_conn" prefix. Change-Id: Ia17a0a35f11911e00e19cafb5d7828d729a69640
2018-09-30GSUP client: send CN domain IE on LU requestNeels Hofmeyr1-1/+1
Give the HLR a chance to send us updated subscriber data by indicating the CN domain to be Circuit Switched, only during a LU Request GSUP message. Adjust msc_vlr_tests to expect the added GSUP CN domain IE to indicate CS, i.e. append '280102'. Related: OS#3601 Change-Id: I0c2d33fbfdb4728e480679120d06b7f3a2ccfd76
2018-04-11properly receive BSSMAP Clear Complete and Iu Release CompleteNeels Hofmeyr1-0/+6
When sending a BSSMAP Clear or Iu Release, do not immediately discard the conn, but wait until a BSSMAP Clear Complete / Iu Release Complete has been received. Hence we will no longer show in the log that an incoming Release/Clear Complete belongs to an unknown subscriber, but will still be around to properly log the release. Related: OS#3122 Change-Id: Ie4c6aaba3866d6e5b98004e8870a215e8cf8ffc1
2018-04-10msc_vlr_test_call: reproduce OS#3062Neels Hofmeyr1-0/+81
A related ttcn3 test is added in Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 Related: OS#3062 Change-Id: Ice7197b48d4e163a3c4d97b559fdcd7e88c4107e
2018-04-03cosmetic: rename gsm_subscriber_connection->conn_fsm to ->fiNeels Hofmeyr1-3/+3
Match osmo-bsc's naming of the subscriber connection's FSM instance; 'conn->fi' makes more sense anyway than 'conn->conn_fsm'. BTW, an upcoming commit will do away with the legacy from libbsc/libmsc duality and firmly glue the conn allocation to the fi. Related: OS#3122 Change-Id: If442f2ba78d9722b1065ec30c9a13f372b6a8caa
2018-03-22trans_free: tear down conn when last transaction is doneNeels Hofmeyr1-9/+2
In trans_free(), call subscr_conn_release_when_unused(), so that we are sure to clean up after the last transaction is done. This fixes an error where a conn lingered after a CC failure, because that code path forgot to trigger cleanup. Rationale: so far we were triggering the release check after each DTAP dispatch (compl_l3 and "normal" DTAP), which is sufficient for properly closed transactions. We also need a check for when a timeout clears an erratic trans. Adjust test expectation of test_call_mo_to_unknown_timeout to show that the error is now fixed. msc_vlr_test_reject_concurrency now sees an additional release checking event when the SMS transaction is done, which is expected and does not affect the test otherwise. Related: OS#2779 Change-Id: I46ff2e9b09b67e4e0d79cccf8c04936f17281fcb
2018-03-15msc_vlr_tests: add CC Release test and test to catch OS#2779Neels Hofmeyr1-0/+169
These tests helped to debug issue OS#2779. Now that they're here we might as well keep them. The test test_call_mo_to_unknown shows that an MS answering to the Release Request works as it should: the conn is torn down. The test test_call_mo_to_unknown_timeout currently expects the error: the conn remains active if the CC Release times out. This bug and the test expectations will be fixed in I46ff2e9b09b67e4e0d79cccf8c04936f17281fcb. Change-Id: Ic3c84520bff8c3fc82512d03ff6ab97d21b8fb7a
2018-03-10msc_vlr_tests: clearly separate Ciph Mode from Security Mode checkingNeels Hofmeyr1-6/+6
Clearly distinguish between Ciphering Mode Command on GERAN and Security Mode Control on UTRAN. Cosmetic: explicitly verify the key strings in the testing code (not only in the expected output). Change-Id: Ica93ed06c4c63dc6768736d25231de8068001114
2018-03-02msc_vlr_tests: make all test functions staticNeels Hofmeyr1-3/+3
All functions in the individual msc_vlr_test_*.c files should be static; hence we would be warned if one of them were unused (forgotten to add to the tests array). Change-Id: Ia169c6a1443a48879ab4777e09c2040c48810bf6
2018-03-02msc_vlr_tests: revert IMSI parameter and test nr outputNeels Hofmeyr1-6/+6
Three recently merged commits take the msc_vlr_tests in a wrong direction. The IMSI is usually encoded in the hex streams. The rationale behind hex streams is that it is a) easily copied from a wireshark trace and b) exactly the bytes as sent by an actual phone. It is hard to parameterize the IMSI because we would have to employ our encoding functions, which I intentionally want to keep out of the loop here. The test number should not appear in the normal test output, so that adding a test or changing their order does not affect expected output for following tests. The nr is simply for manual invocation, only seen when invoked with -v. Revert - "VLR tests: always print test parameters" b0a4314911140b1599cccfc8171fcdab4cd9bfab. - "Expand VLR tests" d5feadeee8dd24f991df2892d6bcf0be8b0cf707. - "Move IMSI into test parameters" 093300d141c300651954473d73138b72de04d931. Change-Id: Ie1b49237746751021da88f6f07bbb9f780d077c9
2018-02-07VLR tests: always print test parametersMax1-6/+6
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
2017-11-27add msc_vlr_test_call to reproduce a sanitizer errorNeels Hofmeyr1-0/+341
On MT call, there is a bug in CC conn use which leads to an early free and use-after-free. Add msc_vlr_test_call to show both MO and MT call legs separately and reproduce the failure. It is visible in a sanitizer build (on debian 9). A subsequent patch will fix the bug: If0659a878deb383ed0300217e2c41c8c79b2b6a5 Related: OS#2672 Change-Id: I6c3ca0c660388b1e2c82df17ec540c846201b0c7