diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-03-21 21:09:04 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-03-22 15:15:11 +0000 |
commit | b360ec1b4a612e475d3216f190d0a8aad219c2cc (patch) | |
tree | ef112094374d9ac8ef28a5993dbd720505acb758 | |
parent | 12e3c81dd1cba50543a9b4b2e95f561252597854 (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
-rw-r--r-- | src/osmo-bsc/osmo_bsc_bssap.c | 2 |
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; } |