Commit Graph

7309 Commits

Author SHA1 Message Date
Neels Hofmeyr c19f8fe917 fixup for re-est: do not succeed on acceptance fail
Fix a bug introduced in commit
 implement CM Re-Establish for voice calls
 ae98b97382
 Neels Hofmeyr <neels@hofmeyr.de>
 Thu Jul 29 22:40:59 2021 +0200
 I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

We should only succeed when conn_accepted == true!

Related: SYS#5130
Change-Id: I3679162143e8d7d8c0878de2102faa11eadfccfc
2024-04-03 20:56:10 +02:00
Neels Hofmeyr 0cc03ca427 never page for TMSI with 'no assign-tmsi'
With 'no assign-tmsi', regard any TMSI as invalidated at the end of a
Location Updating procedure. Hence, avoid paging by TMSI.

When 'no assign-tmsi' is set, osmo-msc does not actively assign a new
TMSI at the end of the Location Updating. However, it stores any TMSI
identity that the MS sends in a Location Updating Request. So far, this
caused osmo-msc to use the TMSI that the MS had sent in subsequent
Paging, which goes unanswered by the MS.

(After the long standing evil twin problem regarding TMSI MI has been
fixed in recent Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd, there is no
longer an evil twin risked by clearing out a TMSI.)

Related: SYS#6860 OS#4721
Change-Id: I583682d1a35a70b008d7bb2d89ba7c3109a60b21
2024-03-28 04:06:58 +01:00
Neels Hofmeyr 2fd69e15d3 fix VLR evil twin on LU with unknown TMSI
When a subscriber first attaches by TMSI only, and later tells the IMSI
via ID Response, it may turn out that this IMSI already exists in the
VLR database. If this happens, the TMSI that the subscriber issued was
not known in the existing VLR entry, indicating that the subscriber has
in the meantime camped on a different core. Which means we can assume
that there cannot be any active connections, and the old subscriber can
be discarded, for the benefit of the new one.

(We could also discard the new one, but it is more complex to reparent
the ongoing FSMs for Compl L3 than to copy some dormant VLR state.)

In vlr_subscr_set_imsi(), check for an existing IMSI entry in the VLR.

If such exists, copy any pending Paging and auth tuple state to the new
subscriber, and discard the old one from the VLR.

In order to safely discard a vlr subscriber by force, add a new vlr_ops
function: subscr_inval(), to tell the MSC that a vlr_subscr is no longer
valid.

Upcoming patch I583682d1a35a70b008d7bb2d89ba7c3109a60b21 better clears
TMSI state from the VLR, making it more likely to hit the evil twin
situation this patch fixes; hence this is, sort of, preparation.

Related: SYS#6860 OS#4721
Change-Id: Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd
2024-03-28 04:06:58 +01:00
Neels Hofmeyr 72ef7d8bb0 invalidate vsub->msc_conn_ref when msc_a is discarded
We have an msc_conn_ref pointer from vlr_subscr to an active msc_a
instance. So far, we just keep it pointing at discarded memory. Instead,
make sure it goes back to NULL when the msc_a instance deallocates.

This way the VLR can reliably tell whether a given VLR entry still has
an active connection or is just inactively caching the subscriber.

Related: SYS#6860 OS#4721
Change-Id: Ic63d01d220b63453976fe06a7c6b606f97172c99
2024-03-26 03:20:00 +01:00
Harald Welte c35f3074e5 README.md: Add links to forum + issue tracker
Change-Id: I1cad803af112241cef1c83a5ab7c19ae36c439df
2024-03-23 12:47:12 +01:00
Harald Welte 6c0479725f README.md: More hyperlinks and add more interfaces / features
Change-Id: Ic7e64d157969d466b3e1d423e20be5513a7c17fd
2024-03-23 12:45:16 +01:00
Harald Welte 475e70f44f Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: Id0aeb6d5c9a6bf0019eb96f25eb119fa0b5e583e
2024-03-23 12:36:00 +01:00
Vadim Yanitskiy b03001199a msc_a_up_call_assignment_complete(): handle all CSD modes
Change-Id: I92f7ab11ebc2e53700b27c38e91679c2c6f72050
2024-03-01 07:11:47 +00:00
Vadim Yanitskiy f09832a395 libsmpputil: fix -Wtautological-constant-out-of-range-compare
* 'sizeof(sms->user_data)' evaluates to 256
* 'ud_len' is of type 'uint8_t' and cannot be greater than 256

