- fixes route-set passed to the core.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@889 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Raphael Coeffic 18 years ago
parent 400d6c6e24
commit e6ed750198

@ -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<sip_header*>::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<sip_header*>::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<sip_header*>& routes, string& route_field)
void SipCtrlInterface::prepare_routes_uac(const list<sip_header*>& routes, string& route_field)
{
if(!routes.empty()){
@ -560,6 +560,22 @@ void SipCtrlInterface::prepare_routes(const list<sip_header*>& routes, string& r
}
}
void SipCtrlInterface::prepare_routes_uas(const list<sip_header*>& routes, string& route_field)
{
if(!routes.empty()){
list<sip_header*>::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++

@ -64,7 +64,8 @@ class SipCtrlInterface:
trans_layer* tl;
void prepare_routes(const list<sip_header*>& routes, string& route_field);
void prepare_routes_uac(const list<sip_header*>& routes, string& route_field);
void prepare_routes_uas(const list<sip_header*>& routes, string& route_field);
int cancel(const AmSipRequest& req);
protected:

Loading…
Cancel
Save