libosmocore/tests
Neels Hofmeyr d2d44883ac fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion
Deprecate
 gsm0808_sc_cfg_from_gsm48_mr_cfg() and
 gsm48_mr_cfg_from_gsm0808_sc_cfg(),
and add new functions
 gsm0808_sc_cfg_from_amr_modes() and
 gsm0808_sc_cfg_get_best_amr_modes()
to fix the behavior as follows:

When the mr_cfg enables a specific rate, do not include all AMR
configurations that feature this rate. Instead, enable only those
configurations that are a subset of the mr_cfg.
For example, in the old functions, setting only m4_75 = 1 would result
in enabling all of S0, S8, S9, S10, S12, S14. S14 would allow all of
4.75k, 5.9k, 7.95k, 12.2k, instead of limiting to 4.75k only.

In the new functions, do not modify the .version and .icmi members, act
only on the AMR rates.

Changes from old behavior to new behavior is clearly shown in
tests/gsm0808/gsm0808_test.ok.

Keep the deprecated functions unchanged, yielding incorrect behavior,
and let the API users decide when and how to upgrade to the more sane
behavior.
For example, changing the behavior of existing functions in-place would
have repercussions on osmo-bsc installations, where now only those AMR
modes listed in the config would be used -- we are becoming stricter.
Possibly this would deteriorate or break sites alone from upgrading
libosmocore -- i.e. those sites that fail to list an essential AMR rate
for matching with peers, but where that essential AMR rate was
erratically allowed by the old behavior.

The old behavior, by example of osmo-bsc:
- Picking rates in osmo-bsc.cfg has non-obvious effects, often
  including rates that are configured as 'forbidden'.
- If any of 4.75, 5.90, 7.40, 12.2 is enabled in osmo-bsc.cfg, the
  configuration S1 ends up enabled in s15_s0
  (gsm0808_sc_cfg_from_gsm48_mr_cfg()).
- In gsm48_mr_cfg_from_gsm0808_sc_cfg() used during channel activation,
  if S1 is present, the four rates from S1 are returned.
- In summary, in the vast majority of cases, the S1 set will be used --
  even if only one of its AMR rates is originally present in mr_cfg.
- Configurations above S7 are ignored.

The new behavior, assuming osmo-bsc moved to the more sane
implementation introduced in this patch:
- Only one of the rate combinations defined by S0..S15 is going to be
  used.
  This is mainly because AMR rate selections are sent to the MSC and
  back from the MSC in the somewhat limited S0..S15 bit form.
  Enabling one or more of these combinations of rates in osmo-bsc.cfg
  makes sense:
  - 4.75, 5.90, 7.40, 12.2 (S1)
  - 4.75, 5.90 (S8)
  - 4.75, 5.90, 6.70 (S9)
  - 4.75, 5.90, 6.70, 7.40 (S10)
  - 4.75, 5.90, 6.70, 10.2 (S12)
  - 4.75, 5.90, 7.95, 12.2 (S14)
- e.g. if only 4.75 is enabled, only 4.75 is used (S0).
- e.g. in case of 6.70=allowed + 7.75=allowed + 10.2=allowed,
  we have to choose between "only 6.70", "only 7.75", "only 10.2".
  On FR we'd pick S6 = "only 10.2", because it is the highest rate.
  So osmo-bsc.cfg should rather choose rates exactly matching a specific
  Sn bit, e.g. all rates of S12, to obtain a flexible variety of AMR
  rates.

3GPP TS 48.008 3.2.2.103 'Speech Codec List' says to this:

 NOTE: One of these Codec Configurations, "Config-NB-Code 1" = S1, is
 recommended for TrFO [Transcoder Free Operation].

S14 also seems a good choice, it is like S1 but with 7k95 instead of
7k40; 7k95 is the highest possible AMR-HR rate. It is not clear at this
point why S1 seems to be preferred over S14.

Ironically, the old behavior would usually end up selecting exactly S1
in almost every case, which is what 3GPP TS 48.008 3.2.2.103 recommends.
This is, however, not obvious to the caller / the site admin.