Change-Id: Ia71a0b6b9421911dc5113782d2f555a640fd90ed
2024-03-01 07:11:47 +00:00
Vadim Yanitskiy d851b2c029 libmsc: fix -Wenum-conversion in subscr_conn_toss()
This commit simply fixes a -Wenum-conversion thrown by clang.
No idea why are we using the SM (GPRS Session Management) cause values.
msc_a_release_mo() does not even use the given SM cause value.

Change-Id: Iade6bf97466ab2b3b39e9ea123fc90d06c0f6a9b
2024-03-01 07:11:47 +00:00
Vadim Yanitskiy 398cb299f9 libvlr: fix auth_fsm_term(): use proper value-string for cause
Change-Id: Ia0868dce2da5cb78c30cf518870c3d91144499b9
2024-03-01 07:11:47 +00:00
Vadim Yanitskiy d8b75fbfc8 libvlr: fix wrong cause value passed to auth_fsm_term()
This was found thanks to clang (-Wenum-conversion):

warning: implicit conversion from enumeration type
         'enum gsm48_gmm_cause' to different enumeration type
         'enum gsm48_reject_value' [-Wenum-conversion]

Change-Id: I0b820bb2a8e561682a8158fc51bd9565f5912d56
2024-03-01 07:11:47 +00:00
Vadim Yanitskiy 3b82d2c226 libvlr: auth_fsm_wait_ai(): cosmetic: drop redundant break
Change-Id: Iaa2962bfe67902f6b4aa944b73fa97db46bc9c54
2024-03-01 07:11:47 +00:00
Harald Welte 1b1a39bea1 Fix license headers: Should have been AGPLv3+, not GPLv2+
I'm not sure why so many files (particularly written by Neels)
did contain a GPLv2+ header, instead of the AGPLv3+ which is the
actual overall project license.  I consider it a mistake.

In any case, any copyrightable contribution to those files was done by
sysmocom employees, so I as managing directory can legally make a
license change, whther or not it was a mistake early on or not.

The only GPLv2-or-later file remaining is mncc_internal.c, as it has
more contributors and a longer history.

Change-Id: I8650697592b3160c4d0a7c61ae9c46d4aacb3bef
2024-02-19 20:49:43 +00:00
Neels Hofmeyr 0ebc911814 pick up all *.vty in EXTRA_DIST
(Same as osmo-bsc I47c9011b5e0e2886d221e34e6aa281d1dd0495c7)

*.vty tests are picked up by the Makefile.am by means of a wildcard --
they are run when they are there. So when you forget to add it to
EXTRA_DIST, it will be run in your local build tree, but it will be
silently omitted from a distribution tar, and nothing will complain
about it gone missing.

Instead, also use a *.vty wildcard in EXTRA_DIST. So any *.vty test
added to the git source will both be run *and* included in distribution
tars implicitly.

So far, test_neighbor_ident.vty was missing from the distribution.

Change-Id: Id28e020fc59b83d1b4cd0e5b72314a46bea62259
2024-02-13 18:28:16 +00:00
Neels Hofmeyr c8bf895a04 cosmetic: rename to sdp_audio_codecs_foreach()
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-08 23:42:17 +01:00
Neels Hofmeyr 100f8f9027 report caller's file,line in trans_cc_filter_run()
When we get the codec filter result logged, it is most interesting to
know the caller. So wrap a file-line macro around trans_cc_filter_run().

Change-Id: I243404487c1871e921b08098086ef2fc78a5561d
2024-02-08 23:42:17 +01:00
Neels Hofmeyr fb18315bdc msc_vlr_test_call.c: fix misleading comments
The comments indicating which two "members" are identical are
inaccurate. (One of them is a macro pointing at the other.)

