diff options
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 11 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.h | 2 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.cpp | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index c52d9b6..95e3ff2 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -62,6 +62,7 @@ RtpSession::RtpSession(CStdString& trackingId) m_currentDtmfDuration = 0; m_currentRtpEventTs = 0; m_currentDtmfVolume = 0; + m_sessionTelephoneEventPtDefined = false; } void RtpSession::Stop() @@ -599,7 +600,7 @@ bool RtpSession::AddRtpPacket(RtpPacketInfoRef& rtpPacket) if(DLLCONFIG.m_rtpReportDtmf) { /* Check if this is a telephone-event */ - if(m_telephoneEventPayloadType.CompareNoCase("UNDEFINED") != 0) + if(m_sessionTelephoneEventPtDefined) { if(rtpPacket->m_payloadType == StringToInt(m_telephoneEventPayloadType)) { @@ -806,7 +807,11 @@ void RtpSession::ReportSipInvite(SipInviteInfoRef& invite) LOG4CXX_INFO(m_log, logMsg); } m_invites.push_front(invite); - m_telephoneEventPayloadType = invite->m_telephoneEventPayloadType; + if(invite->m_telephoneEventPtDefined) + { + m_telephoneEventPayloadType = invite->m_telephoneEventPayloadType; + m_sessionTelephoneEventPtDefined = true; + } // Gather extracted fields std::copy(invite->m_extractedFields.begin(), invite->m_extractedFields.end(), std::inserter(m_tags, m_tags.begin())); @@ -1850,7 +1855,7 @@ SipInviteInfo::SipInviteInfo() m_fromRtpIp.s_addr = 0; m_validated = false; m_attrSendonly = false; - m_telephoneEventPayloadType = "UNDEFINED"; + m_telephoneEventPtDefined = false; } void SipInviteInfo::ToString(CStdString& string) diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index 9c59593..ec6d36f 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -43,6 +43,7 @@ public: bool m_attrSendonly; // true if the SDP has a:sendonly std::map<CStdString, CStdString> m_extractedFields; CStdString m_telephoneEventPayloadType; + bool m_telephoneEventPtDefined; time_t m_recvTime; }; @@ -177,6 +178,7 @@ private: TcpAddressList m_rtpAddressList; std::list<SipInviteInfoRef> m_invites; std::map<CStdString, CStdString> m_tags; + bool m_sessionTelephoneEventPtDefined; CStdString m_telephoneEventPayloadType; unsigned short m_currentRtpEvent; diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 4790c7c..02eb13a 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -1663,6 +1663,7 @@ bool TrySipInvite(EthernetHeaderStruct* ethernetHeader, IpHeaderStruct* ipHeader /* Our DTMF packets are indicated using * the payload type rtpPayloadType */ info->m_telephoneEventPayloadType = rtpPayloadType; + info->m_telephoneEventPtDefined = true; break; } } |