diff options
-rw-r--r-- | anyrtpproxy/Makefile | 21 | ||||
-rw-r--r-- | anyrtpproxy/anyrtpproxy.cpp | 8 | ||||
-rw-r--r-- | anyrtpproxy/options.cpp | 18 | ||||
-rw-r--r-- | anyrtpproxy/options.h | 7 |
4 files changed, 49 insertions, 5 deletions
diff --git a/anyrtpproxy/Makefile b/anyrtpproxy/Makefile index 354099b..6f13a90 100644 --- a/anyrtpproxy/Makefile +++ b/anyrtpproxy/Makefile @@ -7,7 +7,7 @@ CCFLAGS = -g -Wall CCFLAGS += -DSOCKETS_NAMESPACE=sockets CCFLAGS += -DSOCKETS_NAMESPACE_STR='"sockets"' LD = g++ -LDFLAGS = -g -Wall -O2 -lpthread +LDFLAGS = -g -Wall -O2 -lpthread -lssl -lboost_serialization OBJS = anyrtpproxy.o \ ../signalController.o \ @@ -16,6 +16,22 @@ OBJS = anyrtpproxy.o \ ../buffer.o \ ../rtpSessionTable.o \ ../rtpSession.o \ + connectionList.o \ + ../syncSocketHandler.o \ + ../syncClientSocket.o \ + ../syncQueue.o \ + ../syncSocket.o \ + ../seqWindow.o \ + ../connectionParam.o \ + ../routingTable.o \ + ../syncBuffer.o \ + ../syncCommand.o \ + ../syncRouteCommand.o \ + ../syncRtpCommand.o \ + ../syncConnectionCommand.o \ + ../networkAddress.o \ + ../networkPrefix.o \ + ../Sockets/libSockets.a \ options.o EXECUTABLE = anyrtpproxy @@ -28,6 +44,9 @@ anyrtpproxy: $(OBJS) options.o: options.cpp options.h $(C++) $(CCFLAGS) $< -c +connectionList.o: connectionList.cpp connectionList.h + $(C++) $(CCFLAGS) $< -c + anyrtpproxy.o: anyrtpproxy.cpp $(C++) $(CCFLAGS) $< -c diff --git a/anyrtpproxy/anyrtpproxy.cpp b/anyrtpproxy/anyrtpproxy.cpp index da03ff4..bace61c 100644 --- a/anyrtpproxy/anyrtpproxy.cpp +++ b/anyrtpproxy/anyrtpproxy.cpp @@ -10,7 +10,7 @@ #include "../signalController.h" #include "../PracticalSocket.h" #include "../buffer.h" -#include "../connectionList.h" +#include "connectionList.h" #include "../rtpSessionTable.h" #include "../syncCommand.h" #include "../syncQueue.h" @@ -21,7 +21,6 @@ #include "../syncClientSocket.h" #include "../threadUtils.hpp" - #include "options.h" #include <map> @@ -246,11 +245,12 @@ int main(int argc, char* argv[]) pthread_t syncListenerThread; SyncQueue queue; + ConnectToList connect_to = gOpt.getConnectTo(); // Example // gRtpSessionTable.addSession(std::string("callid"),RtpSession()); // SyncCommand sc (std::string("callid")); // queue.push(sc); - ThreadParam p( queue,*(new OptionConnectTo())) + ThreadParam p( queue,*(new OptionConnectTo())); if ( gOpt.getLocalSyncPort()) pthread_create(&syncListenerThread, NULL, syncListener, &p); @@ -258,7 +258,7 @@ int main(int argc, char* argv[]) for(ConnectToList::iterator it = connect_to.begin() ;it != connect_to.end(); ++it) { connectThreads.push_back(pthread_t()); - ThreadParam * point = new ThreadParam(dev, *src, cl, queue,*it); + ThreadParam * point = new ThreadParam(queue,*it); pthread_create(& connectThreads.back(), NULL, syncConnector, point); } diff --git a/anyrtpproxy/options.cpp b/anyrtpproxy/options.cpp index 2acc597..94825c1 100644 --- a/anyrtpproxy/options.cpp +++ b/anyrtpproxy/options.cpp @@ -255,3 +255,21 @@ HostList Options::getRemoteHosts() Lock lock(mutex); return remote_hosts_; } + +u_int16_t Options::getLocalSyncPort() +{ + return local_sync_port_; +} + +Options& Options::setLocalSyncPort(u_int16_t l) +{ + local_sync_port_ = l; + return *this; +} + +ConnectToList Options::getConnectTo() +{ + Lock lock(mutex); + return connect_to_; +} + diff --git a/anyrtpproxy/options.h b/anyrtpproxy/options.h index 25004a4..12107b6 100644 --- a/anyrtpproxy/options.h +++ b/anyrtpproxy/options.h @@ -83,6 +83,11 @@ public: u_int16_t getSendPort(); Host getControlInterface(); HostList getRemoteHosts(); + u_int16_t getLocalSyncPort(); + Options& setLocalSyncPort(u_int16_t l); + ConnectToList getConnectTo(); + Options& setMux(u_int16_t m); + private: Options(); @@ -108,6 +113,8 @@ private: std::string username_; std::string chroot_dir_; bool daemonize_; + u_int16_t local_sync_port_; + ConnectToList connect_to_; u_int16_t send_port_; Host control_interface_; HostList remote_hosts_; |