Change-Id: Ifaa2f361db77cd0ed3ad39d6ca197195b9354ea1
2024-02-08 23:42:17 +01:00
Neels Hofmeyr bc0865b17b tweak apidoc for sdp_audio_codecs_remove()
Change-Id: I1d281f61497336783126aef39165426523b22112
2024-02-08 23:42:17 +01:00
Neels Hofmeyr 28672a5370 cosmetic: tweak sdp_audio_codecs_by_payload_type()
No functional change, only more readable code.

Change-Id: I3c4e29cb240e2a9a00bc9dd065ec85a5e8d8fe38
2024-02-08 23:42:17 +01:00
Neels Hofmeyr bd8ac51b60 cosmetic: move check for CSD further above
Currently the CSD check is in the middle of figuring out the voice codec
for normal voice calls. Rather do the CSD check first, and then do voice
in one coherent section.

(prep for upcoming change in this code, to support AMR rate selection.)

Change-Id: Ibd21f0bb46c66a406904105564ce961a8760cbe7
2024-02-08 23:42:17 +01:00
Neels Hofmeyr 1a07bcd1bb fix misnomer in msc_a.c: codec_cn -> codec_assigned
Before the codec filter, it would have been the CN side codec, but now
it is only the codec that the RAN reports as assigned, fed into the
codecs filter.

(prep for upcoming change in this code, to support AMR rate selection.)

Change-Id: Ie7966099c5565013018734b0c2028484c24341a7
2024-02-08 23:42:17 +01:00
Neels Hofmeyr b58024ee88 tweak example osmo-msc.cfg: 001 01
We have support for leading zeros there, so let's show it off.

Change-Id: I96c3495d0ab098535e34915f13979fb82b2e85cb
2024-02-08 23:42:17 +01:00
Pau Espin 6f2749ce0d vlr: Use new libosmogsm struct osmo_gsup_pdp_info fields
This also makes sure it doesn't compile against older libosmogsm gsup
versions which would break ABI.

Related: OS#6091
Depends: libosmocore.git Change-Id 70be3560659c58f24b8db529c4fc85da4bb0ec04
Change-Id: Ia002fd6e0334d56de34d352a0bf1a8604e2e9fd3
2024-01-26 18:07:43 +00:00
Vadim Yanitskiy 9d3635f7f7 build: include README.md into the release tarball
Change-Id: I43ad599c9a8eb21fb8713704cc8cb117512e086f
2024-01-26 23:36:01 +07:00
Andreas Eversberg b4573e57fa ASCI: Remove debug line, used during development process
Change-Id: Ie297353146cf30360a7030a2d5ee03e3391cce64
2024-01-24 08:50:12 +00:00
Andreas Eversberg 79e7b7d213 Add LLC and HLC information forwarding to MNCC interface
low/high layer compatibility are used for capability checking between
caller and called entitiy. The transcoding is performed by libosmogsm.

Related: OS#6152
Depends: libosmocore.git Ia6a2159ecf810a02f85b558026edf20b934567de
Change-Id: I760980a7e17e2fa81615adc69ef85797eb0c07f1
2024-01-24 08:50:12 +00:00
Andreas Eversberg 934f43bd1f Add LLC and HLC information to MNCC interface definiton
low/high layer compatibility are used for capability checking between
caller and called entitiy.

The information is added to the end of struct gsm_mncc increases, so
that the version number needs not to be incremented.

Related: OS#6152
Change-Id: I15f5afcf069ee6c1c4641108ceacc837bee311b5
2024-01-24 08:50:12 +00:00
Pau Espin a456583d50 cosmetic: vlc: Fix whitespace formatting in struct sgsn_subscriber_pdp_data
Change-Id: If6194e778dc5a4a140c7893a74cafcb6511d5803
2024-01-19 21:09:27 +01:00
Vadim Yanitskiy 8236184ef0 SMS-over-GSUP: set Source Name IE for *all* messages
We do include this IE in result and error messages, but somehow
not in the request messages.  For the sake of consistency, let's
ensure that the Source Name IE is present in all SMS related PDUs.

