From 45efb97ebdc76c073be58ab0695a8c8f0425e53c Mon Sep 17 00:00:00 2001 From: Martin Pycko Date: Tue, 5 Aug 2003 20:37:32 +0000 Subject: [PATCH] Update q931_hangup routine git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@51 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q931.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/q931.c b/q931.c index 24504ed..7fb8461 100755 --- a/q931.c +++ b/q931.c @@ -1743,12 +1743,15 @@ int q931_hangup(struct pri *pri, q931_call *c, int cause) if (!pri || !c) return -1; if (cause == 34 || cause == 44 || cause == 82 || cause == 1) { + /* We'll send RELEASE_COMPLETE with these causes */ disconnect = 0; release_compl = 1; } - if (cause == 6) { + if (cause == 6 || cause == 7 || cause == 26) { + /* We'll send RELEASE with these causes */ disconnect = 0; } + /* All other causes we send with DISCONNECT */ switch(c->ourcallstate) { case Q931_CALL_STATE_NULL: if (c->peercallstate == Q931_CALL_STATE_NULL) @@ -1778,7 +1781,7 @@ int q931_hangup(struct pri *pri, q931_call *c, int cause) case Q931_CALL_STATE_OVERLAP_RECEIVING: /* received SETUP_ACKNOWLEDGE */ /* send DISCONNECT in general */ - if (disconnect && (c->peercallstate == Q931_CALL_STATE_DISCONNECT_REQUEST || c->peercallstate <= 11)) + if (disconnect && c->peercallstate != Q931_CALL_STATE_NULL && c->peercallstate != Q931_CALL_STATE_DISCONNECT_REQUEST && c->peercallstate != Q931_CALL_STATE_DISCONNECT_INDICATION && c->peercallstate != Q931_CALL_STATE_RELEASE_REQUEST && c->peercallstate != Q931_CALL_STATE_RESTART_REQUEST && c->peercallstate != Q931_CALL_STATE_RESTART) q931_disconnect(pri,c,cause); else if (release_compl && c->peercallstate == Q931_CALL_STATE_CALL_INITIATED) q931_release_complete(pri,c,cause);