Deal better with SIP transaction timeouts, map 408 to "noconn" but add raw cause code to disconnect() and chan.hangup message.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2621 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-05-10 11:50:00 +00:00
parent 275bb5dfc8
commit 207ce16736
1 changed files with 11 additions and 1 deletions

View File

@ -93,6 +93,7 @@ static TokenDict dict_errors[] = {
{ "noroute", 404 },
{ "noroute", 604 },
{ "noconn", 503 },
{ "noconn", 408 },
{ "noauth", 401 },
{ "nomedia", 415 },
{ "nocall", 481 },
@ -2642,8 +2643,9 @@ void YateSIPConnection::hangup()
Debug(this,DebugAll,"YateSIPConnection::hangup() state=%d trans=%p error='%s' code=%d reason='%s' [%p]",
m_state,m_tr,error,m_reasonCode,m_reason.c_str(),this);
Message* m = message("chan.hangup");
m->copyParams(parameters());
if (m_reason)
m->addParam("reason",m_reason);
m->setParam("reason",m_reason);
Engine::enqueue(m);
switch (m_state) {
case Cleared:
@ -3392,6 +3394,14 @@ bool YateSIPConnection::process(SIPEvent* ev)
}
hangup();
}
else if (code == 408) {
// Proxy timeout does not provide an answer message
if (m_dialog.remoteTag.null())
m_byebye = false;
parameters().setParam("cause_sip","408");
setReason("Request Timeout",code);
hangup();
}
if (!ev->isActive()) {
Lock lock(driver());
if (m_tr) {