From e6ed75019861d02f0a5e2023c19f95dcd94172cf Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Tue, 15 Apr 2008 14:43:39 +0000 Subject: [PATCH] - fixes route-set passed to the core. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@889 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/plug-in/sipctrl/SipCtrlInterface.cpp | 22 +++++++++++++++++++--- core/plug-in/sipctrl/SipCtrlInterface.h | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/plug-in/sipctrl/SipCtrlInterface.cpp b/core/plug-in/sipctrl/SipCtrlInterface.cpp index fa30f8f7..409424ad 100644 --- a/core/plug-in/sipctrl/SipCtrlInterface.cpp +++ b/core/plug-in/sipctrl/SipCtrlInterface.cpp @@ -466,7 +466,7 @@ void SipCtrlInterface::handle_sip_request(const char* tid, sip_msg* msg) req.body = c2stlstr(msg->body); req.serKey = tid; - prepare_routes(msg->record_route, req.route); + prepare_routes_uas(msg->record_route, req.route); for (list::iterator it = msg->hdrs.begin(); it != msg->hdrs.end(); ++it) { @@ -531,7 +531,7 @@ void SipCtrlInterface::handle_sip_reply(sip_msg* msg) // // reply.next_hop; - prepare_routes(msg->record_route, reply.route); + prepare_routes_uac(msg->record_route, reply.route); for (list::iterator it = msg->hdrs.begin(); it != msg->hdrs.end(); ++it) { @@ -544,7 +544,7 @@ void SipCtrlInterface::handle_sip_reply(sip_msg* msg) handleSipMsg(reply); } -void SipCtrlInterface::prepare_routes(const list& routes, string& route_field) +void SipCtrlInterface::prepare_routes_uac(const list& routes, string& route_field) { if(!routes.empty()){ @@ -560,6 +560,22 @@ void SipCtrlInterface::prepare_routes(const list& routes, string& r } } +void SipCtrlInterface::prepare_routes_uas(const list& routes, string& route_field) +{ + if(!routes.empty()){ + + list::const_iterator it = routes.begin(); + + route_field = c2stlstr((*it)->value); + ++it; + + for(; it != routes.end(); ++it) { + + route_field += ", " + c2stlstr((*it)->value); + } + } +} + /** EMACS ** * Local variables: * mode: c++ diff --git a/core/plug-in/sipctrl/SipCtrlInterface.h b/core/plug-in/sipctrl/SipCtrlInterface.h index 1ec74d3c..bd29298d 100644 --- a/core/plug-in/sipctrl/SipCtrlInterface.h +++ b/core/plug-in/sipctrl/SipCtrlInterface.h @@ -64,7 +64,8 @@ class SipCtrlInterface: trans_layer* tl; - void prepare_routes(const list& routes, string& route_field); + 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: