Commit Graph

7328 Commits

Author SHA1 Message Date
Neels Hofmeyr 390df2f954 pass dynamically configured AMR rates to BSS and RNC [3/3]
In ran_msg_iu.c for 3G:

Compose a list of RAB subflows from the AMR codecs present in the codec
list passed in from msc_a. These will hopefully result in the correct
RFCIs configured in the IuUP Initialization that the MGW receives.

Depends: osmo-iuh I61e0e9e75e3239662846fd797532acdefa9f73dc
Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 11365c62c5 pass dynamically configured AMR rates to BSS and RNC [2/3]
In ran_msg_a.c for 2G:

Use sdp_audio_codecs_to_speech_codec_list() to get the correct AMR cfg
bits in the outgoing Speech Codec List (MSC Preferred).

The static function to convert from Speech Versions is no longer used,
move its special-case for CSD to the caller location.

With this patch, a BSC now has a chance to select AMR rates matching the
other call leg, dynamically.

Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 03d015e786 pass dynamically configured AMR rates to BSS and RNC [1/3]
These changes will allow dynamically negotiating AMR rates between 2G
and 3G, and between full-rate and half-rate, spanning from 2G and 3G RAN
all the way across to SDP over MNCC / SIP and back.

To ran_msg_assignment, add a full codecs list (sdp_audio_codecs).
So far, there was only the gsm0808_channel_type with a list of
permitted-speech entries, which is not a complete representation.

This patch only adds the list, the two users of this are added in
separate patches:

[2/3] In ran_msg_a.c for 2G:

Before this, we pass a gsm0808_channel_type to ran_msg_assignment, and
from *that* we derive a gsm0808_speech_codec_list -- this loses the AMR
rate config bits. So far, we always transmitted the default cfg bits
defined in gsm0808_speech_codec_defaults, enabling all supported S0-S15
AMR rate combinations. Instead, we'll directly derive the available AMR
rates from the list of SDP codecs resulting from the codecs filter.

[3/3] In ran_msg_iu.c for 3G:

Before this, we compose a fixed set of RAB SDU subflows, i.e. for
exactly and only AMR 12k2. Now, we'll ask for RAB subflows corresponding
to the AMR codec's mode-set fmtp present in the codec list.

Change-Id: Ia9f4ad7f3646556aadc632bc5ffa477941626c5f
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 87c6243b3d sdp_msg: increase max codecs to 64
Change-Id: I3f88eb954de2f50b833297627f9717313778fd12
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 8216b39ead new test
Change-Id: Ic01dd2b5243137d9a9799ff315ffb5713dcf8108
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 2b83b385cd msc_vlr_test_call: assignment indicate FR or HR
Change-Id: I47c18a56a86005d6ae270bfd78bc13b2a7560192
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 602961bc5d msc_vlr_tests: allow more detail for assigned codec
An upcoming test needs to model assignment of a specific AMR variant.
Use sdp_codec_from_str(), which adds the ability to add specific AMR
modes to Assignment Complete messages.

Change-Id: I37680b9bef5ff989b1fcb0816eedae09282d9351
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 60ff867cb5 msc_vlr_test_call: log tweak
Change-Id: I64604634fd7eedc088442f8d21d682095c397a63
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 4f16f742bb tweak comment
Change-Id: I27d8af3cad57d6cef646f341d78ec52159ffa4b5
2024-02-25 03:43:12 +01:00
Neels Hofmeyr f73c91838b whitespace
Change-Id: I0eb7db3a48d1972dd01dcf8483922dfb4dc380c9
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 788a47fe23 amr_mode_set.txt
Change-Id: If6cce37b37018ec0f138bd14fc5d3bdfb455ac04
2024-02-25 03:43:12 +01:00
Neels Hofmeyr f091db0f20 bearer_cap_set_radio() traverse all matches
It's a minor technicality, but it seems the newly added API to
iterate the codec_mapping can slightly improve this implementation:

For some reason, the Bearer Capabilities should reflect whether any HR
codec is possible with its listed Speech Versions. So far we looked only
whether the first match for a given Speech Version in the global const
codec_mapping is a HR codec. Instead, look through *all* entries for a
Speech Version, and see if any one of them indicates HR.

For example, an AMR-FR codec with a well adjusted mode-set can work with
a half rate channel.

Change-Id: Ic964af4bec21598836748279f3fee480e470738c
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 3e4429af5e rtp_stream use fmtp FU
Change-Id: If98a04d782d5a975d96e73d4dc74b4d20c363ffc
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 333f586578 full fmtp FU
Change-Id: I6156eaab2eb88f81848e61add5b62f435ac4739a
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 3cd26dc53b fully use new AMR fmtp matching
Enable fmtp matching in sdp_audio_codecs_by_descr(). This has profound
effects on the codec_filter and other loops that collect codec matches.

