neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29854 )
Change subject: AMR->IuUP: properly translate Q -> FQC ......................................................................
AMR->IuUP: properly translate Q -> FQC
Fix the reversed logic when composing IuUP.FQC: AMR.Q == 1 means the frame is good.
Without this fix, all frames on IuUP are marked as bad, and no voice is heard on the IuUP side.
Related: SYS#5092 Change-Id: I29878dd27af9ba0c9e600324c528b22940cdcc30 --- M src/libosmo-mgcp/mgcp_iuup.c 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/54/29854/1
diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c index e3b7efa..1ff5471 100644 --- a/src/libosmo-mgcp/mgcp_iuup.c +++ b/src/libosmo-mgcp/mgcp_iuup.c @@ -676,12 +676,13 @@ LOG_CONN_RTP(conn_dest_rtp, LOGL_NOTICE, "Bridge RTP=>IuUP: No RFCI found for AMR OA ft=%u\n", amr_hdr->ft); goto free_ret; } - irp->u.data.fqc = amr_hdr->q; + irp->u.data.fqc = amr_hdr->q ? IUUP_FQC_FRAME_GOOD : IUUP_FQC_FRAME_BAD; irp->u.data.rfci = rfci; msgb_pull(msg, 2); } else { uint8_t *amr_bwe_hdr = (uint8_t *) msgb_data(msg); int8_t ft; + uint8_t q; if (msgb_length(msg) < 2) { LOG_CONN_RTP(conn_src_rtp, LOGL_NOTICE, "Bridge RTP=>IuUP: too short for AMR BE hdr (%u)\n", msgb_length(msg)); @@ -696,7 +697,8 @@ LOG_CONN_RTP(conn_dest_rtp, LOGL_NOTICE, "Bridge RTP=>IuUP: No RFCI found for AMR BE ft=%u\n", ft); goto free_ret; } - irp->u.data.fqc = ((amr_bwe_hdr[1] & 0x40) >> 6); + q = amr_bwe_hdr[1] & 0x40; + irp->u.data.fqc = q ? IUUP_FQC_FRAME_GOOD : IUUP_FQC_FRAME_BAD; irp->u.data.rfci = rfci; rc = iuup_length = osmo_amr_bwe_to_iuup(msgb_data(msg), msgb_length(msg)); if (rc < 0) {