falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/37151?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: rtp2trau_hr16: accept both TS 101 318 and RFC 5993 payload formats ......................................................................
rtp2trau_hr16: accept both TS 101 318 and RFC 5993 payload formats
OsmoBTS already accepts both payload formats for HRv1 - do likewise when interfacing to E1-based BTS. While OsmoMGW does have a vty config option to convert between TS 101 318 and RFC 5993 payload formats on the fly, it should be considered deprecated, and we should be moving toward recommended configurations with that option disabled.
Change-Id: I125d57d3451b030e35a7b2b95a45e38b4581626c --- M src/trau/trau_rtp_conv.c 1 file changed, 29 insertions(+), 1 deletion(-)
Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c index cf8d12e..5e06273 100644 --- a/src/trau/trau_rtp_conv.c +++ b/src/trau/trau_rtp_conv.c @@ -367,8 +367,20 @@
static int rtp2trau_hr16(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len) { - if (data_len < GSM_HR_BYTES && data_len != 0) + /* accept both TS 101 318 and RFC 5993 payloads */ + switch (data_len) { + case GSM_HR_BYTES: + break; + case GSM_HR_BYTES_RTP_RFC5993: + data++; + data_len--; + break; + case 0: + /* accept no-data input */ + break; + default: return -EINVAL; + }
tf->type = OSMO_TRAU16_FT_HR;