Related: SYS#5066
Change-Id: I900fda192742fa8f6dd54e9131ef1704b14cc41a
2023-03-09 04:08:58 +01:00
..
a5 tests: a5_test: Print wrong buffer correctly on error 2018-05-16 21:13:58 +02:00
abis Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
auth New unit test for XOR-2G authentication 2023-02-22 09:45:11 +01:00
base64 base64: reformat using Lindent to conform to our coding style 2021-09-21 19:57:56 +00:00
bitgen bitgen test: fix concat macro 2023-01-11 09:01:18 +00:00
bits tests: bitrev_test: Fix dynamic-stack-buffer-overflow 2018-05-16 17:10:33 +02:00
bitvec Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
bsslap Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
bssmap_le Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
codec Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
coding treewide: remove FSF address 2021-12-14 12:44:03 +01:00
comp128 tests: test actual support status for auth. algo 2016-06-29 16:33:40 +00:00
context context: Add support for [per-thread] global talloc contexts 2019-08-27 13:43:31 +02:00
conv convolutional coding for CSD 2023-02-25 19:37:44 +01:00
ctrl Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
dtx coding: add gsm0503_detect_a[fh]s_dtx_frame2() 2022-05-27 08:31:30 +00:00
endian add/clean big-endian packed structs (struct_endianess.py) 2018-12-19 18:40:03 +00:00
exec Introduce helper functions for safe fork+exec of processes 2019-12-17 13:49:28 +01:00
fr Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
fsm Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gad Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gb Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gea tests: gea_test: Use correct max size for key in buffer 2018-05-16 20:09:39 +02:00
gprs use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
gsm48 Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gsm0408 gsm0408_test: add unittest for gsm_gsmtime2fn() 2023-01-12 13:06:24 +01:00
gsm0502 Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gsm0808 fix gsm0808_sc_cfg <-> gsm48_mr_cfg conversion 2023-03-09 04:08:58 +01:00
gsm23003 Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gsm23236 Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gsm29205 Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
gsm44021 gsm: TS 44.021 modified V.110 frame encoding/decoding support 2023-03-08 20:43:15 +01:00
gsup Drop use of log_set_print_filename() API inside libosmocore 2021-02-20 17:13:58 +00:00
i460_mux create libosmoisdn sub-library 2023-01-21 22:41:57 +01:00
it_q tests/*: fix control reaches end of non-void func 2021-01-21 12:13:42 +00:00
iuup iuup: Fix Handling of subsequent Initialization msgs 2022-06-13 13:51:55 +02:00
kasumi gsm: kasumi: Fix dynamic-stack-buffer-overflow on out buffers not multiple of 64 bits 2018-05-17 12:13:04 +02:00
lapd Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
logging libosmocore: Transition to use of 'telnet_init_default' 2023-01-27 00:49:45 +01:00
loggingrb treewide: remove FSF address 2021-12-14 12:44:03 +01:00
msgb Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
msgfile treewide: remove FSF address 2021-12-14 12:44:03 +01:00
oap treewide: remove FSF address 2021-12-14 12:44:03 +01:00
osmo-auc-gen osmo-auc-gen: Print RFC3310 IMS HTTP-AKA style base64 nonce/res 2021-09-21 19:57:56 +00:00
prbs Add pseudo-random bit sequence generator to libosmcoore 2017-07-10 23:42:02 +02:00
sercomm treewide: remove FSF address 2021-12-14 12:44:03 +01:00
sim treewide: remove FSF address 2021-12-14 12:44:03 +01:00
sms Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
smscb Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
sockaddr_str Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
socket Fix all references to config.h 2023-01-18 19:04:36 +01:00
stats libosmocore: Transition to use of 'telnet_init_default' 2023-01-27 00:49:45 +01:00
strrb treewide: remove FSF address 2021-12-14 12:44:03 +01:00
tdef libosmocore: Transition to use of 'telnet_init_default' 2023-01-27 00:49:45 +01:00
time_cc Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
timer Fix all references to config.h 2023-01-18 19:04:36 +01:00
tlv Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
use_count Support building with -Werror=strict-prototypes / -Werror=old-style-definition 2022-11-03 12:44:28 +01:00
ussd treewide: remove FSF address 2021-12-14 12:44:03 +01:00
utils uitils: add floored and euclidian modulo functions 2023-01-12 09:33:07 +00:00
v110 isdn: Add V.110 encoder/decoder 2023-03-08 20:43:15 +01:00
vty libosmocore: Transition to use of 'telnet_init_default' 2023-01-27 00:49:45 +01:00
write_queue Drop use of log_set_print_filename() API inside libosmocore 2021-02-20 17:13:58 +00:00
Makefile.am gsm: TS 44.021 modified V.110 frame encoding/decoding support 2023-03-08 20:43:15 +01:00
atlocal.in build: make check: disable sim_test when built with --disable-pcsc 2016-11-16 16:40:44 +00:00
libsercomstub.c Embedded: add sercomm stubs 2018-01-21 19:08:05 +00:00
testsuite.at gsm: TS 44.021 modified V.110 frame encoding/decoding support 2023-03-08 20:43:15 +01:00