[svn-commits] dhubbard: branch group/issue3450 r132276 - /team/group/issue3450/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jul 18 21:04:25 CDT 2008


Author: dhubbard
Date: Fri Jul 18 21:04:25 2008
New Revision: 132276

URL: http://svn.digium.com/view/asterisk?view=rev&rev=132276
Log:
ATT TR 41459, section 3.13.5 Maintenance Procedures states that a disabled b-channel must return cause 44, requested channel not available

Modified:
    team/group/issue3450/channels/chan_dahdi.c

Modified: team/group/issue3450/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/group/issue3450/channels/chan_dahdi.c?view=diff&rev=132276&r1=132275&r2=132276
==============================================================================
--- team/group/issue3450/channels/chan_dahdi.c (original)
+++ team/group/issue3450/channels/chan_dahdi.c Fri Jul 18 21:04:25 2008
@@ -586,7 +586,7 @@
 	unsigned int progress:1;
 	unsigned int resetting:1;
 	unsigned int setup_ack:1;
-	unsigned int changestatus;	/* for NFAS MAINTenance service message handling */
+	unsigned int changestatus;
 #endif
 	unsigned int use_smdi:1;		/* Whether to use SMDI on this channel */
 	struct ast_smdi_interface *smdi_iface;	/* The serial port to listen for SMDI data on */
@@ -8778,7 +8778,7 @@
 	return tmp;
 }
 
-static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched)
+static inline int available(struct dahdi_pvt *p, int channelmatch, ast_group_t groupmatch, int *reason, int *channelmatched, int *groupmatched)
 {
 	int res;
 	DAHDI_PARAMS par;
@@ -8796,9 +8796,9 @@
 		*channelmatched = 1;
 	}
 	/* We're at least busy at this point */
-	if (busy) {
+	if (reason) {
 		if ((p->sig == SIG_FXOKS) || (p->sig == SIG_FXOLS) || (p->sig == SIG_FXOGS))
-			*busy = 1;
+			*reason = AST_CAUSE_BUSY;
 	}
 	/* If do not disturb, definitely not */
 	if (p->dnd)
@@ -8810,18 +8810,16 @@
 	if (p->locallyblocked || p->remotelyblocked)
 		return 0;
 
-	/* If channel is not in service, definitely not */
-	if (p->changestatus > 0)
-		return 0;
-
 	/* If no owner definitely available */
 	if (!p->owner) {
 #ifdef HAVE_PRI
 		/* Trust PRI */
 		if (p->pri) {
-			if (p->resetting || p->call)
+			if ((p->resetting || p->call) || (p->changestatus > 0)) {
+				if (p->changestatus) 
+					*reason = AST_CAUSE_REQUESTED_CHAN_UNAVAIL;
 				return 0;
-			else
+			} else
 				return 1;
 		}
 #endif
@@ -8969,7 +8967,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;
@@ -9079,7 +9077,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;
@@ -9174,10 +9172,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 svn-commits mailing list