diff options
author | Henri Herscher <henri@oreka.org> | 2006-10-24 20:55:12 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2006-10-24 20:55:12 +0000 |
commit | c6919c520ee806d068bb957445f964bbe77a0733 (patch) | |
tree | 81779f9ae0260901c5b97f5e35ba962c8a87ef72 | |
parent | 9835de84c04206b80cbfc722bdb065779f5c988e (diff) |
RTP session timeout and RTP session with signalling timeout (SIP, Skinny) are now configurable in config.xml: <VoIpPlugin><RtpSessionTimeoutSec> and <RtpSessionWithSignallingTimeoutSec></VoIpPlugin>
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@348 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 11 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp | 17 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIpConfig.h | 3 |
3 files changed, 23 insertions, 8 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index 6536946..0d26562 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -13,9 +13,6 @@ #define _WINSOCKAPI_ // prevents the inclusion of winsock.h -#define RTP_SESSION_TIMEOUT 10 -#define RTP_WITH_SIGNALLING_SESSION_TIMEOUT (5*60) - #include "Utils.h" #include "AudioCapture.h" #include "RtpSession.h" @@ -970,7 +967,7 @@ void RtpSessions::ReportRtpPacket(RtpPacketInfoRef& rtpPacket) void RtpSessions::StopAll() { - time_t forceExpiryTime = time(NULL) + 2*RTP_WITH_SIGNALLING_SESSION_TIMEOUT; + time_t forceExpiryTime = time(NULL) + 2*DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec; Hoover(forceExpiryTime); } @@ -989,11 +986,11 @@ void RtpSessions::Hoover(time_t now) int timeoutSeconds = 0; if(session->m_protocol == RtpSession::ProtRawRtp) { - timeoutSeconds = RTP_SESSION_TIMEOUT; + timeoutSeconds = DLLCONFIG.m_rtpSessionTimeoutSec; } else { - timeoutSeconds = RTP_WITH_SIGNALLING_SESSION_TIMEOUT; + timeoutSeconds = DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec; } if((now - session->m_lastUpdated) > timeoutSeconds) { @@ -1014,7 +1011,7 @@ void RtpSessions::Hoover(time_t now) for(pair = m_byCallId.begin(); pair != m_byCallId.end(); pair++) { RtpSessionRef session = pair->second; - if((now - session->m_lastUpdated) > RTP_WITH_SIGNALLING_SESSION_TIMEOUT) + if((now - session->m_lastUpdated) > DLLCONFIG.m_rtpSessionWithSignallingTimeoutSec) { toDismiss.push_back(session); } diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp index eeab1b8..2b5b8f8 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.cpp @@ -30,6 +30,8 @@ VoIpConfig::VoIpConfig() m_pcapSocketBufferSize = 0; m_pcapFastReplay = true; m_pcapFastReplaySleepUsPerSec = 0; + m_rtpSessionTimeoutSec = 10; + m_rtpSessionWithSignallingTimeoutSec = 5*60; } void VoIpConfig::Define(Serializer* s) @@ -49,7 +51,8 @@ void VoIpConfig::Define(Serializer* s) s->IntValue("PcapFastReplaySleepUsPerSec", m_pcapFastReplaySleepUsPerSec); s->BoolValue("SipDropIndirectInvite", m_sipDropIndirectInvite); s->IntValue("PcapSocketBufferSize", m_pcapSocketBufferSize); - + s->IntValue("RtpSessionTimeoutSec", m_rtpSessionTimeoutSec); + s->IntValue("RtpSessionWithSignallingTimeoutSec", m_rtpSessionWithSignallingTimeoutSec); } void VoIpConfig::Validate() @@ -184,6 +187,18 @@ void VoIpConfig::Validate() throw (exception); } + if(m_rtpSessionTimeoutSec < 1) + { + CStdString exception; + exception.Format("VoIpConfig: RtpSessionTimeoutSec must be > 0 (currently:%d) please fix config.xml", m_rtpSessionTimeoutSec); + throw (exception); + } + if(m_rtpSessionWithSignallingTimeoutSec < 1) + { + CStdString exception; + exception.Format("VoIpConfig: RtpSessionWithSignallingTimeoutSec must be > 0 (currently:%d) please fix config.xml", m_rtpSessionWithSignallingTimeoutSec); + throw (exception); + } } bool VoIpConfig::IsPartOfLan(struct in_addr addr) diff --git a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h index 4ecd2c7..e2c08ee 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIpConfig.h +++ b/orkaudio/audiocaptureplugins/voip/VoIpConfig.h @@ -60,6 +60,9 @@ public: int m_pcapSocketBufferSize; bool m_pcapFastReplay; int m_pcapFastReplaySleepUsPerSec; + int m_rtpSessionTimeoutSec; + int m_rtpSessionWithSignallingTimeoutSec; + }; //======================================== |