- fixes discrepancy between outbound_proxy format (URI) and request.next_hop, which now also accepts a URI.

In the case of a SIP URI (other types are not supported anyway), only the hostname and port are used.
- fixes a possible memory leak in SipCtrlInterface (in case set_next_hop() failed).


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1489 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Raphael Coeffic 17 years ago
parent 64d8ace63e
commit 857363dbf5

@ -306,10 +306,6 @@ void AmB2ABCalleeSession::onB2ABEvent(B2ABEvent* ev)
dlg.remote_party = co_ev->remote_party;
dlg.remote_uri = co_ev->remote_uri;
// set outbound proxy as next hop
if (!AmConfig::OutboundProxy.empty())
dlg.next_hop = AmConfig::OutboundProxy;
setCallgroup(co_ev->callgroup);
setNegotiateOnReply(true);

@ -9,7 +9,7 @@ class _AmSipMsgInDlg
{
public:
string method;
string next_hop;
string next_hop; // URI
string route;
string contact;

@ -324,18 +324,17 @@ int SipCtrlInterface::send(const AmSipRequest &req, char* serKey, unsigned int&
if(!req.next_hop.empty()){
string next_port;
const char* c = req.next_hop.c_str();
while(*c != 0){
if(*c == ':'){
next_port = string(c+1);
if(str2i(next_port,next_port_i)){
ERROR("Could not convert port number in req.next_hop");
ERROR("Using default outbound proxy");
next_hop = SipCtrlInterfaceFactory::outbound_host;
next_port_i = SipCtrlInterfaceFactory::outbound_port;
}
break;
}
sip_uri parsed_uri;
if (parse_uri(&parsed_uri, (char *)req.next_hop.c_str(),
req.next_hop.length()) < 0) {
ERROR("invalid next hop URI\n");
ERROR("Using default outbound proxy");
next_hop = SipCtrlInterfaceFactory::outbound_host;
next_port_i = SipCtrlInterfaceFactory::outbound_port;
} else {
next_hop = c2stlstr(parsed_uri.host);
if (parsed_uri.port) {
next_port_i= parsed_uri.port; }
next_hop += *(c++);
}
}
@ -350,7 +349,7 @@ int SipCtrlInterface::send(const AmSipRequest &req, char* serKey, unsigned int&
&msg->remote_ip) < 0){
// TODO: error handling
DBG("set_next_hop failed\n");
//delete msg;
delete msg;
return -1;
}

Loading…
Cancel
Save