This additionally brings osmo-msc in sync with ttcn3-msc-test, which
was modified to expect the Source Name IE in all receive templates,
and makes the following testcases pass [again]:

* MSC_Tests.TC_gsup_mo_sms
* MSC_Tests.TC_gsup_mo_smma
* MSC_Tests.TC_gsup_mo_mt_sms_rp_mr

Change-Id: I65f5e3b7a0688e258979bb2679598659881a4321
Related: osmo-ttcn3-hacks.git Ic24d3082fe3dce08e43e8f3ecb6d6132503c55c6
Related: OS#6135
2024-01-09 22:26:43 +07:00
Vadim Yanitskiy 4fa6c2f636 VTY: always print MNCC handler type (internal/external)
... so that it's clear which MNCC handler is used by looking
at the output of `show running-config`.

Change-Id: Id1fe7aecc1c8445db48ff5fddcf6df0f05ba5e2e
2024-01-06 18:35:38 +00:00
Mychaela N. Falconia d0880faf79 GSUP: set default ipa-name at application level
Prior to this change, if there was no explicit ipa-name configuration
in OsmoMSC, OsmoHLR would see the GSUP connection as MSC-00-00-00-00-00-00.
However, this default is constructed somewhere deep in IPA libraries
and is not visible to the GSUP client application, in this case OsmoMSC.
This situation creates a problem for SMS-over-GSUP routing: when we get
MT-forwardSM.req from an SMSC, we have to send a GSUP response, and this
response needs to get back to the MT-sending SMSC.  Because OsmoHLR
applies only passive routing for these responses, we have to set
source_name when generating MT-forwardSM.res in OsmoMSC - but we cannot
do so if don't know our own IPA name.

Change the default OsmoMSC ipa-name from MSC-00-00-00-00-00-00 to
unnamed-MSC, mirroring OsmoHLR default of unnamed-HLR, and set it
at our application level rather than deep in the libraries.

Related: OS#6135
Change-Id: I7bacd001b81326c32bc262c7d0c0491ded822fa8
2023-12-18 03:46:11 +00:00
Neels Hofmeyr 82fad5dd46 sdp: allow more space for fmtp
In osmo-mgw, we recently chose 256 for maximum fmtp length.
Adjust to that here, too.

Change-Id: Ib9b9608d8d8f7ce34596a950dbc480e8a72ebf97
2023-12-13 01:52:22 +00:00
Neels Hofmeyr b80d93d57a test_call: codecs: test specific PT from MO to MT
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-13 01:52:22 +00:00
Neels Hofmeyr d655cd0031 test_call: codecs: allow specific PT numbers [2/2]
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-13 01:52:22 +00:00
Neels Hofmeyr 636b4a9a1b test_call: codecs: allow specific PT numbers [1/2]
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-13 01:52:22 +00:00
Neels Hofmeyr e38f1ebc71 add comment in codec_mapping.c
Related: OS#6258
Change-Id: I0905a1264cd8f940c7a9964addf241091425fe72
2023-12-13 01:52:22 +00:00
Neels Hofmeyr b51c35e846 msc_vlr_test_call: codecs: properly test new codec matching
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-13 01:52:22 +00:00
Neels Hofmeyr 11c04ae383 msc_vlr_test_call: drop misleading log
It was true once, but not since "do CN CRCX first"
Ie433db1ba0c46d4b97538a969233c155cefac21c

Related: OS#6258
Change-Id: I94e430e4e5b5bf18dbb155258d82f599ada453e6
2023-12-13 01:52:22 +00:00
Neels Hofmeyr d767c73a1f implement re-assignment to match codecs
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-12-13 01:52:22 +00:00
Neels Hofmeyr cefe594c72 add sdp_audio_codec_to_speech_codec_list()
Used by I8760feaa8598047369ef8c3ab2673013bac8ac8a to add just a single
codec to a speech codec list, instead of a list.

