From 26ef8163e7c212000bddb1d87a2629c6a6392fea Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Fri, 6 Feb 2009 04:10:09 +0000 Subject: RTP DTMF Events (out of band) logging improvements. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@602 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h | 2 +- orkaudio/audiocaptureplugins/voip/Rtp.cpp | 3 ++- orkaudio/audiocaptureplugins/voip/Rtp.h | 4 ++-- orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 18 +++++++++++++----- 4 files changed, 18 insertions(+), 9 deletions(-) (limited to 'orkaudio/audiocaptureplugins') diff --git a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h index 6c7fa3f..a32e8cd 100644 --- a/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h +++ b/orkaudio/audiocaptureplugins/voip/PacketHeaderDefs.h @@ -97,7 +97,7 @@ typedef struct typedef struct { unsigned char event; - unsigned char er_volume; + unsigned char er_volume; // Also contains end and error booleans on bit 8 and 7 respectively. unsigned short duration; } RtpEventPayloadFormat; diff --git a/orkaudio/audiocaptureplugins/voip/Rtp.cpp b/orkaudio/audiocaptureplugins/voip/Rtp.cpp index 9c0eaa6..6f70d58 100644 --- a/orkaudio/audiocaptureplugins/voip/Rtp.cpp +++ b/orkaudio/audiocaptureplugins/voip/Rtp.cpp @@ -45,7 +45,8 @@ void RtpPacketInfo::ToString(CStdString& string) void RtpEventInfo::ToString(CStdString& string) { - string.Format("event:%d e:%d r:%d volume:%d duration:%d timestamp:%u", m_event, m_e, m_r, m_volume, m_duration, m_startTimestamp); + string.Format("digit:%d duration:%d end:%d timestamp:%u volume:%d reserved:%d", + m_event, m_duration, m_end, m_startTimestamp, m_volume, m_reserved); } void RtcpSrcDescriptionPacketInfo::ToString(CStdString& string) diff --git a/orkaudio/audiocaptureplugins/voip/Rtp.h b/orkaudio/audiocaptureplugins/voip/Rtp.h index 6110499..5d4b702 100644 --- a/orkaudio/audiocaptureplugins/voip/Rtp.h +++ b/orkaudio/audiocaptureplugins/voip/Rtp.h @@ -50,8 +50,8 @@ public: void ToString(CStdString& string); unsigned short m_event; - unsigned short m_e; - unsigned short m_r; + unsigned short m_end; + unsigned short m_reserved; unsigned short m_volume; unsigned short m_duration; unsigned int m_startTimestamp; diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index aaf9723..07f2e32 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -781,7 +781,7 @@ void RtpSession::RecordRtpEvent() event->m_value = dtmfEventString; g_captureEventCallBack(event, m_capturePort); - //LOG4CXX_INFO(m_log, "[" + m_trackingId + "] Recording RTP event [ " + dtmfEventString + " ]"); + LOG4CXX_INFO(m_log, "[" + m_trackingId + "] RTP DTMF event [ " + dtmfEventString + " ]"); } void RtpSession::HandleRtpEvent(RtpPacketInfoRef& rtpPacket) @@ -798,17 +798,25 @@ void RtpSession::HandleRtpEvent(RtpPacketInfoRef& rtpPacket) RtpEventInfoRef rtpEventInfo(new RtpEventInfo()); rtpEventInfo->m_event = (unsigned short)payloadFormat->event; - rtpEventInfo->m_e = (payloadFormat->er_volume & 0x80) ? 1 : 0; - rtpEventInfo->m_r = (payloadFormat->er_volume & 0x40) ? 1 : 0; + rtpEventInfo->m_end = (payloadFormat->er_volume & 0x80) ? 1 : 0; + rtpEventInfo->m_reserved = (payloadFormat->er_volume & 0x40) ? 1 : 0; rtpEventInfo->m_volume = (unsigned short)(payloadFormat->er_volume & 0x3F); rtpEventInfo->m_duration = ntohs(payloadFormat->duration); rtpEventInfo->m_startTimestamp = rtpPacket->m_timestamp; + if(m_log->isDebugEnabled()) + { + CStdString eventString; + rtpEventInfo->ToString(eventString); + logMsg.Format("[%s] RTP DTMF Event Packet: %s", m_trackingId, eventString); + LOG4CXX_DEBUG(m_log, logMsg); + } + if((m_currentRtpEvent != 65535) && (m_currentRtpEvent != rtpEventInfo->m_event)) { RecordRtpEvent(); } - else if(rtpEventInfo->m_e) + else if(rtpEventInfo->m_end) { if((m_currentRtpEvent != 65535)) { @@ -834,7 +842,7 @@ void RtpSession::HandleRtpEvent(RtpPacketInfoRef& rtpPacket) RecordRtpEvent(); } - if(!rtpEventInfo->m_e) + if(!rtpEventInfo->m_end) { m_currentRtpEvent = rtpEventInfo->m_event; } -- cgit v1.2.3