[Asterisk-cvs] asterisk/channels chan_zap.c,1.541,1.542

kpfleming kpfleming
Tue Nov 8 20:51:39 CST 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv25940/channels

Modified Files:
	chan_zap.c 
Log Message:
correct logic for group-match CONGESTION checking


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.541
retrieving revision 1.542
diff -u -d -r1.541 -r1.542
--- chan_zap.c	9 Nov 2005 00:48:38 -0000	1.541
+++ chan_zap.c	9 Nov 2005 01:42:38 -0000	1.542
@@ -7240,6 +7240,7 @@
 {
 	int res;
 	ZT_PARAMS par;
+
 	/* First, check group matching */
 	if (groupmatch) {
 		if ((p->group & groupmatch) != groupmatch)
@@ -7247,7 +7248,7 @@
 		*groupmatched = 1;
 	}
 	/* Check to see if we have a channel match */
-	if (channelmatch) {
+	if (channelmatch != -1) {
 		if (p->channel != channelmatch)
 			return 0;
 		*channelmatched = 1;
@@ -7336,7 +7337,7 @@
 	}
 	
 	if ((p->owner->_state != AST_STATE_UP) &&
-		((p->owner->_state != AST_STATE_RINGING) || p->outgoing)) {
+	    ((p->owner->_state != AST_STATE_RINGING) || p->outgoing)) {
 		/* If the current call is not up, then don't allow the call */
 		return 0;
 	}
@@ -7628,11 +7629,15 @@
 	}
 	ast_mutex_unlock(lock);
 	restart_monitor();
-	if (channelmatched) {
-		if (callwait || (!tmp && busy))
-			*cause = AST_CAUSE_BUSY;
-	} else if (groupmatched) {
-		*cause = AST_CAUSE_CONGESTION;
+	if (callwait)
+		*cause = AST_CAUSE_BUSY;
+	else if (!tmp) {
+		if (channelmatched) {
+			if (busy)
+				*cause = AST_CAUSE_BUSY;
+		} else if (groupmatched) {
+			*cause = AST_CAUSE_CONGESTION;
+		}
 	}
 		
 	return tmp;




More information about the svn-commits mailing list