summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2008-04-08 15:19:59 +0000
committerHenri Herscher <henri@oreka.org>2008-04-08 15:19:59 +0000
commitbb762969878d1f45cdbb9a4988472272039a37b1 (patch)
treeb6a15e333bbe591e122e998b2d86517f8349fef2
parentf5fce77e30949a7ca34a59d6f62afc5c6c37ee85 (diff)
Sangoma RTP tap mode now accepts different source and destination IP addresses.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@532 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/audiocaptureplugins/voip/RtpSession.cpp17
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIpConfig.h2
2 files changed, 14 insertions, 5 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
index a15d355..46535fc 100644
--- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
+++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp
@@ -1555,21 +1555,30 @@ void RtpSessions::ReportRtpPacket(RtpPacketInfoRef& rtpPacket)
if(DLLCONFIG.m_sangomaEnable && sourcePort == destPort)
{
+ if(rtpPacket->m_sourceIp.s_addr == rtpPacket->m_destIp.s_addr)
+ {
+ // Source and destination IP are the same, let's change one
+ // side in order to simulate bidirection RTP
+ // flip the least significant bit of the most significant byte
+ rtpPacket->m_destIp.s_addr ^= 0x00000001;
+ }
+
if(sourcePort > DLLCONFIG.m_sangomaTxTcpPortStart)
{
// This is a TX packet
sourcePort = sourcePort - DLLCONFIG.m_sangomaTcpPortDelta;
rtpPacket->m_sourcePort = sourcePort;
- // flip the least significant bit of the most significant byte
- rtpPacket->m_sourceIp.s_addr ^= 0x00000001;
+
+ // swap source and dest IP addresses so that we simulate bidirectional RTP
+ in_addr sourceIP = rtpPacket->m_sourceIp;
+ rtpPacket->m_sourceIp = rtpPacket->m_destIp;
+ rtpPacket->m_destIp = sourceIP;
}
else
{
// This is an RX packet
sourcePort = sourcePort + DLLCONFIG.m_sangomaTcpPortDelta;
rtpPacket->m_sourcePort = sourcePort;
- // flip the least significant bit of the most significant byte
- rtpPacket->m_destIp.s_addr ^= 0x00000001;
}
}
diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h
index 962a552..801bdc6 100644
--- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h
+++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h
@@ -93,7 +93,7 @@ public:
std::list<CStdString> m_sipExtractFields;
bool m_sangomaEnable; // not a config parm, derived from the two following
- int m_sangomaTcpPortDelta;
+ int m_sangomaTcpPortDelta; // not a config parm, derived from the two following
int m_sangomaRxTcpPortStart;
int m_sangomaTxTcpPortStart;
int m_skinnyTcpPort;