From 7e27b14ef29da0d8f834d8aba03551c34341ba90 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 22 Mar 2018 17:26:46 +0100 Subject: gsm_08_08: correct speech codec defaults The speech codec defaults are not correct. The defaults recommended in 3GPP TS 28.062, Table 7.11.3.1.3-2 are limited by 3GPP TS 48.008, Section 3.2.2.103. Some defaults are actually reserved for future use. Also the endianess of the 16 bit values is reversed. - correct values so that they match the specification - transmit bytes in the correct endianess Change-Id: I6c3a34d39a375d71c4128fd38f06629e8b98b100 --- src/gsm/gsm0808_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gsm') diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c index b58a4b8a..776f091d 100644 --- a/src/gsm/gsm0808_utils.c +++ b/src/gsm/gsm0808_utils.c @@ -210,7 +210,7 @@ static uint8_t enc_speech_codec(struct msgb *msg, case GSM0808_SCT_FR3: case GSM0808_SCT_HR3: case GSM0808_SCT_HR6: - msgb_put_u16(msg, sc->cfg); + msgb_put_u16(msg, osmo_ntohs(sc->cfg)); break; case GSM0808_SCT_FR4: case GSM0808_SCT_FR5: @@ -320,7 +320,7 @@ int gsm0808_dec_speech_codec(struct gsm0808_speech_codec *sc, case GSM0808_SCT_HR6: if (len < 2) return -EINVAL; - sc->cfg = osmo_load16be(elem); + sc->cfg = osmo_load16le(elem); elem += 2; break; default: -- cgit v1.2.3