From 38283be16287809599357bfc09f9992bf51c28f3 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Fri, 16 Apr 2010 10:09:02 +0000 Subject: [PATCH] cleanup work. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1803 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/SipCtrlInterface.cpp | 72 +++++++++++++++++---------------------- core/SipCtrlInterface.h | 12 +------ 2 files changed, 33 insertions(+), 51 deletions(-) diff --git a/core/SipCtrlInterface.cpp b/core/SipCtrlInterface.cpp index b41be772..2f9c82b2 100644 --- a/core/SipCtrlInterface.cpp +++ b/core/SipCtrlInterface.cpp @@ -364,44 +364,6 @@ int SipCtrlInterface::send(const AmSipReply &rep) #define DBG_PARAM(p)\ DBG("%s = <%s>\n",#p,p.c_str()); -void SipCtrlInterface::handleSipMsg(AmSipRequest &req) -{ - DBG("Received new request\n"); - if (SipCtrlInterface::log_parsed_messages) { - // DBG_PARAM(req.cmd); - DBG_PARAM(req.method); - // DBG_PARAM(req.user); - // DBG_PARAM(req.domain); - // DBG_PARAM(req.dstip); - // DBG_PARAM(req.port); - DBG_PARAM(req.r_uri); - DBG_PARAM(req.from_uri); - DBG_PARAM(req.from); - DBG_PARAM(req.to); - DBG_PARAM(req.callid); - DBG_PARAM(req.from_tag); - DBG_PARAM(req.to_tag); - DBG("cseq = <%i>\n",req.cseq); - DBG_PARAM(req.route); - DBG_PARAM(req.next_hop); - DBG("hdrs = <%s>\n",req.hdrs.c_str()); - DBG("body = <%s>\n",req.body.c_str()); - } - - AmSipDispatcher::instance()->handleSipMsg(req); -} - -void SipCtrlInterface::handleSipMsg(AmSipReply &rep) -{ - DBG("Received reply: %i %s\n",rep.code,rep.reason.c_str()); - DBG_PARAM(rep.callid); - DBG_PARAM(rep.local_tag); - DBG_PARAM(rep.remote_tag); - DBG("cseq = <%i>\n",rep.cseq); - - AmSipDispatcher::instance()->handleSipMsg(rep); -} - void SipCtrlInterface::handle_sip_request(trans_ticket* tt, sip_msg* msg) { assert(msg); @@ -479,7 +441,29 @@ void SipCtrlInterface::handle_sip_request(trans_ticket* tt, sip_msg* msg) } } - handleSipMsg(req); + DBG("Received new request\n"); + if (SipCtrlInterface::log_parsed_messages) { + // DBG_PARAM(req.cmd); + DBG_PARAM(req.method); + // DBG_PARAM(req.user); + // DBG_PARAM(req.domain); + // DBG_PARAM(req.dstip); + // DBG_PARAM(req.port); + DBG_PARAM(req.r_uri); + DBG_PARAM(req.from_uri); + DBG_PARAM(req.from); + DBG_PARAM(req.to); + DBG_PARAM(req.callid); + DBG_PARAM(req.from_tag); + DBG_PARAM(req.to_tag); + DBG("cseq = <%i>\n",req.cseq); + DBG_PARAM(req.route); + DBG_PARAM(req.next_hop); + DBG("hdrs = <%s>\n",req.hdrs.c_str()); + DBG("body = <%s>\n",req.body.c_str()); + } + + AmSipDispatcher::instance()->handleSipMsg(req); } void SipCtrlInterface::handle_sip_reply(sip_msg* msg) @@ -539,9 +523,17 @@ void SipCtrlInterface::handle_sip_reply(sip_msg* msg) } } - handleSipMsg(reply); + DBG("Received reply: %i %s\n",reply.code,reply.reason.c_str()); + DBG_PARAM(reply.callid); + DBG_PARAM(reply.local_tag); + DBG_PARAM(reply.remote_tag); + DBG("cseq = <%i>\n",reply.cseq); + + AmSipDispatcher::instance()->handleSipMsg(reply); } +#undef DBG_PARAM(p) + void SipCtrlInterface::prepare_routes_uac(const list& routes, string& route_field) { if(!routes.empty()){ diff --git a/core/SipCtrlInterface.h b/core/SipCtrlInterface.h index 852feaa4..8280107a 100644 --- a/core/SipCtrlInterface.h +++ b/core/SipCtrlInterface.h @@ -46,15 +46,12 @@ struct sip_header; class SipCtrlInterface: public sip_ua { - - //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); static int cancel(AmSipRequest& req); friend class udp_trsp; + public: static string outbound_host; @@ -77,13 +74,6 @@ public: static int send(AmSipRequest &req); static int send(const AmSipReply &rep); -// string getContact(const string &displayName, -// const string &userName, const string &hostName, -// const string &uriParams, const string &hdrParams); - - void handleSipMsg(AmSipRequest &req); - void handleSipMsg(AmSipReply &rep); - /** * From sip_ua */