By properly matching the meaning of fmtp, msc_vlr_test_call.c now works
as expected: all AMR variants are picked up properly. Adjust
expectations.

Change-Id: I63dc27e76243074ae0f019d219cae4412d322a84
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 00f8fcbc86 implement intelligent matching of AMR fmtp
Change-Id: I5a1e11e762a0ac511085377aeeb0a371fd2940f5
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 314cc11a45 sdp_audio_codecs(): add 'once', 'pick_unused_pt_nr' args
So far the API is pivoting on the payload type numbers as the "primary
key" for codec lists. However, working with variants of codecs, the
payload type numbers are just incidental, and the API isn't helpful.

- change the behavior to regard the subtype name and fmtp as the
  defining identity of a codec: use sdp_audio_codec_cmp() to match.
- add argument 'once': flag to make sure a given subtype+fmtp exists
  only once, regardless of payload type nr.
- add argument 'pick_unused_pt_nr': flag to make sure a new entry
  doesn't duplicate payload type numbers.

This is preparation to properly match AMR variants, in order to fix the
expected error currently visible in msc_vlr_test_call.c:875.

Change-Id: I87db779dbab39dfdef2724488ccdb6959e6731ed
2024-02-25 03:43:12 +01:00
Neels Hofmeyr d5c45dc580 codecs: match all AMR rates and modes
In msc_a_up_call_assignment_complete(), iterate all the new AMR modes
and rates recently added to codec_mapping, and enlist all possible
matches.

Change-Id: I6163a51765efff998e05c9ee4e82a0a3759f2043
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 64475fc6d8 codec_mapping: add amr flags
These flags are redundant, the aim is to speed up comparisons of AMR
fmtp when traversing a long list of codec variants. It can skip a lot of
repetitive strcmp and fmtp string parsing when used by a loop.

Change-Id: Ic2c9b4983b5374621e02389900e3622faa29cad9
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 3083b970b3 codec_mapping: add all AMR variants
Change-Id: I09233c8c17fce591195b7762740f4d82a9961db6
2024-02-25 03:43:12 +01:00
Neels Hofmeyr cb0758d4ba sdp_audio_codecs_from_speech_codec_list: add all matches
Change-Id: Idd24d5e57f75e413c7027d34e1e2eb00b7c8f113
2024-02-25 03:43:12 +01:00
Neels Hofmeyr c2e4bfc585 codec_mapping_matches_gsm0808_speech_codec
Change-Id: I852c1647a1b14017bd4f0ae79d22d84de28187f8
2024-02-25 03:43:12 +01:00
Neels Hofmeyr d1039bb8a5 codec_mapping_matches_speech_ver
Change-Id: Iccd1f137674ef23dfa37a7e21086e046514ce39b
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 21f1bfb4a8 add codec_mapping_next() and codec_mapping_foreach()
So far, querying the codec mapping returns one match.
For example:

 const struct codec_mapping *m;
 m = codec_mapping_by_speech_ver(GSM48_BCAP_SV_FR);
 if (!m)
         return -ENOENT;

But when supporting various AMR rates, we need to find multiple matches
in some code paths.

Also to support AMR OA vs BE modes, we need to combine multiple criteria
in some places.

With this patch, and as soon as an upcoming patch implements
codec_mapping_matches_speech_ver(), above code example becomes:

 const struct codec_mapping *m;
 codec_mapping_foreach (m) {
         if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_FR))
	         break;
 }
 if (!m)
         return -ENOENT;

This pattern supports collecting multiple matches in a list:

 const struct codec_mapping *m;
 codec_mapping_foreach (m) {
         if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_FR))
	         sdp_audio_codecs_add_copy(my_list, m);
 }

And this pattern also supports combining criteria:

 const struct codec_mapping *m;
 codec_mapping_foreach (m) {
	 // only allow AMR in OA mode
 	 if (!osmo_sdp_fmtp_amr_is_octet_aligned(m->sdp.fmtp))
	         continue;
         if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_AMR_F)
	     || codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_AMR_H))
	         sdp_audio_codecs_add_copy(my_list, m);
 }

Change-Id: Iaaa59d4bf5a6126a1bfe4ae282b82f6cb3ec6f99
2024-02-25 03:43:12 +01:00
Neels Hofmeyr e3059a74f7 fix sdp_audio_codec_to_speech_codec_list() for multiple AMR
Instead of returning multiple occurences of AMR as duplicated
gsm0808_speech_codec_type entries, combine their cfg bits to form a
single entry listing all AMR rate combinations that are allowed.

Prepare for AMR mode-set negotiation: soon we'll have multiple AMR
variants in codec_mapping.c, and then these must produce correct
gsm0808_speech_codec_list.

