[asterisk-commits] dhubbard: branch dhubbard/pinecowbell r167124 - /team/dhubbard/pinecowbell/ch...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 2 21:56:30 CST 2009


Author: dhubbard
Date: Fri Jan  2 21:56:29 2009
New Revision: 167124

URL: http://svn.digium.com/view/asterisk?view=rev&rev=167124
Log:
set the correct cause code for an out-of-service channel

Modified:
    team/dhubbard/pinecowbell/channels/chan_dahdi.c

Modified: team/dhubbard/pinecowbell/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/dhubbard/pinecowbell/channels/chan_dahdi.c?view=diff&rev=167124&r1=167123&r2=167124
==============================================================================
--- team/dhubbard/pinecowbell/channels/chan_dahdi.c (original)
+++ team/dhubbard/pinecowbell/channels/chan_dahdi.c Fri Jan  2 21:56:29 2009
@@ -9294,7 +9294,7 @@
 	int channelmatch = -1;
 	int roundrobin = 0;
 	int callwait = 0;
-	int busy = 0;
+	int unavailreason = 0;
 	struct dahdi_pvt *p;
 	struct ast_channel *tmp = NULL;
 	char *dest=NULL;
@@ -9404,7 +9404,7 @@
 		ast_verbose("name = %s, %d, %d, %d\n",p->owner ? p->owner->name : "<none>", p->channel, channelmatch, groupmatch);
 #endif
 
-		if (p && available(p, channelmatch, groupmatch, &busy, &channelmatched, &groupmatched)) {
+		if (p && available(p, channelmatch, groupmatch, &unavailreason, &channelmatched, &groupmatched)) {
 			ast_debug(1, "Using channel %d\n", p->channel);
 			if (p->inalarm) 
 				goto next;
@@ -9499,10 +9499,10 @@
 		*cause = AST_CAUSE_BUSY;
 	else if (!tmp) {
 		if (channelmatched) {
-			if (busy)
+			if (unavailreason)
 				*cause = AST_CAUSE_BUSY;
 		} else if (groupmatched) {
-			*cause = AST_CAUSE_CONGESTION;
+			*cause = (unavailreason) ? unavailreason : AST_CAUSE_CONGESTION;
 		}
 	}
 		




More information about the asterisk-commits mailing list