diff options
author | bodamnam <bodamnam@google.com> | 2023-04-07 04:37:34 +0000 |
---|---|---|
committer | Bodam Nam <bodamnam@google.com> | 2023-04-14 05:14:55 +0000 |
commit | bac1ad50f34ca1b40d90bb69066e058af93a79cb (patch) | |
tree | 6135ccd22651c6037711cd1003706f85b32a0a57 | |
parent | b5a247260e89c4bbd77b65b5ee3609b0c885a22c (diff) | |
download | ImsMedia-bac1ad50f34ca1b40d90bb69066e058af93a79cb.tar.gz |
Fix the DTMF is not working
When the DTMF payloads have different RTP timestamps as its incremented every 20msec, the RTP payload cannot be recognized by the network side. I fix the problem by changing the RtpEncoderNode to use the fixed timestamp for all DTMF packets when the new DTMF is set.
Bug: 275938987
Test: Verified with the dtmf ARS service in live network, Verified
LTE-BTR-5-5466, atest ImsMediaNativeTests
Change-Id: I2cdc1f442e515fcd0cdb259b0a4300ffb1d19106
2 files changed, 10 insertions, 10 deletions
diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/include/nodes/RtpEncoderNode.h b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/include/nodes/RtpEncoderNode.h index 54253073..def41205 100644 --- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/include/nodes/RtpEncoderNode.h +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/include/nodes/RtpEncoderNode.h @@ -83,6 +83,7 @@ private: int8_t mRtpTxDtmfPayload; int8_t mRtpRxDtmfPayload; int8_t mDtmfSamplingRate; + int32_t mDtmfTimestamp; int32_t mCvoValue; int8_t mRedundantPayload; int8_t mRedundantLevel; diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/nodes/RtpEncoderNode.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/nodes/RtpEncoderNode.cpp index 944af956..40f3d1af 100644 --- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/nodes/RtpEncoderNode.cpp +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/nodes/RtpEncoderNode.cpp @@ -36,6 +36,7 @@ RtpEncoderNode::RtpEncoderNode(BaseSessionCallback* callback) : mRtpTxDtmfPayload = 0; mRtpRxDtmfPayload = 0; mDtmfSamplingRate = 0; + mDtmfTimestamp = 0; mCvoValue = CVO_DEFINE_NONE; mRedundantLevel = 0; mRedundantPayload = 0; @@ -446,18 +447,16 @@ bool RtpEncoderNode::ProcessAudioData(ImsMediaSubType subtype, uint8_t* data, ui return false; } + mMark ? mDtmfTimestamp = currentTimestamp : timeDiff = 0; mPrevTimestamp = currentTimestamp; timestampDiff = timeDiff * mSamplingRate; - IMLOGD_PACKET2(IM_PACKET_LOG_RTP, "[ProcessAudioData] dtmf payload, size[%u], TS[%u]", - size, currentTimestamp); + IMLOGD_PACKET3(IM_PACKET_LOG_RTP, + "[ProcessAudioData] dtmf payload, size[%u], TS[%u], diff[%d]", size, + mDtmfTimestamp, timestampDiff); mRtpSession->SendRtpPacket( - mRtpTxDtmfPayload, data, size, currentTimestamp, mMark, timestampDiff); - - if (mMark) - { - mMark = false; - } + mRtpTxDtmfPayload, data, size, mDtmfTimestamp, mMark, timestampDiff); + mMark = false; } } else // MEDIASUBTYPE_RTPPAYLOAD @@ -495,8 +494,8 @@ bool RtpEncoderNode::ProcessAudioData(ImsMediaSubType subtype, uint8_t* data, ui kCollectPacketInfo, kStreamRtpTx, reinterpret_cast<uint64_t>(packet)); timestampDiff = timeDiff * mSamplingRate; - IMLOGD_PACKET3(IM_PACKET_LOG_RTP, "[ProcessAudioData] PayloadTx[%d], Size[%d], TS[%d]", - mRtpPayloadTx, size, currentTimestamp); + IMLOGD_PACKET3(IM_PACKET_LOG_RTP, "[ProcessAudioData] size[%u], TS[%u], diff[%d]", size, + currentTimestamp, timestampDiff); if (!mListRtpExtension.empty()) { |