falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38325?usp=email )
Change subject: trau2rtp: add support for EDATA ......................................................................
trau2rtp: add support for EDATA
Regular DATA frames are used for 9.6 kbit/s and lower data services, EDATA frames are used for 14.4 kbit/s service. Add support for the latter.
Change-Id: If5344eb4718ac95b996e20caf969de35a9c8a35d --- M src/trau/trau_rtp_conv.c 1 file changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/25/38325/1
diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index 4df72d1..b0bde7d 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -31,6 +31,7 @@ #include <osmocom/trau/trau_frame.h> #include <osmocom/trau/trau_rtp.h> #include <osmocom/trau/csd_ra2.h> +#include <osmocom/trau/csd_raa_prime.h>
/* RFC4040 "clearmode" RTP payload length */ #define RFC4040_RTP_PLEN 160 @@ -1168,6 +1169,23 @@ return RFC4040_RTP_PLEN; }
+static int trau2rtp_edata(uint8_t *out, size_t out_len, + const struct osmo_trau_frame *tf) +{ + /* function interface preliminaries */ + if (tf->type != OSMO_TRAU16_FT_EDATA) + return -EINVAL; + if (out_len < RFC4040_RTP_PLEN) + return -ENOSPC; + + /* Per TS 48.020 section 11.1: + * A-TRAU bit C4 is always 1 in BSS->IWF direction + * A-TRAU bit C5 comes from E-TRAU bit C6 */ + osmo_csd144_to_atrau_ra2(out, tf->m_bits, tf->d_bits, 1, tf->c_bits[5]); + + return RFC4040_RTP_PLEN; +} + /* * CSD in the opposite direction: from clearmode RTP input * to TRAU frame output. @@ -1405,6 +1423,8 @@ return trau2rtp_data_fr(out, out_len, tf); case OSMO_TRAU16_FT_DATA_HR: return trau2rtp_data_hr16(out, out_len, tf); + case OSMO_TRAU16_FT_EDATA: + return trau2rtp_edata(out, out_len, tf); case OSMO_TRAU8_SPEECH: return trau2rtp_hr8(out, out_len, tf, check_twts002(st)); case OSMO_TRAU8_DATA: