summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-03-22 17:26:46 +0100
committerHarald Welte <laforge@gnumonks.org>2018-03-23 11:59:29 +0000
commit7e27b14ef29da0d8f834d8aba03551c34341ba90 (patch)
treeaf8d7f237d9b09011071f91a21c9309f9bd4a50c /src
parent04a2a3231f8c300e27e0d8309acef081ed58d80f (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/gsm/gsm0808_utils.c4
1 files changed, 2 insertions, 2 deletions
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: