* out of dialog REFER creates a new dialout session

* fixed bug in error reply


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@146 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 20 years ago
parent 6d8f8d9645
commit d21931f330

@ -278,9 +278,33 @@ void AmRequestHandler::dispatch(AmSipRequest& req)
if(req.method == "INVITE"){
sess_cont->startSessionUAS(req);
}
else {
sess_cont->startSessionUAS(req);
} else if(req.method == "REFER"){
// Out-of-dialog REFER
AmSipRequest n_req;
n_req.method = "INVITE";
n_req.dstip = AmConfig::LocalIP;
n_req.from = req.to;
n_req.from_uri = req.r_uri;
n_req.from_tag = AmSession::getNewId();
n_req.user = req.user;
n_req.r_uri = uri_from_name_addr(getHeader(req.hdrs, "Refer-To"));
n_req.to = getHeader(req.hdrs, "Refer-To");
n_req.to_tag = "";
n_req.cmd = req.cmd; // application from REFER
n_req.callid = AmSession::getNewId() + "@" + AmConfig::LocalIP;
if (AmSessionContainer::instance()->startSessionUAC(n_req)
!= NULL)
AmSipDialog::reply_error(req,202,"Accepted");
else
AmSipDialog::reply_error(req,500,"Not supported here");
} else {
if(!local_tag.empty() || req.method == "CANCEL"){
AmSipDialog::reply_error(req,481,"Call leg/Transaction does not exist");

@ -302,8 +302,6 @@ int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code,
AmSession::getNewId() + "\n";
if(!hdrs.empty())
msg += hdrs;
else
msg += "\n";
msg += ".\n.\n\n";

Loading…
Cancel
Save