diff --git a/core/AmApi.cpp b/core/AmApi.cpp index a48712ca..d15510cc 100644 --- a/core/AmApi.cpp +++ b/core/AmApi.cpp @@ -109,15 +109,15 @@ AmLoggingFacility::AmLoggingFacility(const string& name) { } -AmCtrlInterfaceFactory::AmCtrlInterfaceFactory(const string& name) - : AmPluginFactory(name) -{ -} +// AmCtrlInterfaceFactory::AmCtrlInterfaceFactory(const string& name) +// : AmPluginFactory(name) +// { +// } -AmCtrlInterface::AmCtrlInterface() -{ -} +// AmCtrlInterface::AmCtrlInterface() +// { +// } -AmCtrlInterface::~AmCtrlInterface() -{ -} +// AmCtrlInterface::~AmCtrlInterface() +// { +// } diff --git a/core/AmApi.h b/core/AmApi.h index fafaeba4..9e4379ed 100644 --- a/core/AmApi.h +++ b/core/AmApi.h @@ -228,47 +228,6 @@ class AmLoggingFacility : public AmPluginFactory virtual void log(int level, const char* msg) = 0; }; -class AmCtrlInterface: public AmThread -{ - public: - AmCtrlInterface(); - virtual ~AmCtrlInterface(); - - //@param serKey [out] An out parameter - //@param serKeyLen [out] An out parameter - - virtual int send(const AmSipRequest &, - char* serKey, unsigned int& serKeyLen) = 0; - - virtual int send(const AmSipReply &) = 0; - - virtual string getContact(const string &displayName, - const string &userName, const string &hostName, - const string &uriParams, const string &hdrParams) = 0; -}; - -/** - * \brief Interface for plugins that implement a control interface. - * - * The AmCtrlInterface defines the interface for - * SER-SEMS communication interface (unix socket/fifo). - * - * For sending messages, appropriate methods are exposed (the send()s). - * The interface defines a thread that runs, polling on the two listening unix - * sockets (one for requests, one for replies). After receiving a message, - * AmSipDispatcher shall be used to dispatch the incomming SIP messages - * (that end up either opening/updating a UAC session or posting to some - * event queue). - */ -class AmCtrlInterfaceFactory : public AmPluginFactory -{ - public: - AmCtrlInterfaceFactory(const string& name); - virtual ~AmCtrlInterfaceFactory() {} - - virtual AmCtrlInterface* instance() = 0; -}; - #if __GNUC__ < 3 #define EXPORT_FACTORY(fctname,class_name,args...) \ extern "C" void* fctname()\ diff --git a/core/AmPlugIn.cpp b/core/AmPlugIn.cpp index 9f6a5e8f..3f118276 100644 --- a/core/AmPlugIn.cpp +++ b/core/AmPlugIn.cpp @@ -32,7 +32,7 @@ #include "AmUtils.h" #include "AmSdp.h" #include "AmSipDispatcher.h" -#include "AmServer.h" +//#include "AmServer.h" #include "amci/amci.h" #include "amci/codecs.h" @@ -101,8 +101,8 @@ amci_payload_t _payload_tevent = { AmPlugIn* AmPlugIn::_instance=0; AmPlugIn::AmPlugIn() - : dynamic_pl(DYNAMIC_PAYLOAD_TYPE_START), - ctrlIface(NULL) + : dynamic_pl(DYNAMIC_PAYLOAD_TYPE_START) + //ctrlIface(NULL) { } @@ -206,14 +206,14 @@ int AmPlugIn::load(const string& directory, const string& plugins) DBG("AmPlugIn: Initializing plugins...\n"); - if (ctrlIface) { - if ((err = ctrlIface->onLoad())) { - ERROR("failed to initialize control interface.\n"); - return err; - } else { - AmServer::instance()->regIface(ctrlIface->instance()); - } - } +// if (ctrlIface) { +// if ((err = ctrlIface->onLoad())) { +// ERROR("failed to initialize control interface.\n"); +// return err; +// } else { +// AmServer::instance()->regIface(ctrlIface->instance()); +// } +// } // initialize base components for(std::map::iterator it = name2base.begin(); @@ -348,13 +348,13 @@ int AmPlugIn::loadPlugIn(const string& file) has_sym=true; } - // try load a control plugin - if ((fc = (FactoryCreate)dlsym(h_dl,FACTORY_CONTROL_INTERFACE_EXPORT_STR))) { - if (loadCtrlFacPlugIn((AmPluginFactory*)fc())) - goto error; - assert(! has_sym); - has_sym = true; - } +// // try load a control plugin +// if ((fc = (FactoryCreate)dlsym(h_dl,FACTORY_CONTROL_INTERFACE_EXPORT_STR))) { +// if (loadCtrlFacPlugIn((AmPluginFactory*)fc())) +// goto error; +// assert(! has_sym); +// has_sym = true; +// } if(!has_sym){ ERROR("Plugin type could not be detected (%s)(%s)\n",file.c_str(),dlerror()); @@ -669,27 +669,26 @@ int AmPlugIn::loadLogFacPlugIn(AmPluginFactory* f) return -1; } -int AmPlugIn::loadCtrlFacPlugIn(AmPluginFactory* f) -{ - AmCtrlInterfaceFactory *_ctrlIface = dynamic_cast(f); - if (! _ctrlIface) { - ERROR("invalid control interface plugin.\n"); - return -1; - } - if (ctrlIface) { - ERROR("one control interface already loaded (`%s'): can not load a " - "second one (`%s').\n", (ctrlIface->getName()).c_str(), - (_ctrlIface->getName()).c_str()); - return -1; - } - ctrlIface = _ctrlIface;//->instance(); - if (! ctrlIface) { - ERROR("BUG: failed to retrieve a control interface instance.\n"); - return -1; - } - - return 0; -} +// int AmPlugIn::loadCtrlFacPlugIn(AmPluginFactory* f) +// { +// AmCtrlInterfaceFactory *_ctrlIface = dynamic_cast(f); +// if (! _ctrlIface) { +// ERROR("invalid control interface plugin.\n"); +// return -1; +// } +// if (ctrlIface) { +// ERROR("one control interface already loaded (`%s'): can not load a " +// "second one (`%s').\n", (ctrlIface->getName()).c_str(), +// (_ctrlIface->getName()).c_str()); +// return -1; +// } +// ctrlIface = _ctrlIface;//->instance(); +// if (! ctrlIface) { +// ERROR("BUG: failed to retrieve a control interface instance.\n"); +// return -1; +// } +// return 0; +// } int AmPlugIn::addCodec(amci_codec_t* c) { diff --git a/core/AmPlugIn.h b/core/AmPlugIn.h index 91a81385..cf999fe4 100644 --- a/core/AmPlugIn.h +++ b/core/AmPlugIn.h @@ -44,7 +44,7 @@ class AmSessionEventHandlerFactory; class AmDynInvokeFactory; //class AmSIPEventHandler; class AmLoggingFacility; -class AmCtrlInterfaceFactory; +//class AmCtrlInterfaceFactory; class AmSipRequest; struct amci_exports_t; @@ -103,7 +103,7 @@ class AmPlugIn : public AmPayloadProviderInterface std::map name2di; std::map name2logfac; - AmCtrlInterfaceFactory *ctrlIface; + //AmCtrlInterfaceFactory *ctrlIface; int dynamic_pl; // range: 96->127, see RFC 1890 std::set excluded_payloads; // don't load these payloads (named) @@ -120,7 +120,7 @@ class AmPlugIn : public AmPayloadProviderInterface int loadBasePlugIn(AmPluginFactory* cb); int loadDiPlugIn(AmPluginFactory* cb); int loadLogFacPlugIn(AmPluginFactory* f); - int loadCtrlFacPlugIn(AmPluginFactory* f); + //int loadCtrlFacPlugIn(AmPluginFactory* f); public: diff --git a/core/AmServer.cpp b/core/AmServer.cpp deleted file mode 100644 index 167e749a..00000000 --- a/core/AmServer.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2002-2003 Fhg Fokus - * - * This file is part of sems, a free SIP media server. - * - * sems is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version - * - * For a license to use the ser software under conditions - * other than those described here, or to purchase support for this - * software, please contact iptel.org by e-mail at the following addresses: - * info@iptel.org - * - * sems is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "log.h" -#include "AmServer.h" - -#include - -// -// AmServer methods -// - -AmServer* AmServer::_instance; -AmCtrlInterface* AmServer::ctrlIface; - -AmServer* AmServer::instance() -{ - return _instance ? _instance : ((_instance = new AmServer())); -} - -void AmServer::dispose() -{ - if(_instance != NULL) { - if(_instance->ctrlIface != NULL) { - _instance->ctrlIface->join(); - } - delete _instance; - _instance = NULL; - } -} - -AmServer::~AmServer() -{ - INFO("Signaling Server has been recycled.\n"); -} - -void AmServer::run() -{ - ctrlIface->start(); - ctrlIface->join(); -} - -void AmServer::regIface(const AmCtrlInterface *i) -{ - if (ctrlIface) { - ERROR("control interface already registered; aborting second attempt.\n"); - return; - } - ctrlIface = const_cast(i); -} - -bool AmServer::sendReply(const AmSipReply &reply) -{ - return ctrlIface->send(reply); -} - -bool AmServer::sendRequest(const AmSipRequest &req, char* serKey, unsigned int& serKeyLen) -{ - return ctrlIface->send(req, serKey, serKeyLen); -} - -string AmServer::getContact(const string &displayName, - const string &userName, const string &hostName, - const string &uriParams, const string &hdrParams) -{ - return ctrlIface->getContact(displayName, userName, hostName, uriParams, - hdrParams); -} diff --git a/core/AmServer.h b/core/AmServer.h deleted file mode 100644 index af558db3..00000000 --- a/core/AmServer.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2002-2003 Fhg Fokus - * - * This file is part of sems, a free SIP media server. - * - * sems is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version - * - * For a license to use the ser software under conditions - * other than those described here, or to purchase support for this - * software, please contact iptel.org by e-mail at the following addresses: - * info@iptel.org - * - * sems is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -/** @file AmServer.h */ -#ifndef _AmServer_h_ -#define _AmServer_h_ - -#include "AmSipMsg.h" -#include "AmApi.h" - - -/** - * \brief singleton, serve requests from ctrl interface - * - * The Server polls requests from the control interface and feeds - * them to registered handlers. - */ -class AmServer -{ -private: - /** - * Singleton pointer. - * @see instance() - */ - static AmServer* _instance; - - static AmCtrlInterface *ctrlIface; - - /** Avoid external instantiation. @see instance(). */ - ~AmServer(); - -public: - /** Get a fifo server instance. */ - static AmServer* instance(); - static void dispose(); - - /** Runs the fifo server. */ - void run(); - - /** - * Register THE interface. - * WARNING: only before the server starts up. - */ - void regIface(const AmCtrlInterface *i); - bool hasIface() { return ctrlIface != NULL; }; - - static bool sendRequest(const AmSipRequest &, char* serKey, unsigned int& serKeyLen); - static bool sendReply(const AmSipReply &); - static string getContact(const string &displayName, - const string &userName, const string &hostName, - const string &uriParams, const string &hdrParams); -}; - -#endif - -// Local Variables: -// mode:C++ -// End: - - - diff --git a/core/AmSession.cpp b/core/AmSession.cpp index e25caafe..a15f957a 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -25,7 +25,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "AmServer.h" +//#include "AmServer.h" #include "AmSession.h" #include "AmSdp.h" #include "AmConfig.h" diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index c4049c2c..25a85a2f 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -30,7 +30,7 @@ #include "AmSession.h" #include "AmUtils.h" #include "AmSipHeaders.h" -#include "AmServer.h" +#include "SipCtrlInterface.h" #include "sems.h" const char* AmSipDialog::status2str[4] = { @@ -274,45 +274,20 @@ void AmSipDialog::updateStatus(const AmSipReply& reply, bool do_200_ack) string AmSipDialog::getContactHdr() { - if(!contact_uri.empty()) - return contact_uri; + if(contact_uri.empty()) { - string userName; - if(user.empty() || !AmConfig::PrefixSep.empty()) - userName += CONTACT_USER_PREFIX; - - if(!AmConfig::PrefixSep.empty()) - userName += AmConfig::PrefixSep; - - if(!user.empty()) - userName += user; - - string hostName; - if (! sip_ip.empty()) { -#ifdef SUPPORT_IPV6 - if(sip_ip.find('.') != string::npos) - hostName += sip_ip; - else - hostName += "[" + sip_ip + "]"; -#else - hostName += sip_ip; -#endif + contact_uri = SIP_HDR_COLSP(SIP_HDR_CONTACT) " diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 0d51255e..9c94a311 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -33,7 +33,6 @@ SET (sems_SRCS AmRtpReceiver.cpp AmRtpStream.cpp AmSdp.cpp - AmServer.cpp AmSession.cpp AmSessionContainer.cpp AmSessionEventHandler.cpp @@ -48,6 +47,7 @@ SET (sems_SRCS LowcFE.cpp log.cpp sems.cpp + SipCtrlInterface.cpp ) set (audio_files diff --git a/core/Makefile b/core/Makefile index 8293a483..60bc41fb 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2,16 +2,18 @@ NAME=sems LIBNAME=sems.so PLUGIN_DIR=plug-in +SIP_STACK_DIR=sip + SRCS=$(filter-out $(NAME).cpp, $(wildcard *.cpp)) HDRS=$(SRCS:.cpp=.h) -OBJS=$(SRCS:.cpp=.o) +OBJS=$(SRCS:.cpp=.o) sip/sip_stack.a DEPS=$(SRCS:.cpp=.d) $(NAME).d AUDIO_FILES=$(notdir $(wildcard wav/*.wav)) - .PHONY: all all: ../Makefile.defs - -@$(MAKE) deps && \ + -@$(MAKE) sip_stack && \ + $(MAKE) deps && \ $(MAKE) $(NAME) && \ $(MAKE) modules @@ -22,9 +24,17 @@ clean: rm -f lib/*.so compat/getos compat/getarch $(MAKE) -C $(PLUGIN_DIR) clean +.PHONY: sip_stack +sip_stack: + -@echo "" + -@echo "making SIP stack" + -@cd $(SIP_STACK_DIR); $(MAKE) all + .PHONY: modules modules: - cd $(PLUGIN_DIR); $(MAKE) modules + -@echo "" + -@echo "making core modules" + -@cd $(PLUGIN_DIR); $(MAKE) modules .PHONY: deps deps: $(DEPS) @@ -37,15 +47,16 @@ include ../Makefile.defs %.o : %.cpp %.d ../Makefile.defs $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) -%.d : %.cpp %.h Makefile ../Makefile.defs +%.d : %.cpp %.h ../Makefile.defs $(CXX) -MM $< $(CPPFLAGS) $(CXXFLAGS) > $@ $(NAME): $(NAME).o $(OBJS) ../Makefile.defs + -@echo "" + -@echo "making $(NAME) executable" $(LD) -o $(NAME) $(NAME).o $(OBJS) $(LDFLAGS) $(EXTRA_LDFLAGS) install: all mk-install-dirs \ install-audio \ - install-doc \ install-modules-cfg \ install-cfg \ install-bin \ @@ -101,10 +112,6 @@ install-audio: $(DESTDIR)$(audio-prefix)/$(audio-dir) fi ; \ done -install-doc: $(DESTDIR)$(doc-prefix)/$(doc-dir) - $(INSTALL-TOUCH) $(DESTDIR)$(doc-prefix)/$(doc-dir)README - $(INSTALL-DOC) ../README $(DESTDIR)$(doc-prefix)/$(doc-dir) - dist: tar tar: diff --git a/core/plug-in/sipctrl/SipCtrlInterface.cpp b/core/SipCtrlInterface.cpp similarity index 79% rename from core/plug-in/sipctrl/SipCtrlInterface.cpp rename to core/SipCtrlInterface.cpp index 50941934..e15f65db 100644 --- a/core/plug-in/sipctrl/SipCtrlInterface.cpp +++ b/core/SipCtrlInterface.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: SipCtrlInterface.cpp 1648 2010-03-03 19:35:22Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * @@ -29,24 +29,21 @@ #include "AmUtils.h" #include "AmSipMsg.h" -#include "trans_layer.h" -#include "sip_parser.h" -#include "parse_header.h" -#include "parse_from_to.h" -#include "parse_cseq.h" -#include "hash_table.h" -#include "sip_trans.h" -#include "wheeltimer.h" -#include "msg_hdrs.h" - -#include "udp_trsp.h" +#include "sip/trans_layer.h" +#include "sip/sip_parser.h" +#include "sip/parse_header.h" +#include "sip/parse_from_to.h" +#include "sip/parse_cseq.h" +#include "sip/hash_table.h" +#include "sip/sip_trans.h" +#include "sip/wheeltimer.h" +#include "sip/msg_hdrs.h" +#include "sip/udp_trsp.h" #include "log.h" #include -#ifndef _STANDALONE - #include "AmApi.h" #include "AmConfigReader.h" #include "AmSipDispatcher.h" @@ -55,30 +52,16 @@ #define MOD_NAME "sipctrl" #endif -EXPORT_CONTROL_INTERFACE_FACTORY(SipCtrlInterfaceFactory,MOD_NAME); - -string SipCtrlInterfaceFactory::outbound_host = ""; -unsigned int SipCtrlInterfaceFactory::outbound_port = 0; -bool SipCtrlInterfaceFactory::accept_fr_without_totag = false; -int SipCtrlInterfaceFactory::log_raw_messages = 3; -bool SipCtrlInterfaceFactory::log_parsed_messages = true; - -AmCtrlInterface* SipCtrlInterfaceFactory::instance() -{ - SipCtrlInterface* ctrl = new SipCtrlInterface(bind_addr,bind_port); - trans_layer::instance()->register_ua(ctrl); - - return ctrl; -} +string SipCtrlInterface::outbound_host = ""; +unsigned int SipCtrlInterface::outbound_port = 0; +bool SipCtrlInterface::accept_fr_without_totag = false; +int SipCtrlInterface::log_raw_messages = 3; +bool SipCtrlInterface::log_parsed_messages = true; -int SipCtrlInterfaceFactory::onLoad() +int SipCtrlInterface::load() { - - bind_addr = AmConfig::LocalSIPIP; - bind_port = AmConfig::LocalSIPPort; - - INFO("SIP bind_addr: `%s'.\n", bind_addr.c_str()); - INFO("SIP bind_port: `%i'.\n", bind_port); + INFO("SIP bind_addr: `%s'.\n", AmConfig::LocalSIPIP.c_str()); + INFO("SIP bind_port: `%i'.\n", AmConfig::LocalSIPPort); if (!AmConfig::OutboundProxy.empty()) { sip_uri parsed_uri; @@ -87,20 +70,20 @@ int SipCtrlInterfaceFactory::onLoad() ERROR("invalid outbound_proxy specified\n"); return -1; } - SipCtrlInterfaceFactory::outbound_host = c2stlstr(parsed_uri.host); + outbound_host = c2stlstr(parsed_uri.host); if (parsed_uri.port) { - SipCtrlInterfaceFactory::outbound_port = parsed_uri.port; + outbound_port = parsed_uri.port; } } AmConfigReader cfg; - string cfgfile = AmConfig::ModConfigPath + string(MOD_NAME ".conf"); + string cfgfile = AmConfig::ConfigurationFile.c_str(); if (file_exists(cfgfile) && !cfg.loadFile(cfgfile)) { if (cfg.hasParameter("accept_fr_without_totag")) { accept_fr_without_totag = cfg.getParameter("accept_fr_without_totag") == "yes"; } - DBG("sipctrl: accept_fr_without_totag = %s\n", + DBG("accept_fr_without_totag = %s\n", accept_fr_without_totag?"yes":"no"); if (cfg.hasParameter("log_raw_messages")) { @@ -111,13 +94,13 @@ int SipCtrlInterfaceFactory::onLoad() else if (msglog == "info") log_raw_messages = 2; else if (msglog == "debug") log_raw_messages = 3; } - DBG("sipctrl: log_raw_messages level = %d\n", + DBG("log_raw_messages level = %d\n", log_raw_messages); if (cfg.hasParameter("log_parsed_messages")) { log_parsed_messages = cfg.getParameter("log_parsed_messages")=="yes"; } - DBG("sipctrl: log_parsed_messages = %s\n", + DBG("log_parsed_messages = %s\n", log_parsed_messages?"yes":"no"); } else { @@ -128,12 +111,9 @@ int SipCtrlInterfaceFactory::onLoad() } -#endif // #ifndef _STANDALONE - -SipCtrlInterface::SipCtrlInterface(const string& bind_addr, unsigned short bind_port) - : bind_addr(bind_addr), bind_port(bind_port) +SipCtrlInterface::SipCtrlInterface() { - tl = trans_layer::instance(); + trans_layer::instance()->register_ua(this); } int SipCtrlInterface::cancel(const AmSipRequest& req) @@ -147,61 +127,9 @@ int SipCtrlInterface::cancel(const AmSipRequest& req) return -1; } - return tl->cancel(get_trans_bucket(h),(sip_trans*)t); + return trans_layer::instance()->cancel(get_trans_bucket(h),(sip_trans*)t); } -#ifndef _STANDALONE - -string SipCtrlInterface::getContact(const string &displayName, - const string &userName, const string &hostName, - const string &uriParams, const string &hdrParams) -{ - string localUri; - - if (displayName.length()) { - // quoting is safer (the check for quote need doesn't really pay off) - if (displayName.c_str()[0] == '"') { - assert(displayName.c_str()[displayName.length() - 1] == '"'); - localUri += displayName; - } else { - localUri += '"'; - localUri += displayName; - localUri += '"'; - } - localUri += " "; - } - - // angular brackets not always needed (unless contact) - localUri += "<"; - localUri += "sip:"; //TODO: sips|tel|tels - if (userName.length()) { - localUri += userName; - localUri += "@"; - } - if (hostName.length()) - localUri += hostName; - else { - - localUri += AmConfig::LocalSIPIP; - localUri += ":" + int2str(AmConfig::LocalSIPPort); - } - - if (uriParams.length()) { - if (uriParams.c_str()[0] != ';') - localUri += ';'; - localUri += uriParams; - } - localUri += ">"; - - if (hdrParams.length()) { - if (hdrParams.c_str()[0] != ';') - localUri += ';'; - localUri += hdrParams; - } - - return localUri; -} -#endif int SipCtrlInterface::send(const AmSipRequest &req, char* serKey, unsigned int& serKeyLen) { @@ -326,8 +254,8 @@ int SipCtrlInterface::send(const AmSipRequest &req, char* serKey, unsigned int& req.next_hop.length()) < 0) { ERROR("invalid next hop URI '%s'\n", req.next_hop.c_str()); ERROR("Using default outbound proxy"); - next_hop = SipCtrlInterfaceFactory::outbound_host; - next_port_i = SipCtrlInterfaceFactory::outbound_port; + next_hop = SipCtrlInterface::outbound_host; + next_port_i = SipCtrlInterface::outbound_port; } else { next_hop = c2stlstr(parsed_uri.host); if (parsed_uri.port) { @@ -335,36 +263,34 @@ int SipCtrlInterface::send(const AmSipRequest &req, char* serKey, unsigned int& next_hop += *(c++); } } - else if(!SipCtrlInterfaceFactory::outbound_host.empty()){ - next_hop = SipCtrlInterfaceFactory::outbound_host; - next_port_i = SipCtrlInterfaceFactory::outbound_port; + else if(!SipCtrlInterface::outbound_host.empty()){ + next_hop = SipCtrlInterface::outbound_host; + next_port_i = SipCtrlInterface::outbound_port; } cstring c_next_hop = stl2cstr(next_hop); - if(tl->set_next_hop(msg->route,msg->u.request->ruri_str, + if(trans_layer::instance()->set_next_hop(msg->route,msg->u.request->ruri_str, c_next_hop,(unsigned short)next_port_i, &msg->remote_ip) < 0){ - // TODO: error handling + DBG("set_next_hop failed\n"); delete msg; return -1; } - int res = tl->send_request(msg,serKey,serKeyLen); + int res = trans_layer::instance()->send_request(msg,serKey,serKeyLen); delete msg; return res; } -void SipCtrlInterface::run() +void SipCtrlInterface::run(const string& bind_addr, unsigned short bind_port) { INFO("Starting SIP control interface\n"); - udp_trsp* udp_server = new udp_trsp(tl); - - assert(tl); - tl->register_transport(udp_server); + udp_trsp* udp_server = new udp_trsp(trans_layer::instance()); + trans_layer::instance()->register_transport(udp_server); udp_server->bind(bind_addr,bind_port); wheeltimer::instance()->start(); @@ -434,7 +360,7 @@ int SipCtrlInterface::send(const AmSipReply &rep) } } - int ret = tl->send_reply(get_trans_bucket(h),(sip_trans*)t, + int ret = trans_layer::instance()->send_reply(get_trans_bucket(h),(sip_trans*)t, rep.code,stl2cstr(rep.reason), stl2cstr(rep.local_tag), cstring(hdrs_buf,hdrs_len), stl2cstr(rep.body)); @@ -450,7 +376,7 @@ int SipCtrlInterface::send(const AmSipReply &rep) void SipCtrlInterface::handleSipMsg(AmSipRequest &req) { DBG("Received new request\n"); - if (SipCtrlInterfaceFactory::log_parsed_messages) { + if (SipCtrlInterface::log_parsed_messages) { // DBG_PARAM(req.cmd); DBG_PARAM(req.method); // DBG_PARAM(req.user); diff --git a/core/plug-in/sipctrl/SipCtrlInterface.h b/core/SipCtrlInterface.h similarity index 63% rename from core/plug-in/sipctrl/SipCtrlInterface.h rename to core/SipCtrlInterface.h index 075457ff..23f352ab 100644 --- a/core/plug-in/sipctrl/SipCtrlInterface.h +++ b/core/SipCtrlInterface.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: SipCtrlInterface.h 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * @@ -27,7 +27,8 @@ #ifndef _SipCtrlInterface_h_ #define _SipCtrlInterface_h_ -#include "sip_ua.h" +#include "sip/sip_ua.h" +#include "AmThread.h" #include #include @@ -37,97 +38,53 @@ using std::list; class AmSipRequest; class AmSipReply; -//class udp_trsp; class trans_layer; class trans_bucket; struct sip_msg; struct sip_header; -#ifndef _STANDALONE - -#include "AmApi.h" - -class SipCtrlInterfaceFactory: public AmCtrlInterfaceFactory -{ - string bind_addr; - unsigned short bind_port; - -public: - - static string outbound_host; - static unsigned int outbound_port; - - static bool accept_fr_without_totag; - static int log_raw_messages; - static bool log_parsed_messages; - - SipCtrlInterfaceFactory(const string& name): AmCtrlInterfaceFactory(name) {} - ~SipCtrlInterfaceFactory() {} - - int onLoad(); - - AmCtrlInterface* instance(); -}; - -#else - -#include "AmThread.h" - -#endif - - -class SipCtrlInterface: - -#ifndef _STANDALONE - public AmCtrlInterface, -#else - public AmThread, -#endif - +class SipCtrlInterface: public sip_ua { - string bind_addr; - unsigned short bind_port; - - //udp_trsp* udp_server; - - trans_layer* tl; - - + static string outbound_host; + static unsigned int outbound_port; + static bool log_parsed_messages; + static int log_raw_messages; + static bool accept_fr_without_totag; + + //string bind_addr; + //unsigned short bind_port; + void prepare_routes_uac(const list& routes, string& route_field); void prepare_routes_uas(const list& routes, string& route_field); - int cancel(const AmSipRequest& req); - -protected: - void run(); - void on_stop() {} + static int cancel(const AmSipRequest& req); public: - SipCtrlInterface(const string& bind_addr, unsigned short bind_port); + SipCtrlInterface(); ~SipCtrlInterface(){} + + int load(); + + void run(const string& bind_addr, unsigned short bind_port); /** * From AmCtrlInterface */ - int send(const AmSipRequest &req, char* serKey, unsigned int& serKeyLen); - int send(const AmSipReply &rep); + static int send(const AmSipRequest &req, char* serKey, unsigned int& serKeyLen); + static int send(const AmSipReply &rep); -#ifndef _STANDALONE string getContact(const string &displayName, const string &userName, const string &hostName, const string &uriParams, const string &hdrParams); -#endif void handleSipMsg(AmSipRequest &req); void handleSipMsg(AmSipReply &rep); - /** * From sip_ua */ void handle_sip_request(const char* tid, sip_msg* msg); void handle_sip_reply(sip_msg* msg); - }; diff --git a/core/plug-in/CMakeLists.txt b/core/plug-in/CMakeLists.txt index e0a445a2..7dc82307 100644 --- a/core/plug-in/CMakeLists.txt +++ b/core/plug-in/CMakeLists.txt @@ -11,7 +11,6 @@ IF(SEMS_USE_ILBC) ENDIF(SEMS_USE_ILBC) ADD_SUBDIRECTORY (l16) ADD_SUBDIRECTORY (session_timer) -ADD_SUBDIRECTORY (sipctrl) IF(SPEEX_FOUND) ADD_SUBDIRECTORY (speex) ENDIF(SPEEX_FOUND) diff --git a/core/plug-in/sipctrl/CMakeLists.txt b/core/plug-in/sipctrl/CMakeLists.txt deleted file mode 100644 index e48e8a80..00000000 --- a/core/plug-in/sipctrl/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -set (sipctrl_SRCS - SipCtrlInterface.cpp - hash.cpp - hash_table.cpp - main.cpp - msg_fline.cpp - msg_hdrs.cpp - parse_common.cpp - parse_cseq.cpp - parse_from_to.cpp - parse_header.cpp - parse_uri.cpp - parse_via.cpp - resolver.cpp - sip_parser.cpp - sip_trans.cpp - trans_layer.cpp - transport.cpp - udp_trsp.cpp - wheeltimer.cpp -) - -IF(SEMS_USE_IPV6) - ADD_DEFINITIONS(-DSUPPORT_IPV6) -ENDIF(SEMS_USE_IPV6) - -SET(sems_module_name sipctrl) -INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt) -INCLUDE(${CMAKE_SOURCE_DIR}/cmake/config.rules.txt) diff --git a/core/plug-in/sipctrl/Makefile b/core/plug-in/sipctrl/Makefile deleted file mode 100644 index cf2d289f..00000000 --- a/core/plug-in/sipctrl/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -COREPATH =../.. -plug_in_name = sipctrl - -module_ldflags = -module_cflags = -DMOD_NAME=\"$(plug_in_name)\" - -%.o : %.c %.d - $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ - -%.d : %.c %.h Makefile - $(CC) -MM $< $(CFLAGS) $(CPPFLAGS) > $@ - -include ../Makefile.app_module diff --git a/core/plug-in/sipctrl/Makefile.standalone b/core/plug-in/sipctrl/Makefile.standalone deleted file mode 100644 index 24e713ff..00000000 --- a/core/plug-in/sipctrl/Makefile.standalone +++ /dev/null @@ -1,59 +0,0 @@ - -NAME = sip_parser - -SRCS = main.cpp \ - log.cpp \ - sip_parser.cpp \ - parse_uri.cpp \ - parse_header.cpp \ - parse_common.cpp \ - parse_via.cpp \ - parse_from_to.cpp \ - parse_cseq.cpp \ - msg_fline.cpp \ - msg_hdrs.cpp \ - hash_table.cpp \ - hash.cpp \ - trans_layer.cpp \ - transport.cpp \ - udp_trsp.cpp \ - resolver.cpp \ - wheeltimer.cpp \ - sip_trans.cpp \ - SipCtrlInterface.cpp \ - ../../AmThread.cpp \ - ../../AmUtils.cpp \ - ../../AmSipMsg.cpp - -CORE_PATH ?= ../.. - -OBJS = $(SRCS:.cpp=.o) -DEPS = $(SRCS:.cpp=.d) - -CXXFLAGS += -g -I $(CORE_PATH) -LDFLAGS += -lpthread -g -CPPFLAGS += -D_DEBUG -D_STANDALONE - -all: - -@$(MAKE) deps && \ - $(MAKE) sip_parser - -clean: - rm -f *.o *.d $(NAME) - -deps: $(DEPS) - - -$(NAME): $(OBJS) - $(CXX) -o $@ $(LDFLAGS) $(OBJS) - -%.o: %.cpp %.d - $(CXX) -o $@ -c $< $(CPPFLAGS) $(CXXFLAGS) - -%.d: %.cpp Makefile - $(CXX) -MM -MT '$@ $(@:.d=.o)' $< $(CPPFLAGS) $(CXXFLAGS) > $@ - - -ifeq '$(MAKECMDGOALS)' '$(NAME)' -include $(DEPS) -endif \ No newline at end of file diff --git a/core/plug-in/sipctrl/TODO b/core/plug-in/sipctrl/TODO deleted file mode 100644 index 2345bcd2..00000000 --- a/core/plug-in/sipctrl/TODO +++ /dev/null @@ -1,16 +0,0 @@ - -- (50%) add timers - - (99% ?) code timer routine (Mikkel) - - (0%) integrate timers into the transaction layer. - -- (0%) automatically add headers like 'Max-Forward: ' ? - -- (0%) transport resolver (multiple transports per proto/ip) - -- (100%) support record-routing - -> (100%) copy route header - -> (100%) compute next hop (w. RR, RURI, contact) - -- (100%) generate correct via - -- (100%) send 200 ACK diff --git a/core/plug-in/sipctrl/etc/sipctrl.conf b/core/plug-in/sipctrl/etc/sipctrl.conf deleted file mode 100644 index b1cc9521..00000000 --- a/core/plug-in/sipctrl/etc/sipctrl.conf +++ /dev/null @@ -1,22 +0,0 @@ -# -# Some finer grained SIP stack settings. -# - -# -# Accept final replies without To-tag? [yes|no] -# -#accept_fr_without_totag=yes - -# -# Log raw messages? [no|debug|info|warn|error] -# -# Default: debug -# -#log_raw_messages=no - -# -# Log parsed received messages? [yes|no] -# -# Default: yes -# -#log_parsed_messages=no diff --git a/core/plug-in/sipctrl/main.cpp b/core/plug-in/sipctrl/main.cpp deleted file mode 100644 index 83cce255..00000000 --- a/core/plug-in/sipctrl/main.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2007 Raphael Coeffic - * - * This file is part of sems, a free SIP media server. - * - * sems is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version - * - * For a license to use the ser software under conditions - * other than those described here, or to purchase support for this - * software, please contact iptel.org by e-mail at the following addresses: - * info@iptel.org - * - * sems is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "trans_layer.h" -#include "udp_trsp.h" - -#include "sip_parser.h" -#include "parse_header.h" -#include "hash_table.h" - -#include "log.h" - -#include "SipCtrlInterface.h" - -#include "AmSipMsg.h" -#include "AmUtils.h" - -#include - -#define SERVER - -static void sig_usr(int signo) -{ - WARN("signal %d received\n", signo); - - dumps_transactions(); - exit(0); - - return; -} - -int main() -{ - log_level = 3; - log_stderr = 1; - - //udp_trsp* udp_server = new udp_trsp(tl); - SipCtrlInterface* ctrl = new SipCtrlInterface("127.0.0.1",5060); - trans_layer::instance()->register_ua(ctrl); - -#ifndef SERVER - char* buf = - "REGISTER sip:192.168.0.22 SIP/2.0\r\n" - "Via: SIP/2.0/UDP 192.168.0.24:5060;branch=z9hG4bKf3f8ddeb9512414252418e7c18c2f0e;rport\r\n" - "From: \"Raphael\" ;tag=2239770325\r\n" - "To: \"Raphael\" \r\n" - "Call-ID: 1199294025@192_168_0_24\r\n" - "CSeq: 1 REGISTER\r\n" - "Contact: \r\n" - "Max-Forwards: 70\r\n" - "User-Agent: S450 IP020970000000\r\n" - "Expires: 180\r\n" - "Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY\r\n" - "Content-Length: 0\r\n" - "\r\n"; - - char* hdr = "Route: \r\n"; - - char *c = hdr; - - sip_msg* msg = new sip_msg(); - int err = parse_headers(msg,&c); - - if(err){ - ERROR("Route headers parsing failed\n"); - ERROR("Faulty headers were: <%s>\n",hdr); - return -1; - } - - -// char* buf = -// "INVITE sip:bob@biloxi.com;user=phone;tti=13;ttl=12?abc=def SIP/2.0\r\n" -// "Via: SIP/2.0/UDP bigbox3.site3.atlanta.com;branch=z9hG4bK77ef4c2312983.1\r\n" -// "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8\r\n" -// " ;received=192.0.2.1\r\n" -// "Max-Forwards: 69\r\n" -// "To: Bob \r\n" -// "From: sip:alice@atlanta.com;tag=1928301774\r\n" -// "Call-ID: a84b4c76e66710\r\n" -// "CSeq: 314159 INVITE\r\n" -// "Contact: \r\n" -// "Content-Type: application/sdp\r\n" -// "Content-Length: 148\r\n" -// "\r\n" -// "v=0\r\n" -// "o=alice 53655765 2353687637 IN IP4 pc33.atlanta.com\r\n" -// "s=-\r\n" -// "t=0 0\r\n" -// "c=IN IP4 pc33.atlanta.com\r\n" -// "m=audio 3456 RTP/AVP 0 1 3 99\r\n" -// "a=rtpmap:0 PCMU/8000"; - - //int buf_len = strlen(buf); - //sip_msg* msg = new sip_msg(buf,buf_len); - - //trans_layer* tl = trans_layer::instance(); - //tl->register_ua(ctrl); - //tl->received_msg(msg); - - //delete msg; - -#else - - if (signal(SIGINT, sig_usr) == SIG_ERR ) { - ERROR("no SIGINT signal handler can be installed\n"); - return -1; - } - - ctrl->start(); - -// sleep(1); - -// AmSipRequest req; -// req.method = "INVITE"; -// req.r_uri = "sip:sipp@tinytop:5080"; -// req.from = "From: SEMS ;tag=" + int2str(getpid()); -// //req.from_tag = "12345"; -// req.to = "To: SIPP "; -// req.cseq = 10; -// req.callid = int2str(getpid()) + "@tinytop"; -// req.contact = "Contact: sip:tinytop"; -// //req.route = "Route: ;blabla=abc"; - -// int send_err = ctrl->send(req, req.serKey); -// if(send_err < 0) { -// ERROR("ctrl->send() failed with error code %i\n",send_err); -// } - - //sleep(10); - ctrl->join(); - -#endif - - - return 0; -} diff --git a/core/sems.cpp b/core/sems.cpp index 612b842a..18305264 100644 --- a/core/sems.cpp +++ b/core/sems.cpp @@ -30,13 +30,15 @@ #include "AmConfig.h" #include "AmPlugIn.h" #include "AmSessionContainer.h" -#include "AmServer.h" +//#include "AmServer.h" #include "AmMediaProcessor.h" #include "AmRtpReceiver.h" #include "AmEventDispatcher.h" #include "AmZRTP.h" +#include "SipCtrlInterface.h" + #include "log.h" #include @@ -104,7 +106,7 @@ static void sig_usr_un(int signo) AmRtpReceiver::dispose(); - AmServer::dispose(); + //AmServer::dispose(); AmMediaProcessor::dispose(); @@ -261,7 +263,6 @@ int main(int argc, char* argv[]) // return -1; AmConfig::readConfiguration(); - // semsConfig.warnUnknownParams(); if(use_args(argv[0], args)){ print_usage(argv[0]); @@ -422,14 +423,10 @@ int main(int argc, char* argv[]) DBG("Starting RTP receiver\n"); AmRtpReceiver::instance()->start(); - if (AmServer::instance()->hasIface()) { - AmServer::instance()->run(); - } else { - ERROR("SEMS cannot start without a control interface plug-in.\n" - "The following plug-ins can be used: unixsockctrl, binrpcctrl, and sipctrl.\n" - "If SEMS should use its own SIP stack instead of SER's, please load the sipctrl plug-in.\n"); - return -1; - } + DBG("Starting SIP stack\n"); + SipCtrlInterface sip_ctrl; + sip_ctrl.load(); + sip_ctrl.run(AmConfig::LocalSIPIP,AmConfig::LocalSIPPort); return 0; } diff --git a/core/sems.h b/core/sems.h index 94bc0117..cec2c077 100644 --- a/core/sems.h +++ b/core/sems.h @@ -28,9 +28,9 @@ #ifndef _ans_machine_h_ #define _ans_machine_h_ -#ifndef SEMS_VERSION -#include "config.h" -#endif +#define SEMS_VERSION "1.3.0-dev" +#define OS "Darwin" +#define ARCH "i386" #define CONFIG_FILE "/usr/local/etc/sems/sems.conf" #define MOD_CFG_PATH "/usr/local/etc/sems/etc/" @@ -51,6 +51,11 @@ // session considered dead after 5 minutes no RTP #define DEAD_RTP_TIME 5*60 +/* Session Timer defaul configuration: */ +#define DEFAULT_ENABLE_SESSION_TIMER 1 +#define SESSION_EXPIRES 60 // seconds +#define MINIMUM_TIMER 5 //seconds + #define NUM_MEDIA_PROCESSORS 1 #define MAX_NET_DEVICES 32 diff --git a/core/sip/Makefile b/core/sip/Makefile new file mode 100644 index 00000000..e3d3a35a --- /dev/null +++ b/core/sip/Makefile @@ -0,0 +1,716 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Produce verbose output by default. +VERBOSE = 1 + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /opt/local/bin/cmake + +# The command to remove a file. +RM = /opt/local/bin/cmake -E remove -f + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /opt/local/bin/ccmake + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/rco/Src/sems.pub/trunk + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/rco/Src/sems.pub/trunk/core/sip + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /opt/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /opt/local/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /opt/local/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /opt/local/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /opt/local/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip +.PHONY : install/strip/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /opt/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/rco/Src/sems.pub/trunk/core/sip/CMakeFiles /Users/rco/Src/sems.pub/trunk/core/sip/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/rco/Src/sems.pub/trunk/core/sip/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named sems + +# Build rule for target. +sems: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems +.PHONY : sems + +# fast build rule for target. +sems/fast: + $(MAKE) -f core/CMakeFiles/sems.dir/build.make core/CMakeFiles/sems.dir/build +.PHONY : sems/fast + +#============================================================================= +# Target rules for targets named sems_adpcm + +# Build rule for target. +sems_adpcm: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_adpcm +.PHONY : sems_adpcm + +# fast build rule for target. +sems_adpcm/fast: + $(MAKE) -f core/plug-in/adpcm/CMakeFiles/sems_adpcm.dir/build.make core/plug-in/adpcm/CMakeFiles/sems_adpcm.dir/build +.PHONY : sems_adpcm/fast + +#============================================================================= +# Target rules for targets named sems_echo + +# Build rule for target. +sems_echo: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_echo +.PHONY : sems_echo + +# fast build rule for target. +sems_echo/fast: + $(MAKE) -f core/plug-in/echo/CMakeFiles/sems_echo.dir/build.make core/plug-in/echo/CMakeFiles/sems_echo.dir/build +.PHONY : sems_echo/fast + +#============================================================================= +# Target rules for targets named sems_ilbc + +# Build rule for target. +sems_ilbc: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_ilbc +.PHONY : sems_ilbc + +# fast build rule for target. +sems_ilbc/fast: + $(MAKE) -f core/plug-in/ilbc/CMakeFiles/sems_ilbc.dir/build.make core/plug-in/ilbc/CMakeFiles/sems_ilbc.dir/build +.PHONY : sems_ilbc/fast + +#============================================================================= +# Target rules for targets named libilbc + +# Build rule for target. +libilbc: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 libilbc +.PHONY : libilbc + +# fast build rule for target. +libilbc/fast: + $(MAKE) -f core/plug-in/ilbc/iLBC_rfc3951/CMakeFiles/libilbc.dir/build.make core/plug-in/ilbc/iLBC_rfc3951/CMakeFiles/libilbc.dir/build +.PHONY : libilbc/fast + +#============================================================================= +# Target rules for targets named sems_l16 + +# Build rule for target. +sems_l16: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_l16 +.PHONY : sems_l16 + +# fast build rule for target. +sems_l16/fast: + $(MAKE) -f core/plug-in/l16/CMakeFiles/sems_l16.dir/build.make core/plug-in/l16/CMakeFiles/sems_l16.dir/build +.PHONY : sems_l16/fast + +#============================================================================= +# Target rules for targets named sems_session_timer + +# Build rule for target. +sems_session_timer: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_session_timer +.PHONY : sems_session_timer + +# fast build rule for target. +sems_session_timer/fast: + $(MAKE) -f core/plug-in/session_timer/CMakeFiles/sems_session_timer.dir/build.make core/plug-in/session_timer/CMakeFiles/sems_session_timer.dir/build +.PHONY : sems_session_timer/fast + +#============================================================================= +# Target rules for targets named sems_speex + +# Build rule for target. +sems_speex: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_speex +.PHONY : sems_speex + +# fast build rule for target. +sems_speex/fast: + $(MAKE) -f core/plug-in/speex/CMakeFiles/sems_speex.dir/build.make core/plug-in/speex/CMakeFiles/sems_speex.dir/build +.PHONY : sems_speex/fast + +#============================================================================= +# Target rules for targets named sems-stats + +# Build rule for target. +sems-stats: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems-stats +.PHONY : sems-stats + +# fast build rule for target. +sems-stats/fast: + $(MAKE) -f core/plug-in/stats/CMakeFiles/sems-stats.dir/build.make core/plug-in/stats/CMakeFiles/sems-stats.dir/build +.PHONY : sems-stats/fast + +#============================================================================= +# Target rules for targets named sems_stats + +# Build rule for target. +sems_stats: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_stats +.PHONY : sems_stats + +# fast build rule for target. +sems_stats/fast: + $(MAKE) -f core/plug-in/stats/CMakeFiles/sems_stats.dir/build.make core/plug-in/stats/CMakeFiles/sems_stats.dir/build +.PHONY : sems_stats/fast + +#============================================================================= +# Target rules for targets named sems_uac_auth + +# Build rule for target. +sems_uac_auth: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_uac_auth +.PHONY : sems_uac_auth + +# fast build rule for target. +sems_uac_auth/fast: + $(MAKE) -f core/plug-in/uac_auth/CMakeFiles/sems_uac_auth.dir/build.make core/plug-in/uac_auth/CMakeFiles/sems_uac_auth.dir/build +.PHONY : sems_uac_auth/fast + +#============================================================================= +# Target rules for targets named sems_wav + +# Build rule for target. +sems_wav: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_wav +.PHONY : sems_wav + +# fast build rule for target. +sems_wav/fast: + $(MAKE) -f core/plug-in/wav/CMakeFiles/sems_wav.dir/build.make core/plug-in/wav/CMakeFiles/sems_wav.dir/build +.PHONY : sems_wav/fast + +#============================================================================= +# Target rules for targets named sems_ann_b2b + +# Build rule for target. +sems_ann_b2b: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_ann_b2b +.PHONY : sems_ann_b2b + +# fast build rule for target. +sems_ann_b2b/fast: + $(MAKE) -f apps/ann_b2b/CMakeFiles/sems_ann_b2b.dir/build.make apps/ann_b2b/CMakeFiles/sems_ann_b2b.dir/build +.PHONY : sems_ann_b2b/fast + +#============================================================================= +# Target rules for targets named sems_announce_transfer + +# Build rule for target. +sems_announce_transfer: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_announce_transfer +.PHONY : sems_announce_transfer + +# fast build rule for target. +sems_announce_transfer/fast: + $(MAKE) -f apps/announce_transfer/CMakeFiles/sems_announce_transfer.dir/build.make apps/announce_transfer/CMakeFiles/sems_announce_transfer.dir/build +.PHONY : sems_announce_transfer/fast + +#============================================================================= +# Target rules for targets named sems_announcement + +# Build rule for target. +sems_announcement: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_announcement +.PHONY : sems_announcement + +# fast build rule for target. +sems_announcement/fast: + $(MAKE) -f apps/announcement/CMakeFiles/sems_announcement.dir/build.make apps/announcement/CMakeFiles/sems_announcement.dir/build +.PHONY : sems_announcement/fast + +#============================================================================= +# Target rules for targets named sems_annrecorder + +# Build rule for target. +sems_annrecorder: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_annrecorder +.PHONY : sems_annrecorder + +# fast build rule for target. +sems_annrecorder/fast: + $(MAKE) -f apps/annrecorder/CMakeFiles/sems_annrecorder.dir/build.make apps/annrecorder/CMakeFiles/sems_annrecorder.dir/build +.PHONY : sems_annrecorder/fast + +#============================================================================= +# Target rules for targets named sems_auth_b2b + +# Build rule for target. +sems_auth_b2b: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_auth_b2b +.PHONY : sems_auth_b2b + +# fast build rule for target. +sems_auth_b2b/fast: + $(MAKE) -f apps/auth_b2b/CMakeFiles/sems_auth_b2b.dir/build.make apps/auth_b2b/CMakeFiles/sems_auth_b2b.dir/build +.PHONY : sems_auth_b2b/fast + +#============================================================================= +# Target rules for targets named sems_call_timer + +# Build rule for target. +sems_call_timer: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_call_timer +.PHONY : sems_call_timer + +# fast build rule for target. +sems_call_timer/fast: + $(MAKE) -f apps/call_timer/CMakeFiles/sems_call_timer.dir/build.make apps/call_timer/CMakeFiles/sems_call_timer.dir/build +.PHONY : sems_call_timer/fast + +#============================================================================= +# Target rules for targets named sems_callback + +# Build rule for target. +sems_callback: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_callback +.PHONY : sems_callback + +# fast build rule for target. +sems_callback/fast: + $(MAKE) -f apps/callback/CMakeFiles/sems_callback.dir/build.make apps/callback/CMakeFiles/sems_callback.dir/build +.PHONY : sems_callback/fast + +#============================================================================= +# Target rules for targets named sems_click2dial + +# Build rule for target. +sems_click2dial: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_click2dial +.PHONY : sems_click2dial + +# fast build rule for target. +sems_click2dial/fast: + $(MAKE) -f apps/click2dial/CMakeFiles/sems_click2dial.dir/build.make apps/click2dial/CMakeFiles/sems_click2dial.dir/build +.PHONY : sems_click2dial/fast + +#============================================================================= +# Target rules for targets named sems_conference + +# Build rule for target. +sems_conference: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_conference +.PHONY : sems_conference + +# fast build rule for target. +sems_conference/fast: + $(MAKE) -f apps/conference/CMakeFiles/sems_conference.dir/build.make apps/conference/CMakeFiles/sems_conference.dir/build +.PHONY : sems_conference/fast + +#============================================================================= +# Target rules for targets named sems_dsm + +# Build rule for target. +sems_dsm: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm +.PHONY : sems_dsm + +# fast build rule for target. +sems_dsm/fast: + $(MAKE) -f apps/dsm/CMakeFiles/sems_dsm.dir/build.make apps/dsm/CMakeFiles/sems_dsm.dir/build +.PHONY : sems_dsm/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_conference + +# Build rule for target. +sems_dsm_mod_conference: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_conference +.PHONY : sems_dsm_mod_conference + +# fast build rule for target. +sems_dsm_mod_conference/fast: + $(MAKE) -f apps/dsm/mods/mod_conference/CMakeFiles/sems_dsm_mod_conference.dir/build.make apps/dsm/mods/mod_conference/CMakeFiles/sems_dsm_mod_conference.dir/build +.PHONY : sems_dsm_mod_conference/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_dlg + +# Build rule for target. +sems_dsm_mod_dlg: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_dlg +.PHONY : sems_dsm_mod_dlg + +# fast build rule for target. +sems_dsm_mod_dlg/fast: + $(MAKE) -f apps/dsm/mods/mod_dlg/CMakeFiles/sems_dsm_mod_dlg.dir/build.make apps/dsm/mods/mod_dlg/CMakeFiles/sems_dsm_mod_dlg.dir/build +.PHONY : sems_dsm_mod_dlg/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_py + +# Build rule for target. +sems_dsm_mod_py: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_py +.PHONY : sems_dsm_mod_py + +# fast build rule for target. +sems_dsm_mod_py/fast: + $(MAKE) -f apps/dsm/mods/mod_py/CMakeFiles/sems_dsm_mod_py.dir/build.make apps/dsm/mods/mod_py/CMakeFiles/sems_dsm_mod_py.dir/build +.PHONY : sems_dsm_mod_py/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_sys + +# Build rule for target. +sems_dsm_mod_sys: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_sys +.PHONY : sems_dsm_mod_sys + +# fast build rule for target. +sems_dsm_mod_sys/fast: + $(MAKE) -f apps/dsm/mods/mod_sys/CMakeFiles/sems_dsm_mod_sys.dir/build.make apps/dsm/mods/mod_sys/CMakeFiles/sems_dsm_mod_sys.dir/build +.PHONY : sems_dsm_mod_sys/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_uri + +# Build rule for target. +sems_dsm_mod_uri: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_uri +.PHONY : sems_dsm_mod_uri + +# fast build rule for target. +sems_dsm_mod_uri/fast: + $(MAKE) -f apps/dsm/mods/mod_uri/CMakeFiles/sems_dsm_mod_uri.dir/build.make apps/dsm/mods/mod_uri/CMakeFiles/sems_dsm_mod_uri.dir/build +.PHONY : sems_dsm_mod_uri/fast + +#============================================================================= +# Target rules for targets named sems_dsm_mod_utils + +# Build rule for target. +sems_dsm_mod_utils: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_dsm_mod_utils +.PHONY : sems_dsm_mod_utils + +# fast build rule for target. +sems_dsm_mod_utils/fast: + $(MAKE) -f apps/dsm/mods/mod_utils/CMakeFiles/sems_dsm_mod_utils.dir/build.make apps/dsm/mods/mod_utils/CMakeFiles/sems_dsm_mod_utils.dir/build +.PHONY : sems_dsm_mod_utils/fast + +#============================================================================= +# Target rules for targets named sems_early_announce + +# Build rule for target. +sems_early_announce: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_early_announce +.PHONY : sems_early_announce + +# fast build rule for target. +sems_early_announce/fast: + $(MAKE) -f apps/early_announce/CMakeFiles/sems_early_announce.dir/build.make apps/early_announce/CMakeFiles/sems_early_announce.dir/build +.PHONY : sems_early_announce/fast + +#============================================================================= +# Target rules for targets named sems_ivr + +# Build rule for target. +sems_ivr: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_ivr +.PHONY : sems_ivr + +# fast build rule for target. +sems_ivr/fast: + $(MAKE) -f apps/ivr/CMakeFiles/sems_ivr.dir/build.make apps/ivr/CMakeFiles/sems_ivr.dir/build +.PHONY : sems_ivr/fast + +#============================================================================= +# Target rules for targets named sems_monitoring + +# Build rule for target. +sems_monitoring: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_monitoring +.PHONY : sems_monitoring + +# fast build rule for target. +sems_monitoring/fast: + $(MAKE) -f apps/monitoring/CMakeFiles/sems_monitoring.dir/build.make apps/monitoring/CMakeFiles/sems_monitoring.dir/build +.PHONY : sems_monitoring/fast + +#============================================================================= +# Target rules for targets named sems_msg_storage + +# Build rule for target. +sems_msg_storage: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_msg_storage +.PHONY : sems_msg_storage + +# fast build rule for target. +sems_msg_storage/fast: + $(MAKE) -f apps/msg_storage/CMakeFiles/sems_msg_storage.dir/build.make apps/msg_storage/CMakeFiles/sems_msg_storage.dir/build +.PHONY : sems_msg_storage/fast + +#============================================================================= +# Target rules for targets named sems_precoded_announce + +# Build rule for target. +sems_precoded_announce: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_precoded_announce +.PHONY : sems_precoded_announce + +# fast build rule for target. +sems_precoded_announce/fast: + $(MAKE) -f apps/precoded_announce/CMakeFiles/sems_precoded_announce.dir/build.make apps/precoded_announce/CMakeFiles/sems_precoded_announce.dir/build +.PHONY : sems_precoded_announce/fast + +#============================================================================= +# Target rules for targets named sems_reg_agent + +# Build rule for target. +sems_reg_agent: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_reg_agent +.PHONY : sems_reg_agent + +# fast build rule for target. +sems_reg_agent/fast: + $(MAKE) -f apps/reg_agent/CMakeFiles/sems_reg_agent.dir/build.make apps/reg_agent/CMakeFiles/sems_reg_agent.dir/build +.PHONY : sems_reg_agent/fast + +#============================================================================= +# Target rules for targets named sems_registrar_client + +# Build rule for target. +sems_registrar_client: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_registrar_client +.PHONY : sems_registrar_client + +# fast build rule for target. +sems_registrar_client/fast: + $(MAKE) -f apps/registrar_client/CMakeFiles/sems_registrar_client.dir/build.make apps/registrar_client/CMakeFiles/sems_registrar_client.dir/build +.PHONY : sems_registrar_client/fast + +#============================================================================= +# Target rules for targets named sems_sw_prepaid_sip + +# Build rule for target. +sems_sw_prepaid_sip: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_sw_prepaid_sip +.PHONY : sems_sw_prepaid_sip + +# fast build rule for target. +sems_sw_prepaid_sip/fast: + $(MAKE) -f apps/sw_prepaid_sip/CMakeFiles/sems_sw_prepaid_sip.dir/build.make apps/sw_prepaid_sip/CMakeFiles/sems_sw_prepaid_sip.dir/build +.PHONY : sems_sw_prepaid_sip/fast + +#============================================================================= +# Target rules for targets named sems_voicebox + +# Build rule for target. +sems_voicebox: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_voicebox +.PHONY : sems_voicebox + +# fast build rule for target. +sems_voicebox/fast: + $(MAKE) -f apps/voicebox/CMakeFiles/sems_voicebox.dir/build.make apps/voicebox/CMakeFiles/sems_voicebox.dir/build +.PHONY : sems_voicebox/fast + +#============================================================================= +# Target rules for targets named sems_voicemail + +# Build rule for target. +sems_voicemail: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_voicemail +.PHONY : sems_voicemail + +# fast build rule for target. +sems_voicemail/fast: + $(MAKE) -f apps/voicemail/CMakeFiles/sems_voicemail.dir/build.make apps/voicemail/CMakeFiles/sems_voicemail.dir/build +.PHONY : sems_voicemail/fast + +#============================================================================= +# Target rules for targets named sems_webconference + +# Build rule for target. +sems_webconference: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 sems_webconference +.PHONY : sems_webconference + +# fast build rule for target. +sems_webconference/fast: + $(MAKE) -f apps/webconference/CMakeFiles/sems_webconference.dir/build.make apps/webconference/CMakeFiles/sems_webconference.dir/build +.PHONY : sems_webconference/fast + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... sems" + @echo "... sems_adpcm" + @echo "... sems_echo" + @echo "... sems_ilbc" + @echo "... libilbc" + @echo "... sems_l16" + @echo "... sems_session_timer" + @echo "... sems_speex" + @echo "... sems-stats" + @echo "... sems_stats" + @echo "... sems_uac_auth" + @echo "... sems_wav" + @echo "... sems_ann_b2b" + @echo "... sems_announce_transfer" + @echo "... sems_announcement" + @echo "... sems_annrecorder" + @echo "... sems_auth_b2b" + @echo "... sems_call_timer" + @echo "... sems_callback" + @echo "... sems_click2dial" + @echo "... sems_conference" + @echo "... sems_dsm" + @echo "... sems_dsm_mod_conference" + @echo "... sems_dsm_mod_dlg" + @echo "... sems_dsm_mod_py" + @echo "... sems_dsm_mod_sys" + @echo "... sems_dsm_mod_uri" + @echo "... sems_dsm_mod_utils" + @echo "... sems_early_announce" + @echo "... sems_ivr" + @echo "... sems_monitoring" + @echo "... sems_msg_storage" + @echo "... sems_precoded_announce" + @echo "... sems_reg_agent" + @echo "... sems_registrar_client" + @echo "... sems_sw_prepaid_sip" + @echo "... sems_voicebox" + @echo "... sems_voicemail" + @echo "... sems_webconference" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/core/plug-in/sipctrl/cstring.h b/core/sip/cstring.h similarity index 97% rename from core/plug-in/sipctrl/cstring.h rename to core/sip/cstring.h index 4df4a481..87ac1f14 100644 --- a/core/plug-in/sipctrl/cstring.h +++ b/core/sip/cstring.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: cstring.h 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/hash.cpp b/core/sip/hash.cpp similarity index 100% rename from core/plug-in/sipctrl/hash.cpp rename to core/sip/hash.cpp diff --git a/core/plug-in/sipctrl/hash.h b/core/sip/hash.h similarity index 100% rename from core/plug-in/sipctrl/hash.h rename to core/sip/hash.h diff --git a/core/plug-in/sipctrl/hash_table.cpp b/core/sip/hash_table.cpp similarity index 99% rename from core/plug-in/sipctrl/hash_table.cpp rename to core/sip/hash_table.cpp index 40e59deb..fef29f1b 100644 --- a/core/plug-in/sipctrl/hash_table.cpp +++ b/core/sip/hash_table.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: hash_table.cpp 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/hash_table.h b/core/sip/hash_table.h similarity index 98% rename from core/plug-in/sipctrl/hash_table.h rename to core/sip/hash_table.h index 67105516..7bd7d476 100644 --- a/core/plug-in/sipctrl/hash_table.h +++ b/core/sip/hash_table.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: hash_table.h 1486 2009-08-29 14:40:38Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/msg_fline.cpp b/core/sip/msg_fline.cpp similarity index 97% rename from core/plug-in/sipctrl/msg_fline.cpp rename to core/sip/msg_fline.cpp index 334b6395..47ac6bfa 100644 --- a/core/plug-in/sipctrl/msg_fline.cpp +++ b/core/sip/msg_fline.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: msg_fline.cpp 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/msg_fline.h b/core/sip/msg_fline.h similarity index 97% rename from core/plug-in/sipctrl/msg_fline.h rename to core/sip/msg_fline.h index 6f0769e7..2fb095a7 100644 --- a/core/plug-in/sipctrl/msg_fline.h +++ b/core/sip/msg_fline.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: msg_fline.h 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/msg_hdrs.cpp b/core/sip/msg_hdrs.cpp similarity index 96% rename from core/plug-in/sipctrl/msg_hdrs.cpp rename to core/sip/msg_hdrs.cpp index 33b5de27..f9124c04 100644 --- a/core/plug-in/sipctrl/msg_hdrs.cpp +++ b/core/sip/msg_hdrs.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: msg_hdrs.cpp 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/msg_hdrs.h b/core/sip/msg_hdrs.h similarity index 98% rename from core/plug-in/sipctrl/msg_hdrs.h rename to core/sip/msg_hdrs.h index 6ca2314b..fcc0031d 100644 --- a/core/plug-in/sipctrl/msg_hdrs.h +++ b/core/sip/msg_hdrs.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: msg_hdrs.h 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_common.cpp b/core/sip/parse_common.cpp similarity index 98% rename from core/plug-in/sipctrl/parse_common.cpp rename to core/sip/parse_common.cpp index 7936fecf..fe269729 100644 --- a/core/plug-in/sipctrl/parse_common.cpp +++ b/core/sip/parse_common.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_common.cpp 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_common.h b/core/sip/parse_common.h similarity index 98% rename from core/plug-in/sipctrl/parse_common.h rename to core/sip/parse_common.h index 250d2d7f..15cbf9f5 100644 --- a/core/plug-in/sipctrl/parse_common.h +++ b/core/sip/parse_common.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_common.h 1486 2009-08-29 14:40:38Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_cseq.cpp b/core/sip/parse_cseq.cpp similarity index 97% rename from core/plug-in/sipctrl/parse_cseq.cpp rename to core/sip/parse_cseq.cpp index ed3fae26..415d85e4 100644 --- a/core/plug-in/sipctrl/parse_cseq.cpp +++ b/core/sip/parse_cseq.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_cseq.cpp 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_cseq.h b/core/sip/parse_cseq.h similarity index 96% rename from core/plug-in/sipctrl/parse_cseq.h rename to core/sip/parse_cseq.h index f6d67d2a..8b45a5e5 100644 --- a/core/plug-in/sipctrl/parse_cseq.h +++ b/core/sip/parse_cseq.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_cseq.h 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_from_to.cpp b/core/sip/parse_from_to.cpp similarity index 98% rename from core/plug-in/sipctrl/parse_from_to.cpp rename to core/sip/parse_from_to.cpp index 1c6cecab..65a43498 100644 --- a/core/plug-in/sipctrl/parse_from_to.cpp +++ b/core/sip/parse_from_to.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_from_to.cpp 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_from_to.h b/core/sip/parse_from_to.h similarity index 97% rename from core/plug-in/sipctrl/parse_from_to.h rename to core/sip/parse_from_to.h index 6bcb2cab..f26d96bf 100644 --- a/core/plug-in/sipctrl/parse_from_to.h +++ b/core/sip/parse_from_to.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_from_to.h 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_header.cpp b/core/sip/parse_header.cpp similarity index 99% rename from core/plug-in/sipctrl/parse_header.cpp rename to core/sip/parse_header.cpp index db4e07eb..3844fa4f 100644 --- a/core/plug-in/sipctrl/parse_header.cpp +++ b/core/sip/parse_header.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_header.cpp 1119 2008-10-16 08:54:04Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_header.h b/core/sip/parse_header.h similarity index 96% rename from core/plug-in/sipctrl/parse_header.h rename to core/sip/parse_header.h index 09062179..eafe7156 100644 --- a/core/plug-in/sipctrl/parse_header.h +++ b/core/sip/parse_header.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_header.h 850 2008-04-04 21:29:36Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_uri.cpp b/core/sip/parse_uri.cpp similarity index 99% rename from core/plug-in/sipctrl/parse_uri.cpp rename to core/sip/parse_uri.cpp index f1ca0ba0..cc2e216f 100644 --- a/core/plug-in/sipctrl/parse_uri.cpp +++ b/core/sip/parse_uri.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_uri.cpp 1714 2010-03-30 14:47:36Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_uri.h b/core/sip/parse_uri.h similarity index 96% rename from core/plug-in/sipctrl/parse_uri.h rename to core/sip/parse_uri.h index eb2c3285..019386fa 100644 --- a/core/plug-in/sipctrl/parse_uri.h +++ b/core/sip/parse_uri.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_uri.h 1133 2008-11-23 11:31:34Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_via.cpp b/core/sip/parse_via.cpp similarity index 99% rename from core/plug-in/sipctrl/parse_via.cpp rename to core/sip/parse_via.cpp index 11417edb..bee265fa 100644 --- a/core/plug-in/sipctrl/parse_via.cpp +++ b/core/sip/parse_via.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_via.cpp 1714 2010-03-30 14:47:36Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/parse_via.h b/core/sip/parse_via.h similarity index 97% rename from core/plug-in/sipctrl/parse_via.h rename to core/sip/parse_via.h index 08355b47..7e0c3b3e 100644 --- a/core/plug-in/sipctrl/parse_via.h +++ b/core/sip/parse_via.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: parse_via.h 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/resolver.cpp b/core/sip/resolver.cpp similarity index 97% rename from core/plug-in/sipctrl/resolver.cpp rename to core/sip/resolver.cpp index 1088ab29..862e9c24 100644 --- a/core/plug-in/sipctrl/resolver.cpp +++ b/core/sip/resolver.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: resolver.cpp 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/resolver.h b/core/sip/resolver.h similarity index 96% rename from core/plug-in/sipctrl/resolver.h rename to core/sip/resolver.h index 86ed2f75..09755111 100644 --- a/core/plug-in/sipctrl/resolver.h +++ b/core/sip/resolver.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: resolver.h 1460 2009-07-08 12:50:39Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_parser.cpp b/core/sip/sip_parser.cpp similarity index 99% rename from core/plug-in/sipctrl/sip_parser.cpp rename to core/sip/sip_parser.cpp index 8a79fe97..062bfde6 100644 --- a/core/plug-in/sipctrl/sip_parser.cpp +++ b/core/sip/sip_parser.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_parser.cpp 1486 2009-08-29 14:40:38Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_parser.h b/core/sip/sip_parser.h similarity index 98% rename from core/plug-in/sipctrl/sip_parser.h rename to core/sip/sip_parser.h index 4245b17b..29035ebc 100644 --- a/core/plug-in/sipctrl/sip_parser.h +++ b/core/sip/sip_parser.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_parser.h 1486 2009-08-29 14:40:38Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_timers.h b/core/sip/sip_timers.h similarity index 97% rename from core/plug-in/sipctrl/sip_timers.h rename to core/sip/sip_timers.h index 5edfad6d..5f64315e 100644 --- a/core/plug-in/sipctrl/sip_timers.h +++ b/core/sip/sip_timers.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_timers.h 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_trans.cpp b/core/sip/sip_trans.cpp similarity index 98% rename from core/plug-in/sipctrl/sip_trans.cpp rename to core/sip/sip_trans.cpp index 8217218b..c66d44c5 100644 --- a/core/plug-in/sipctrl/sip_trans.cpp +++ b/core/sip/sip_trans.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_trans.cpp 1712 2010-03-30 13:05:58Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_trans.h b/core/sip/sip_trans.h similarity index 98% rename from core/plug-in/sipctrl/sip_trans.h rename to core/sip/sip_trans.h index be8dbd8e..62d335f7 100644 --- a/core/plug-in/sipctrl/sip_trans.h +++ b/core/sip/sip_trans.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_trans.h 1001 2008-06-02 10:19:47Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/sip_ua.h b/core/sip/sip_ua.h similarity index 96% rename from core/plug-in/sipctrl/sip_ua.h rename to core/sip/sip_ua.h index 66f24656..f555ccc5 100644 --- a/core/plug-in/sipctrl/sip_ua.h +++ b/core/sip/sip_ua.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: sip_ua.h 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/trans_layer.cpp b/core/sip/trans_layer.cpp similarity index 99% rename from core/plug-in/sipctrl/trans_layer.cpp rename to core/sip/trans_layer.cpp index eacaeb5c..2a4efd1b 100644 --- a/core/plug-in/sipctrl/trans_layer.cpp +++ b/core/sip/trans_layer.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: trans_layer.cpp 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * @@ -1133,8 +1133,8 @@ int trans_layer::update_uac_reply(trans_bucket* bucket, sip_trans* t, sip_msg* m to_tag = ((sip_from_to*)msg->to->p)->tag; if((t->msg->u.request->method != sip_request::CANCEL) && !to_tag.len){ DBG("To-tag missing in final reply (see sipctrl.conf?)\n"); - if (!SipCtrlInterfaceFactory::accept_fr_without_totag) - return -1; + //if (!SipCtrlInterface::accept_fr_without_totag) + // return -1; } if(t->msg->u.request->method == sip_request::INVITE){ diff --git a/core/plug-in/sipctrl/trans_layer.h b/core/sip/trans_layer.h similarity index 98% rename from core/plug-in/sipctrl/trans_layer.h rename to core/sip/trans_layer.h index 63b77775..2e2a7a10 100644 --- a/core/plug-in/sipctrl/trans_layer.h +++ b/core/sip/trans_layer.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: trans_layer.h 1486 2009-08-29 14:40:38Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/transport.cpp b/core/sip/transport.cpp similarity index 95% rename from core/plug-in/sipctrl/transport.cpp rename to core/sip/transport.cpp index 5ade1769..e83e0527 100644 --- a/core/plug-in/sipctrl/transport.cpp +++ b/core/sip/transport.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: transport.cpp 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/transport.h b/core/sip/transport.h similarity index 96% rename from core/plug-in/sipctrl/transport.h rename to core/sip/transport.h index 100e111a..25948487 100644 --- a/core/plug-in/sipctrl/transport.h +++ b/core/sip/transport.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: transport.h 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * @@ -27,7 +27,7 @@ #ifndef _transport_h_ #define _transport_h_ -#include "AmThread.h" +#include "../AmThread.h" #include using std::string; diff --git a/core/plug-in/sipctrl/udp_trsp.cpp b/core/sip/udp_trsp.cpp similarity index 94% rename from core/plug-in/sipctrl/udp_trsp.cpp rename to core/sip/udp_trsp.cpp index 2cff6646..1c5bb0b3 100644 --- a/core/plug-in/sipctrl/udp_trsp.cpp +++ b/core/sip/udp_trsp.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: udp_trsp.cpp 1713 2010-03-30 14:11:14Z rco $ * * Copyright (C) 2007 Raphael Coeffic * @@ -136,7 +136,7 @@ void udp_trsp::run() if (SipCtrlInterfaceFactory::log_raw_messages >= 0) { _LOG(SipCtrlInterfaceFactory::log_raw_messages, - "recvd msg\n--++--\n%s--++--\n", s_msg->buf); + "recvd msg\n--++--\n%.*s--++--\n", s_msg->len, s_msg->buf); } memcpy(&s_msg->remote_ip,msg.msg_name,msg.msg_namelen); @@ -233,14 +233,11 @@ int udp_trsp::bind(const string& address, unsigned short port) /** @see transport */ int udp_trsp::send(const sockaddr_storage* sa, const char* msg, const int msg_len) { - if ((SipCtrlInterfaceFactory::log_raw_messages >= 0) - && (SipCtrlInterfaceFactory::log_raw_messages <=log_level)) { - char buf[MAX_UDP_MSGLEN]; - memcpy(buf, msg, msg_len); - buf[msg_len]='\0'; - _LOG(SipCtrlInterfaceFactory::log_raw_messages, - "send msg\n--++--\n%s--++--\n", buf); - } +// if ((SipCtrlInterfaceFactory::log_raw_messages >= 0) +// && (SipCtrlInterfaceFactory::log_raw_messages <=log_level)) { +// _LOG(SipCtrlInterfaceFactory::log_raw_messages, +// "send msg\n--++--\n%.*s--++--\n", msg_len, msg); +// } int err; #ifdef SUPPORT_IPV6 diff --git a/core/plug-in/sipctrl/udp_trsp.h b/core/sip/udp_trsp.h similarity index 97% rename from core/plug-in/sipctrl/udp_trsp.h rename to core/sip/udp_trsp.h index 127f5a94..397e20ca 100644 --- a/core/plug-in/sipctrl/udp_trsp.h +++ b/core/sip/udp_trsp.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: udp_trsp.h 1048 2008-07-15 18:48:07Z sayer $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/wheeltimer.cpp b/core/sip/wheeltimer.cpp similarity index 98% rename from core/plug-in/sipctrl/wheeltimer.cpp rename to core/sip/wheeltimer.cpp index fb01d88c..a3649f28 100644 --- a/core/plug-in/sipctrl/wheeltimer.cpp +++ b/core/sip/wheeltimer.cpp @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: wheeltimer.cpp 1224 2009-01-09 09:55:37Z rco $ * * Copyright (C) 2007 Raphael Coeffic * diff --git a/core/plug-in/sipctrl/wheeltimer.h b/core/sip/wheeltimer.h similarity index 97% rename from core/plug-in/sipctrl/wheeltimer.h rename to core/sip/wheeltimer.h index 820f8c63..2dc53685 100644 --- a/core/plug-in/sipctrl/wheeltimer.h +++ b/core/sip/wheeltimer.h @@ -1,5 +1,5 @@ /* - * $Id$ + * $Id: wheeltimer.h 1224 2009-01-09 09:55:37Z rco $ * * Copyright (C) 2007 Raphael Coeffic * @@ -28,7 +28,7 @@ #ifndef _wheeltimer_h_ #define _wheeltimer_h_ -#include "AmThread.h" +#include "../AmThread.h" #include