Generic handlers can alter the answer, not only the return code.

The CANCEL for a "pickup" reason will carry a Reason cause 200 to signal
the call as not being missed.


git-svn-id: http://voip.null.ro/svn/yate@1372 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-06-27 11:02:46 +00:00
parent b2120262a3
commit 8aa1ead124
1 changed files with 10 additions and 1 deletions

View File

@ -1607,7 +1607,10 @@ bool YateSIPEndPoint::generic(SIPEvent* e, SIPTransaction* t)
code = 0;
}
if ((code >= 200) && (code < 700)) {
t->setResponse(code);
SIPMessage* resp = new SIPMessage(message,code);
copySipHeaders(*resp,m,"osip_");
t->setResponse(resp);
resp->deref();
return true;
}
return false;
@ -2024,6 +2027,12 @@ void YateSIPConnection::hangup()
String tmp;
tmp << i->getCSeq() << " CANCEL";
m->addHeader("CSeq",tmp);
if (m_reason == "pickup") {
SIPHeaderLine* hl = new SIPHeaderLine("Reason","SIP");
hl->setParam("cause","200");
hl->setParam("text","\"Call completed elsewhere\"");
m->addHeader(hl);
}
plugin.ep()->engine()->addMessage(m);
}
m->deref();