handle invalid disconnect with no matching zchan

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@415 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris 2008-02-28 17:23:10 +00:00
parent 87a1ca9927
commit db534bd8f0
1 changed files with 7 additions and 4 deletions

View File

@ -169,10 +169,13 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen)
break;
case Q931mes_DISCONNECT:
{
Q931ie_Cause *cause = Q931GetIEPtr(gen->Cause, gen->buf);
zchan->caller_data.hangup_cause = cause->Value;
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING);
if (zchan) {
Q931ie_Cause *cause = Q931GetIEPtr(gen->Cause, gen->buf);
zchan->caller_data.hangup_cause = cause->Value;
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING);
} else {
zap_log(ZAP_LOG_CRIT, "Received Diconnect with no matching channel %d\n", chan_id);
}
}
break;
case Q931mes_ALERTING: