Make sure we disconnect a SIP call on all branches of hangup.

Fixes BYE without CANCEL not being propagated.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4994 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2012-04-04 17:36:34 +00:00
parent 82513bee25
commit b682d50334
1 changed files with 4 additions and 2 deletions

View File

@ -5097,13 +5097,17 @@ void YateSIPConnection::hangup()
if (m_reason) if (m_reason)
m->setParam("reason",m_reason); m->setParam("reason",m_reason);
Engine::enqueue(m); Engine::enqueue(m);
if (!error)
error = m_reason.c_str();
switch (m_state) { switch (m_state) {
case Cleared: case Cleared:
clearTransaction(); clearTransaction();
disconnect(error,parameters());
return; return;
case Incoming: case Incoming:
if (m_tr) { if (m_tr) {
clearTransaction(); clearTransaction();
disconnect(error,parameters());
return; return;
} }
break; break;
@ -5163,8 +5167,6 @@ void YateSIPConnection::hangup()
} }
} }
m_byebye = false; m_byebye = false;
if (!error)
error = m_reason.c_str();
disconnect(error,parameters()); disconnect(error,parameters());
} }