summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2007-07-19 09:32:59 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2007-07-19 09:32:59 +0000
commita78ef547ae120f95a2569c9643cd60992ba547c7 (patch)
treef8f7937525ff510347c55594a09416c38043c4ed
parent9b20567589624aad4bb85308352252c32ca675cb (diff)
Multiple orkaudio instances may be ran on one server by setting the environment variables ORKAUDIO_CONFIG_PATH and ORKAUDIO_LOGGING_PATH to point to the location of the configuration files and log files respectively. Two variables in config.xml <CommandLineServerPort> and <HttpServerPort> have been added which specify the ports for the command line server and HTTP server respectively - these default to 59130 and 59140 respectively, note that previously the default ports were 10000 and 20000 respectively.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@454 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/Daemon.cpp21
-rw-r--r--orkaudio/OrkAudio.cpp5
-rw-r--r--orkaudio/audiocaptureplugins/voip/VoIp.cpp4
3 files changed, 25 insertions, 5 deletions
diff --git a/orkaudio/Daemon.cpp b/orkaudio/Daemon.cpp
index ae85975..db93220 100644
--- a/orkaudio/Daemon.cpp
+++ b/orkaudio/Daemon.cpp
@@ -13,6 +13,7 @@
#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
+#include "ace/OS_NS_dirent.h"
#include "Utils.h"
#ifdef WIN32
#include <windows.h>
@@ -141,7 +142,25 @@ void Daemon::Run()
i=open("/dev/null",O_RDWR); dup(i); dup(i); /* handle standart I/O */
umask(027); /* set newly created file permissions */
//chdir(RUNNING_DIR); /* change running directory */
- lfp=open("/var/log/orkaudio/orkaudio.lock",O_RDWR|O_CREAT,0640);
+
+ char *loggingPath = NULL;
+ CStdString lockFile = CStdString("");
+
+ loggingPath = ACE_OS::getenv("ORKAUDIO_LOGGING_PATH");
+ if(loggingPath) {
+ ACE_DIR* dir = ACE_OS::opendir(loggingPath);
+ if(dir) {
+ ACE_OS::closedir(dir);
+ lockFile.Format("%s/orkaudio.lock", loggingPath);
+ }
+ }
+
+ if(!lockFile.size()) {
+ lfp=open("/var/log/orkaudio/orkaudio.lock",O_RDWR|O_CREAT,0640);
+ } else {
+ lfp=open(lockFile.c_str(),O_RDWR|O_CREAT,0640);
+ }
+
if (lfp<0)
{
lfp=open("orkaudio.lock",O_RDWR|O_CREAT,0640);
diff --git a/orkaudio/OrkAudio.cpp b/orkaudio/OrkAudio.cpp
index a97dfc3..148c64f 100644
--- a/orkaudio/OrkAudio.cpp
+++ b/orkaudio/OrkAudio.cpp
@@ -237,14 +237,15 @@ void MainThread()
{
LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create reporting thread"));
}
+
// Create command line server on port 10000
- if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(CommandLineServer::run), (void *)10000))
+ if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(CommandLineServer::run), (void *)CONFIG.m_commandLineServerPort))
{
LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create command line server"));
}
// Create Http server on port 20000
- if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(HttpServer::run), (void *)20000))
+ if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(HttpServer::run), (void *)CONFIG.m_httpServerPort))
{
LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create Http server"));
}
diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
index a0518b9..5329bf1 100644
--- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp
+++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp
@@ -1626,7 +1626,7 @@ void HandlePacket(u_char *param, const struct pcap_pkthdr *header, const u_char
return;
}
-#ifdef WIN32
+//#ifdef WIN32
if(!s_liveCapture)
{
// This is a pcap file replay
@@ -1669,7 +1669,7 @@ void HandlePacket(u_char *param, const struct pcap_pkthdr *header, const u_char
}
}
}
-#endif
+//#endif
if(DLLCONFIG.IsPacketWanted(ipHeader) == false)
{