Release call by sending DISCONNECT even if not responded yet.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1589 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2008-01-07 11:35:09 +00:00
parent d78d24fea7
commit 74a0ec15df
1 changed files with 28 additions and 9 deletions

View File

@ -620,9 +620,18 @@ bool ISDNQ931State::checkStateSend(int type)
break; break;
return true; return true;
case ISDNQ931Message::Disconnect: case ISDNQ931Message::Disconnect:
if (state() != Active) switch (state()) {
break; case OutgoingProceeding:
return true; case CallDelivered:
case CallPresent:
case CallReceived:
case ConnectReq:
case IncomingProceeding:
case Active:
return true;
default: ;
}
break;
case ISDNQ931Message::Progress: case ISDNQ931Message::Progress:
if (state() != CallPresent && state() != CallReceived && if (state() != CallPresent && state() != CallReceived &&
state() != IncomingProceeding) state() != IncomingProceeding)
@ -724,15 +733,25 @@ bool ISDNQ931Call::sendEvent(SignallingEvent* event)
break; break;
case SignallingEvent::Release: case SignallingEvent::Release:
switch (state()) { switch (state()) {
case DisconnectReq: case DisconnectIndication: case DisconnectIndication:
case Null: case ReleaseReq: case CallAbort: retVal = sendRelease(0,event->message());
break;
case OutgoingProceeding:
case CallDelivered:
case CallPresent:
case CallReceived:
case ConnectReq:
case IncomingProceeding:
case Active:
retVal = sendDisconnect(event->message());
break;
case Null:
case ReleaseReq:
case CallAbort:
// Schedule destroy // Schedule destroy
m_terminate = m_destroy = true; m_terminate = m_destroy = true;
delete event; delete event;
return false; return false;
case Active:
retVal = sendDisconnect(event->message());
break;
default: default:
m_terminate = m_destroy = true; m_terminate = m_destroy = true;
retVal = sendReleaseComplete(event->message() ? retVal = sendReleaseComplete(event->message() ?
@ -938,7 +957,7 @@ bool ISDNQ931Call::checkMsgRecv(ISDNQ931Message* msg, bool status)
"Call(%u,%u). Dropping '%s' retransmission in state '%s' [%p]", "Call(%u,%u). Dropping '%s' retransmission in state '%s' [%p]",
Q931_CALL_ID,msg->name(),stateName(state()),this); Q931_CALL_ID,msg->name(),stateName(state()),this);
else { else {
DDebug(q931(),DebugNote, Debug(q931(),DebugNote,
"Call(%u,%u). Received '%s'. Invalid in state '%s'. Drop [%p]", "Call(%u,%u). Received '%s'. Invalid in state '%s'. Drop [%p]",
Q931_CALL_ID,msg->name(),stateName(state()),this); Q931_CALL_ID,msg->name(),stateName(state()),this);
if (status && state() != Null) if (status && state() != Null)