pespin has uploaded this change for review.

View Change

bts-trx: Fix dropping of DL AMR SID frames

Received DL RTP packets from the MGW containing AMR SID frames (FT=8)
were being checked to be in the active AMR codec mode subset, and
subsequently failing because the SID frames can always be expected there
and are not part of any active mode subset.
As a result, they were being dropped:
"(bts=0,trx=0,ts=4) TCH/F: Codec (FT = 8) of RTP frame not in list".

Related: SYS#5838
Change-Id: Icb6f72c091bb7855dba5a2d6bb1eba838bf6ec92
---
M src/osmo-bts-trx/sched_lchan_tchf.c
1 file changed, 22 insertions(+), 14 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/27361/1
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index b100fab..6b745f3 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -446,12 +446,11 @@
goto free_bad_msg;
}
cmr = -1;
- ft = -1;
for (i = 0; i < chan_state->codecs; i++) {
- if (chan_state->codec[i] == cmr_codec)
+ if (chan_state->codec[i] == cmr_codec) {
cmr = i;
- if (chan_state->codec[i] == ft_codec)
- ft = i;
+ break;
+ }
}
if (cmr >= 0) { /* new request */
chan_state->dl_cmr = cmr;
@@ -461,17 +460,26 @@
/* enable AMR loop */
trx_loop_amr_set(chan_state, 1);
}
- if (ft < 0) {
- LOGL1SB(DL1P, LOGL_ERROR, l1ts, br,
- "Codec (FT = %d) of RTP frame not in list\n", ft_codec);
- goto free_bad_msg;
+ if (ft_codec < AMR_SID) {
+ ft = -1;
+ for (i = 0; i < chan_state->codecs; i++) {
+ if (chan_state->codec[i] == ft_codec) {
+ ft = i;
+ break;
+ }
+ }
+ if (ft < 0) {
+ LOGL1SB(DL1P, LOGL_ERROR, l1ts, br,
+ "Codec (FT = %d) of RTP frame not in list\n", ft_codec);
+ goto free_bad_msg;
+ }
+ if (amr_is_cmr && chan_state->dl_ft != ft) {
+ LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Codec (FT = %d) "
+ " of RTP cannot be changed now, but in next frame\n", ft_codec);
+ goto free_bad_msg;
+ }
+ chan_state->dl_ft = ft;
}
- if (amr_is_cmr && chan_state->dl_ft != ft) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Codec (FT = %d) "
- " of RTP cannot be changed now, but in next frame\n", ft_codec);
- goto free_bad_msg;
- }
- chan_state->dl_ft = ft;
if (bfi == AMR_BAD) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Transmitting 'bad AMR frame'\n");
goto free_bad_msg;

To view, visit change 27361. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icb6f72c091bb7855dba5a2d6bb1eba838bf6ec92
Gerrit-Change-Number: 27361
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange