summaryrefslogtreecommitdiff
path: root/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2009-05-15 15:45:30 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2009-05-15 15:45:30 +0000
commit78efb87ddd8c0cb0c82fe03d43cf26ac0971d15b (patch)
tree8637db8a5d3e73bd8410766a67bc08a170de6580 /orkaudio/audiocaptureplugins/voip/RtpSession.cpp
parentb1f29dcd6162f456502cb488b738e6fc45bdb24d (diff)
Added support for setting the SIP request URI as local party. If the SIP request URI differs from the SIP URI in the "To:" header field, then the local party is set to the SIP request URI, remote party to the "From:" header field, direction to "in", Local entry point to the "To:" header field. This behaviour may be turned off by setting the configuration parameter SipRequestUriAsLocalParty to "false" under the VoIpPlugin section of config.xml.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@611 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/audiocaptureplugins/voip/RtpSession.cpp')
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp54
1 files changed, 47 insertions, 7 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
index 107e003..9c69bab 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
@@ -329,8 +329,19 @@ bool RtpSession::IsInSkinnyReportingList(CStdString item)
void RtpSession::ProcessMetadataSipIncoming()
{
- m_remoteParty = m_invite->m_from;
- m_localParty = m_invite->m_to;
+ if((DLLCONFIG.m_sipRequestUriAsLocalParty == true) && (m_invite->m_requestUri.CompareNoCase(m_invite->m_to) != 0))
+ {
+ m_localParty = m_invite->m_requestUri;
+ m_remoteParty = m_invite->m_from;
+ m_direction = CaptureEvent::DirIn;
+ m_localEntryPoint = m_invite->m_to;
+ }
+ else
+ {
+ m_remoteParty = m_invite->m_from;
+ m_localParty = m_invite->m_to;
+ m_direction = CaptureEvent::DirIn;
+ }
m_remotePartyName = m_invite->m_fromName;
m_localPartyName = m_invite->m_toName;
@@ -344,7 +355,6 @@ void RtpSession::ProcessMetadataSipIncoming()
m_localPartyName = m_localParty;
}
- m_direction = CaptureEvent::DirIn;
char szInviteeIp[16];
ACE_OS::inet_ntop(AF_INET, (void*)&m_inviteeIp, szInviteeIp, sizeof(szInviteeIp));
//m_capturePort.Format("%s,%d", szInviteeIp, m_inviteeTcpPort);
@@ -357,8 +367,19 @@ void RtpSession::ProcessMetadataSipIncoming()
void RtpSession::ProcessMetadataSipOutgoing()
{
- m_remoteParty = m_invite->m_to;
- m_localParty = m_invite->m_from;
+ if((DLLCONFIG.m_sipRequestUriAsLocalParty == true) && (m_invite->m_requestUri.CompareNoCase(m_invite->m_to) != 0))
+ {
+ m_localParty = m_invite->m_requestUri;
+ m_remoteParty = m_invite->m_from;
+ m_direction = CaptureEvent::DirIn;
+ m_localEntryPoint = m_invite->m_to;
+ }
+ else
+ {
+ m_remoteParty = m_invite->m_to;
+ m_localParty = m_invite->m_from;
+ m_direction = CaptureEvent::DirOut;
+ }
m_remotePartyName = m_invite->m_toName;
m_localPartyName = m_invite->m_fromName;
@@ -444,8 +465,18 @@ void RtpSession::UpdateMetadataSip(RtpPacketInfoRef& rtpPacket, bool sourceRtpAd
invite->m_validated = true;
// Update session metadata with INVITE info
- m_remoteParty = invite->m_from;
- m_localParty = invite->m_to;
+ if((DLLCONFIG.m_sipRequestUriAsLocalParty == true) && (m_invite->m_requestUri.CompareNoCase(m_invite->m_to) != 0))
+ {
+ m_localParty = m_invite->m_requestUri;
+ m_remoteParty = m_invite->m_from;
+ m_direction = CaptureEvent::DirIn;
+ m_localEntryPoint = m_invite->m_to;
+ }
+ else
+ {
+ m_remoteParty = invite->m_from;
+ m_localParty = invite->m_to;
+ }
m_remotePartyName = m_invite->m_fromName;
m_localPartyName = m_invite->m_toName;
@@ -693,6 +724,15 @@ void RtpSession::ReportMetadata()
g_captureEventCallBack(event, m_capturePort);
m_remotePartyReported = true;
+ // Report local entry point
+ if(m_localEntryPoint.size())
+ {
+ event.reset(new CaptureEvent());
+ event->m_type = CaptureEvent::EtLocalEntryPoint;
+ event->m_value = m_localEntryPoint;
+ g_captureEventCallBack(event, m_capturePort);
+ }
+
if(DLLCONFIG.m_sipReportNamesAsTags == true)
{
CStdString key, value;