From 3da9054f481654e346bc52b2c7c0143e2a6dc48c Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Wed, 10 Sep 2008 16:42:40 +0000 Subject: Changed the way DTMF events are tracked, to know the position where the place them in the .wav file. Instead, the position is indicated as an offset in milliseconds from the time the recording started. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@558 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'orkaudio/audiocaptureplugins') diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index 0a0bc91..abc9108 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -578,9 +578,17 @@ void RtpSession::RecordRtpEvent() { CaptureEventRef event(new CaptureEvent()); CStdString dtmfEventString, dtmfEventKey; + ACE_Time_Value timeNow; + ACE_Time_Value beginTime; + ACE_Time_Value timeDiff; + int msDiff = 0; - dtmfEventString.Format("event:%d timestamp:%d duration:%d volume:%d seqno:%d", m_currentRtpEvent, m_currentRtpEventTs, - m_currentDtmfDuration, m_currentDtmfVolume, m_currentSeqNo); + beginTime.set(m_beginDate, 0); + timeNow = ACE_OS::gettimeofday(); + timeDiff = timeNow - beginTime; + msDiff = (timeDiff.sec() * 1000) + (timeDiff.usec() / 1000); + + dtmfEventString.Format("event:%d timestamp:%d duration:%d volume:%d seqno:%d offsetms:%d", m_currentRtpEvent, m_currentRtpEventTs, m_currentDtmfDuration, m_currentDtmfVolume, m_currentSeqNo, msDiff); dtmfEventKey.Format("%d_RtpDtmfEvent", m_currentRtpEventTs); event->m_type = CaptureEvent::EtKeyValue; event->m_key = dtmfEventKey; -- cgit v1.2.3