Change-Id: I6ac23c54bc26939e048ff2df06eb987421cfb1c5
2023-12-13 01:52:22 +00:00
Neels Hofmeyr cbabe1e32d cc: remove code dup for / fix reading codecs from MNCC
To parse and handle SDP included in incoming MNCC, use rx_mncc_sdp()
everywhere. So now rx_mncc_sdp() is the single implementation for
parsing the SDP string and taking action for codecs if needed.

One current dup of this code has a fall-back to use legacy bearer cap --
absorb that into rx_mncc_sdp(), so that we now also do that fall-back
for all of the incoming MNCC that contains bcap.

This is a cosmetic preparation for implementing MO Re-Assignment to
match MT's codec limitations.

Change-Id: I94ae11654e1f88fbd64361b639a4c583836dc13e
2023-12-13 01:52:22 +00:00
Vadim Yanitskiy 2984d13e03 silent_call: check return value of trans_alloc() against NULL
We're checking the result of trans_alloc() 6 out of 7 times, so check
it in gsm_silent_call_start() too, for the sake of consistency.

Change-Id: Ie989cd8146d66d9531cf3f3d84f46a2c6fcc2e5c
Fixes: CID#322140
2023-12-12 22:34:22 +07:00
Andreas Eversberg c9801ed14a Use uniform log format for default config files
Related: OS#6272
Change-Id: Ic710873f9203414b343b216097785cef36ca05a9
2023-12-01 12:48:30 +01:00
Neels Hofmeyr d7d3eced56 call_leg: silence some false errors
"[ESTABLISHED] transition to state ESTABLISHED not permitted"

i.e. don't complain when we already are in the established state.

Change-Id: I9b1fd63ed1ee7ed2877a4b2059386354598f4ea4
2023-11-23 00:12:25 +01:00
Neels Hofmeyr ed226ed6e6 fix codec mapping for GSM-HR
The cfg bits are for AMR-HR, not GSM-HR. The function
gsm0808_enc_speech_codec_list2() will return -EINVAL when it encounters
GSM-HR with non-zero cfg bits.

It appears this mapping was never used before, and my testing of call
re-assignment to match MT's codecs (it allows more than just the
assigned codec, because it can re-assign) has uncovered this bug
via MSC_Tests.TC_ho_inter_msc_out. I don't fully understand all the
details why we didn't see this before; anyway, the fix is obvious.

Change-Id: I19cff847a0f618ad000d12c1df54c55ef2f79699
2023-11-17 04:38:09 +01:00
Philipp Maier 1759ed5709 manuals: add section about the SGs interface.
The SGs interface is currently only casually mentioned in the chapter
running, even though the SGs interface is a prominent and often
requested feature. Let's give the SGs interface its own section so that
users can find the info about it quicker.

Related: OS#6008
Change-Id: Ic7c17511ee19cb7f6d5069b27beb661ecb4b0be8
2023-10-30 17:51:33 +01:00
Philipp Maier 656354b818 vlr_sgs: fix VTY setting for SGs counter.
When trying to modify the value of an SGs counter (eg. ns11), then the
setting is never stored. The reason for this is that OsmoMSC uses the
wrong string table to compare the user input.

Related: OS#6008
Change-Id: I0358c1ec0026c37fda6db1f3af3145393df25cfd
2023-10-30 17:12:46 +01:00
Andreas Eversberg 1d3e48febf ASCI: Reject TERMINATION, if MS is not the originator
Only the originator may terminate the VGCS/VBS call. This will not
happen in real life, because the UI of the MS should not allow
termination of a recevied VGCS call.

Change-Id: Ibe289920fa3ea50dd3e7d5c1371456dca9b72604
Related: OS#4854
2023-10-19 13:18:06 +02:00
Manawyrm 2984235454 csd_bs: force rate adaptation mode for CSD calls to V.110
Certain calls (seen on very old Nokias) won't have the rate adaptation flag
set on "analog" CSD calls. The field for the intermediate rate (after RA) is
still filled correctly.
Workaround this by setting the RA to V.110 whenever the RA is unset but an
intermediate rate is specified.

Change-Id: I5b3e5649fe071636f1becddfbfee06f9175a5f17
2023-10-17 11:25:59 +00:00