Must send DISCONNECT if we have sent a response to a SETUP message.

Q.931 Section 5.3.2 a) says we send a RELEASE_COMPLETE to reject a call
SETUP if we have not already sent a message in response to the SETUP
message.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1489 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett 2010-02-11 21:47:24 +00:00
parent 2ec071bae6
commit 307264f7c6

20
q931.c
View File

@ -5290,6 +5290,26 @@ static int __q931_hangup(struct pri *ctrl, q931_call *c, int cause)
case PRI_CAUSE_REQUESTED_CHAN_UNAVAIL:
case PRI_CAUSE_IDENTIFIED_CHANNEL_NOTEXIST:
case PRI_CAUSE_UNALLOCATED:
/* See Q.931 Section 5.3.2 a) */
switch (c->ourcallstate) {
case Q931_CALL_STATE_NULL:
case Q931_CALL_STATE_CALL_INITIATED:
case Q931_CALL_STATE_CALL_PRESENT:
/*
* Send RELEASE_COMPLETE because some other message
* has not been sent previously.
*/
disconnect = 0;
release_compl = 1;
break;
default:
/*
* Send DISCONNECT because some other message
* has been sent previously.
*/
break;
}
break;
case PRI_CAUSE_INVALID_CALL_REFERENCE:
/* We'll send RELEASE_COMPLETE with these causes */
disconnect = 0;