[libpri-commits] rmudgett: branch rmudgett/call_waiting r1521 - /team/rmudgett/call_waiting/

SVN commits to the libpri project libpri-commits at lists.digium.com
Mon Mar 8 17:26:49 CST 2010


Author: rmudgett
Date: Mon Mar  8 17:26:45 2010
New Revision: 1521

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1521
Log:
Adjust Q.931 call state for moved decision to send CONNECT_ACKNOWLEDGE.

Also make the channel specified in the CONNECT_ACKNOWLEDGE channel id
exclusive.

Modified:
    team/rmudgett/call_waiting/q931.c

Modified: team/rmudgett/call_waiting/q931.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/call_waiting/q931.c?view=diff&rev=1521&r1=1520&r2=1521
==============================================================================
--- team/rmudgett/call_waiting/q931.c (original)
+++ team/rmudgett/call_waiting/q931.c Mon Mar  8 17:26:45 2010
@@ -5108,10 +5108,14 @@
 {
 	int *use_ies;
 
+	UPDATE_OURCALLSTATE(ctrl, call, Q931_CALL_STATE_ACTIVE);
+	call->peercallstate = Q931_CALL_STATE_ACTIVE;
 	if (channel) {
 		call->ds1no = (channel & 0xff00) >> 8;
 		call->ds1explicit = (channel & 0x10000) >> 16;
 		call->channelno = channel & 0xff;
+		call->chanflags &= ~FLAG_PREFERRED;
+		call->chanflags |= FLAG_EXCLUSIVE;
 	}
 	use_ies = NULL;
 	if (ctrl->subchannel && !ctrl->bri) {
@@ -5636,6 +5640,13 @@
 			disconnect = 0;
 			release_compl = 1;
 			break;
+		case Q931_CALL_STATE_CONNECT_REQUEST:
+			/*
+			 * Send RELEASE because the B channel negotiation failed
+			 * for call waiting.
+			 */
+			disconnect = 0;
+			break;
 		default:
 			/*
 			 * Send DISCONNECT because some other message
@@ -7190,8 +7201,6 @@
 			q931_status(ctrl, c, PRI_CAUSE_WRONG_MESSAGE);
 			break;
 		}
-		UPDATE_OURCALLSTATE(ctrl, c, Q931_CALL_STATE_ACTIVE);
-		c->peercallstate = Q931_CALL_STATE_CONNECT_REQUEST;
 
 		ctrl->ev.e = PRI_EVENT_ANSWER;
 		ctrl->ev.answer.subcmds = &ctrl->subcmds;
@@ -7205,6 +7214,9 @@
 
 		if (!PRI_MASTER(ctrl)->manual_connect_ack) {
 			q931_connect_acknowledge(ctrl, c, 0);
+		} else {
+			UPDATE_OURCALLSTATE(ctrl, c, Q931_CALL_STATE_CONNECT_REQUEST);
+			c->peercallstate = Q931_CALL_STATE_CONNECT_REQUEST;
 		}
 
 		if (c->cis_auto_disconnect && c->cis_call) {




More information about the libpri-commits mailing list