summaryrefslogtreecommitdiff
path: root/orkaudio/audiocaptureplugins
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2007-09-28 16:47:30 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2007-09-28 16:47:30 +0000
commit84d45bf1e53449fed92c08c9950b65053ea22f7a (patch)
tree190d0037c383aba420a686f52651d98b6c92969b /orkaudio/audiocaptureplugins
parent159d57187854191b887f8392682ff8c2e0369b10 (diff)
Adjustment to solve a potential performance problem that could arise from the load toll associated with repeated string comparison
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@498 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins')
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp11
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.h2
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIp.cpp1
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;
}
}