aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-09-21 14:21:50 +0200
committerHarald Welte <laforge@gnumonks.org>2018-10-05 07:58:22 +0000
commitc9a4f697d38b35680938f20928544a734739b185 (patch)
tree02447f24c7f99783e2f1bf8dd2b6fd690b5a2bb9 /tests
parent2043db02362ff94463fb8a797724f36bef3e0090 (diff)
codec_pref: handle S0-S15 in ASSIGNMENT REQUEST
Opposed to all other codecs that are common in GSM, AMR requires a codec configuration that is expressed by a bitmask (S0 to S15) in the speech codec list in the ASSIGNMENT REQUEST. Also the BSC acknowledges those configuration in the ASSIGNMENT COMPLETE message. At the moment osmo-bsc ignores all incoming configuration bits. The bits in the ASSIGNMENT COMPLETE speech codec (choosen) field are hardcoded. - Store the configuration bits while parsing the ASSIGNMENT COMPLETE - Create an intersection with the configuration that is actually supported by the BSS - Return the resulting (chosen) configuration bits with the assignment complete message. - Use the (highest of the) agreed codec rates in RSL channel activation. Change-Id: I2d8ded51b3eb4c003fe2da6f2d6f48d001b73737 Related: OS#3529
Diffstat (limited to 'tests')
-rw-r--r--tests/codec_pref/codec_pref_test.c6
-rw-r--r--tests/codec_pref/codec_pref_test.ok96
2 files changed, 52 insertions, 50 deletions
diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c
index 20e3525f0..e2876e2c8 100644
--- a/tests/codec_pref/codec_pref_test.c
+++ b/tests/codec_pref/codec_pref_test.c
@@ -374,6 +374,7 @@ static int test_match_codec_pref(const struct gsm0808_channel_type *ct, const st
unsigned int i;
bool full_rate;
enum gsm48_chan_mode chan_mode;
+ uint16_t s15_s0;
printf("Determining channel mode and rate:\n");
@@ -398,8 +399,9 @@ static int test_match_codec_pref(const struct gsm0808_channel_type *ct, const st
printf(" codec->efr=%u\n", bts->codec.efr);
printf(" codec->amr=%u\n", bts->codec.amr);
- rc = match_codec_pref(&chan_mode, &full_rate, ct, scl, msc->audio_support, msc->audio_length, &bts->codec);
- printf(" * result: rc=%i, full_rate=%i, chan_mode=%s\n", rc, full_rate, gsm48_chan_mode_name(chan_mode));
+ rc = match_codec_pref(&chan_mode, &full_rate, &s15_s0, ct, scl, msc, bts);
+ printf(" * result: rc=%i, full_rate=%i, s15_s0=%04x, chan_mode=%s\n",
+ rc, full_rate, s15_s0, gsm48_chan_mode_name(chan_mode));
printf("\n");
diff --git a/tests/codec_pref/codec_pref_test.ok b/tests/codec_pref/codec_pref_test.ok
index befc4972e..16d86ba67 100644
--- a/tests/codec_pref/codec_pref_test.ok
+++ b/tests/codec_pref/codec_pref_test.ok
@@ -12,7 +12,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=0
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -26,7 +26,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=0
codec->amr=0
- * result: rc=0, full_rate=0, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=0, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -40,7 +40,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=1
codec->amr=0
- * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_EFR
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -54,7 +54,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=1, s15_s0=57ff, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -68,7 +68,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=0, s15_s0=073f, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (2 items):
@@ -85,7 +85,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=0
codec->amr=0
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (3 items):
@@ -105,7 +105,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=0
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (3 items):
@@ -125,7 +125,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -151,7 +151,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
============== test_ms ==============
@@ -175,7 +175,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -197,7 +197,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=0, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -219,7 +219,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_EFR
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -241,7 +241,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=1, s15_s0=57ff, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -263,7 +263,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=0, s15_s0=073f, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (2 items):
@@ -286,7 +286,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (3 items):
@@ -310,7 +310,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (3 items):
@@ -334,7 +334,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -360,7 +360,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
============== test_ct ==============
@@ -384,7 +384,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -406,7 +406,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=0, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -428,7 +428,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_EFR
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -450,7 +450,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=1, s15_s0=57ff, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -472,7 +472,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR
+ * result: rc=0, full_rate=0, s15_s0=073f, chan_mode=SPEECH_AMR
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -495,7 +495,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -519,7 +519,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -543,7 +543,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -569,7 +569,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
============== test_msc ==============
@@ -597,7 +597,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -623,7 +623,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -649,7 +649,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -675,7 +675,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -701,7 +701,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -727,7 +727,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -753,7 +753,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -779,7 +779,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -805,7 +805,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
============== test_selected_working ==============
@@ -826,7 +826,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -843,7 +843,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -860,7 +860,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=0, full_rate=0, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=0, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (3 items):
@@ -879,7 +879,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=1
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -896,7 +896,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=1
codec->amr=0
- * result: rc=0, full_rate=1, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=1, s15_s0=0000, chan_mode=SPEECH_V1
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -913,7 +913,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=0
codec->amr=0
- * result: rc=0, full_rate=0, chan_mode=SPEECH_V1
+ * result: rc=0, full_rate=0, s15_s0=0000, chan_mode=SPEECH_V1
============== test_selected_non_working ==============
@@ -932,7 +932,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -949,7 +949,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -965,7 +965,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -981,7 +981,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
Determining channel mode and rate:
* MS: speech codec list (1 items):
@@ -996,7 +996,7 @@ Determining channel mode and rate:
codec->hr=1
codec->efr=1
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
Determining channel mode and rate:
* MS: speech codec list (5 items):
@@ -1016,7 +1016,7 @@ Determining channel mode and rate:
codec->hr=0
codec->efr=0
codec->amr=1
- * result: rc=-1, full_rate=0, chan_mode=SIGNALLING
+ * result: rc=-1, full_rate=0, s15_s0=0000, chan_mode=SIGNALLING
============== test_gen_bss_supp_codec_list_cfgs ==============