diff options
authorHarald Welte <laforge@gnumonks.org>2018-03-21 21:09:04 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-22 15:15:11 +0000
commitb360ec1b4a612e475d3216f190d0a8aad219c2cc (patch)
parent12e3c81dd1cba50543a9b4b2e95f561252597854 (diff)
BSSAP: Fix test_codec_pref() implementation for AMR
In AMR-type cahnels, the gsm0808_speech_codec doesn't only include the codec (like EFR/FR/AMR) but also the specific codec configuration, i.e. the sub-set of AMR modes. Hence, we cannot convert from a channel type (just the codec) to the full gsm0808_speech_codec and then memcmp() that with the codec config received from the MSC. Rather, we must only compare the *type*. Change-Id: I0a3f362667a689135d5b62d151d491490dfd2976 Related: OS#3094
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index e793a14fa..04847b2fb 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -146,7 +146,7 @@ static bool test_codec_pref(const struct gsm0808_channel_type *ct,
/* Try to find extrapolated speech codec data in
* the speech codec list */
for (i = 0; i < scl->len; i++) {
- if (memcmp(&sc, &scl->codec[i], sizeof(sc)) == 0)
+ if (sc.type == scl->codec[i].type)
return true;