Change-Id: Ibeffb6c1325abebb904a14f00e6a0818870b119e
2024-02-25 03:43:12 +01:00
Neels Hofmeyr efd374a03e msc_vlr_test_call: validate_sdp: validate PT nr too
Change-Id: Ia4c5dca62142325c504b703bf0a294c11bb60209
2024-02-25 03:43:12 +01:00
Neels Hofmeyr b26715c60d add sdp_audio_codec_from_str(), for codec cfg
We have sdp_audio_codec_to_str() in a pretty sane and compact format,
so far for logging. It occured to me that this format is fit for VTY
config arguments.

Add a string-back-to-codec conversion.

- enable testing AMR mode-set and octet-align in msc_vlr_test_call.c, by
  giving convenient codec strings parsed by this new function.

- enable VTY config options for codecs.

Change-Id: Ibf23a8888ab79d3b10b044383cd161f1dfdf7e63
2024-02-25 03:43:12 +01:00
Neels Hofmeyr e9ab27652d msc_vlr_test_call: more space for SDP
Change-Id: I9d09acabb728b341dee3d6320cfc5129088281b5
2024-02-25 03:43:12 +01:00
Neels Hofmeyr ba377c439d msc_vlr_test_call: test AMR speech_codec cfg
Use the full struct gsm0808_speech_codec instead of just the enum
gsm0808_speech_codec_type: allow testing specific AMR mode-sets on A/Iu
signalling.

Prepare for matching AMR fmtp parameters between call legs.

Change-Id: I387490525007bdf2e95306fd9b4e5e3b7e487d0f
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 63a2263481 stop using deprecated mgcp_client codecs[]
ptmap[].codec is already set correctly, so we can simply drop use of
codecs[] now.

Related: osmo-mgw I798e02c6663376d3d52f4a74fc4b32411ce95bed
Change-Id: I701eb97ddafa871cfbc12fdbe8a1fe14aa2a4db1
2024-02-25 03:43:12 +01:00
Neels Hofmeyr 4a9ea4f311 use new libosmo-mgcp-client sdp/fmtp.h where possible
Change-Id: I261679118e5fd669fa0f74e3d2220a82ba7d8835
2024-02-25 03:42:46 +01:00
Neels Hofmeyr 083cc7ddb9 SDP/MGCP: pass octet-align=1 for AMR / pass all fmtp
Since recent libosmo-mgcp-client update (see Depends), we can now pass
fmtp for each individual codec entry to be sent in the SDP. Use that new
feature to pass any fmtp from rtp_stream.c to the MGW via MGCP.

In effect, this adds the 'octet-align=1', defined in codec_mapping.c as
the default for AMR, which was missing from the SDP/MGCP that osmo-msc
sends out.

A 2G to 2G call worked out OK without it, because omitting the
'octet-align' setting from MGCP disables all octet-align payload checks
in osmo-mgw. Both 2G call legs use octet-align=1, and things work out.

Running a call from 3G to 2G before this patch would result in osmo-mgw
dropping the RTP with logging like:

  DRTP NOTICE (rtpbridge/1@bsc0 I:B38CF524) rx_rtp(44 bytes): Expected RTP AMR octet-aligned=1 but got octet-aligned=0. check the config of your call-agent! (mgcp_network.c:1527)

...because osmo-bsc's MGW was instructed to expect octet-align=1, while
osmo-msc's MGW emits octet-align=0. This happens because converting the
3G IuUP to 2G AMR heeds the RFC 6871 specified default of octet-align=0.

So, after this patch, we accurately send "octet-align=1", and make the
IuUP-to-AMR conversion emit octet-align=1 to match 2G.

Side note: 3GPP specifies AoIP to use bandwidth-efficient AMR only;
however, in all known Osmocom world, our 2G BTS emit octet-aligned AMR
instead -- so in practice it makes most sense to run osmo-msc with
octet-align=1 as the default. osmo-msc shall at some point feature a
.cfg option to switch to octet-align=0 to conform with 3GPP, but until
then, osmo-msc now configures all AMR to be octet-align=1.

Depends: osmo-mgw If58590bda8627519ff07e0b6f43aa47a274f052b
Change-Id: Ief9225c9bcf7525a9a0a07c282ffb8cc0d092186
2024-02-09 05:17:39 +01:00
Neels Hofmeyr 5a56df1db0 drop bogus support for AMR OFR and OHR variants
Looking at 3GPP TS 26.103 table 4.1, none of the AMR-Oxx variants are
supported by GERAN-GMSK nor UTRAN, so it makes no sense to include
these. There are no users of this.

Change-Id: I0cbc770fff55209676d9b6aae50011d6d5f897e2
2024-02-09 05:17:39 +01:00
Neels Hofmeyr 25917ae048 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-09 05:17:39 +01: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