From 94ceee3f8514c6f368ae24e45ac7051f57885f31 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Fri, 3 Feb 2006 03:47:47 +0000 Subject: Duplicate SIP invites now disregarded so that sessions do not stop spuriously. Also when a pcap file is replayed, all RTP sessions are now closed before the thread ends so as to avoid hanging RTP sessions. git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@156 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index e03e25a..8ede689 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -16,6 +16,7 @@ #include #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_string.h" +#include "ace/OS_NS_strings.h" #include "ace/Singleton.h" #include "ace/Min_Max.h" #include "ace/OS_NS_arpa_inet.h" @@ -42,16 +43,16 @@ static LoggerPtr s_rtpPacketLog; static LoggerPtr s_sipPacketLog; static LoggerPtr s_skinnyPacketLog; static LoggerPtr s_sipExtractionLog; -time_t s_lastHooveringTime; - +static time_t s_lastHooveringTime; static ACE_Thread_Mutex s_mutex; +static bool s_liveCapture; VoIpConfigTopObjectRef g_VoIpConfigTopObjectRef; #define DLLCONFIG g_VoIpConfigTopObjectRef.get()->m_config #define PROMISCUOUS 1 -// Convert a piece of memnory to hex string +// Convert a piece of memory to hex string void memToHex(unsigned char* input, size_t len, CStdString&output) { char byteAsHex[10]; @@ -62,12 +63,12 @@ void memToHex(unsigned char* input, size_t len, CStdString&output) } } -// find the address that follows the given search string between start and stop pointers +// find the address that follows the given search string between start and stop pointers - case insensitive char* memFindAfter(char* toFind, char* start, char* stop) { for(char * ptr = start; (ptrStopAll(); + } log.Format("Stop Capturing: pcap handle:%x", pcapHandle); LOG4CXX_INFO(s_packetLog, log); } @@ -592,8 +598,8 @@ void VoIp::Initialize() s_rtpPacketLog = Logger::getLogger("packet.rtp"); s_sipPacketLog = Logger::getLogger("packet.sip"); s_skinnyPacketLog = Logger::getLogger("packet.skinny"); - s_sipExtractionLog = Logger::getLogger("sipextraction"); + LOG4CXX_INFO(s_packetLog, "Initializing VoIP plugin"); // create a default config object in case it was not properly initialized by Configure @@ -605,10 +611,12 @@ void VoIp::Initialize() if(DLLCONFIG.m_pcapFile.size() > 0) { OpenPcapFile(DLLCONFIG.m_pcapFile); + s_liveCapture = false; } else { OpenDevices(); + s_liveCapture = true; } } -- cgit v1.2.3