From 3674645e20d23d37269ee9226363f94bbde4b5c6 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 24 Jul 2014 21:24:29 +0200 Subject: amr: Avoid toggling the CMR from none and a set one For LCR and other systems without out-of-band information we need to indicate the CMR. Not every air message will include the mode and we sent a stream that had the CMR set and not-set. This lead to the AudioCodes MGW only playing every second frame. Remember the last used mode and initialize it to _NONE when we receive the multirate config. In case of a real error we will still use AMR_CMR_NONE. The initial patch is from Harald. I have added the initialization and moving of the defines to amr.h. Manually verified by enabling AMR5.9 and looking at two RTP packages in sequence. In both cases the CMR was 2. I have looked at "amr.nb.cmr != 2" in wireshark and only found the MGCP dummy packet. --- src/common/rsl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common') diff --git a/src/common/rsl.c b/src/common/rsl.c index 6b683bd5..bc7fddb9 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -811,6 +811,7 @@ static int rsl_rx_chan_activ(struct msgb *msg) TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan), &lchan->tch.amr_mr); + lchan->tch.last_cmr = AMR_CMR_NONE; } /* 9.3.53 MultiRate Control */ /* 9.3.54 Supported Codec Types */ @@ -1067,6 +1068,7 @@ static int rsl_rx_mode_modif(struct msgb *msg) TLVP_LEN(&tp, RSL_IE_MR_CONFIG)); amr_log_mr_conf(DRTP, LOGL_DEBUG, gsm_lchan_name(lchan), &lchan->tch.amr_mr); + lchan->tch.last_cmr = AMR_CMR_NONE; } /* 9.3.53 MultiRate Control */ /* 9.3.54 Supported Codec Types */ -- cgit v1.2.3