[svn-commits] rmudgett: branch group/CCSS r251586 - in /team/group/CCSS: ./ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Mar 10 11:02:09 CST 2010


Author: rmudgett
Date: Wed Mar 10 11:02:05 2010
New Revision: 251586

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=251586
Log:
Merged revisions 251585 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r251585 | rmudgett | 2010-03-10 10:55:34 -0600 (Wed, 10 Mar 2010) | 4 lines
  
  Simplified dahdi_request() channel selection failed reason/cause code.
  
  Also avoid potential crash because cause could be NULL.
........

Modified:
    team/group/CCSS/   (props changed)
    team/group/CCSS/channels/chan_dahdi.c
    team/group/CCSS/channels/sig_analog.c
    team/group/CCSS/channels/sig_analog.h
    team/group/CCSS/channels/sig_pri.c
    team/group/CCSS/channels/sig_pri.h

Propchange: team/group/CCSS/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 10 11:02:05 2010
@@ -1,1 +1,1 @@
-/trunk:1-251539
+/trunk:1-251585

Modified: team/group/CCSS/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_dahdi.c?view=diff&rev=251586&r1=251585&r2=251586
==============================================================================
--- team/group/CCSS/channels/chan_dahdi.c (original)
+++ team/group/CCSS/channels/chan_dahdi.c Wed Mar 10 11:02:05 2010
@@ -12168,18 +12168,18 @@
 	return 1;
 }
 
-static int available(struct dahdi_pvt *p, int *reason)
+static int available(struct dahdi_pvt *p)
 {
 	if (p->inalarm)
 		return 0;
 
 	if (analog_lib_handles(p->sig, p->radio, p->oprmode))
-		return analog_available(p->sig_pvt, reason);
+		return analog_available(p->sig_pvt);
 
 #ifdef HAVE_PRI
 	switch (p->sig) {
 	case SIG_PRI_LIB_HANDLE_CASES:
-		return sig_pri_available(p->sig_pvt, reason);
+		return sig_pri_available(p->sig_pvt);
 	default:
 		break;
 	}
@@ -12513,7 +12513,6 @@
 static struct ast_channel *dahdi_request(const char *type, format_t format, const struct ast_channel *requestor, void *data, int *cause)
 {
 	int callwait = 0;
-	int unavailreason = 0;
 	struct dahdi_pvt *p;
 	struct ast_channel *tmp = NULL;
 	struct dahdi_pvt *exitpvt;
@@ -12536,7 +12535,7 @@
 			round_robin[start.rr_starting_point] = p;
 
 		if (is_group_or_channel_match(p, start.span, start.groupmatch, &groupmatched, start.channelmatch, &channelmatched)
-			&& available(p, &unavailreason)) {
+			&& available(p)) {
 			ast_debug(1, "Using channel %d\n", p->channel);
 
 			callwait = (p->owner != NULL);
@@ -12618,14 +12617,16 @@
 	}
 	ast_mutex_unlock(&iflock);
 	restart_monitor();
-	if (callwait)
-		*cause = AST_CAUSE_BUSY;
-	else if (!tmp) {
-		if (channelmatched) {
-			if (unavailreason)
-				*cause = AST_CAUSE_BUSY;
+	if (cause && !tmp) {
+		if (callwait || channelmatched) {
+			*cause = AST_CAUSE_BUSY;
 		} else if (groupmatched) {
-			*cause = (unavailreason) ? unavailreason : AST_CAUSE_CONGESTION;
+			*cause = AST_CAUSE_CONGESTION;
+		} else {
+			/*
+			 * We did not match any channel requested.
+			 * Dialplan error requesting non-existant channel?
+			 */
 		}
 	}
 

Modified: team/group/CCSS/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/sig_analog.c?view=diff&rev=251586&r1=251585&r2=251586
==============================================================================
--- team/group/CCSS/channels/sig_analog.c (original)
+++ team/group/CCSS/channels/sig_analog.c Wed Mar 10 11:02:05 2010
@@ -657,17 +657,11 @@
 	return analog_new_ast_channel(p, AST_STATE_RESERVED, 0, p->owner ? ANALOG_SUB_CALLWAIT : ANALOG_SUB_REAL, requestor);
 }
 
-int analog_available(struct analog_pvt *p, int *busy)
+int analog_available(struct analog_pvt *p)
 {
 	int offhook;
 
 	ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
-	/* We're at least busy at this point */
-	if (busy) {
-		if ((p->sig == ANALOG_SIG_FXOKS) || (p->sig == ANALOG_SIG_FXOLS) || (p->sig == ANALOG_SIG_FXOGS)) {
-			*busy = 1;
-		}
-	}
 	/* If do not disturb, definitely not */
 	if (p->dnd) {
 		return 0;

Modified: team/group/CCSS/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/sig_analog.h?view=diff&rev=251586&r1=251585&r2=251586
==============================================================================
--- team/group/CCSS/channels/sig_analog.h (original)
+++ team/group/CCSS/channels/sig_analog.h Wed Mar 10 11:02:05 2010
@@ -338,7 +338,7 @@
 
 struct ast_channel * analog_request(struct analog_pvt *p, int *callwait, const struct ast_channel *requestor);
 
-int analog_available(struct analog_pvt *p, int *busy);
+int analog_available(struct analog_pvt *p);
 
 void *analog_handle_init_event(struct analog_pvt *i, int event);
 

Modified: team/group/CCSS/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/sig_pri.c?view=diff&rev=251586&r1=251585&r2=251586
==============================================================================
--- team/group/CCSS/channels/sig_pri.c (original)
+++ team/group/CCSS/channels/sig_pri.c Wed Mar 10 11:02:05 2010
@@ -4729,22 +4729,17 @@
 	return res;
 }
 
-int sig_pri_available(struct sig_pri_chan *p, int *reason)
+int sig_pri_available(struct sig_pri_chan *p)
 {
 	/* If no owner and interface has a B channel then likely available */
 	if (!p->owner && !p->no_b_channel && p->pri) {
+		if (p->resetting || p->call
 #if defined(HAVE_PRI_SERVICE_MESSAGES)
-		if (p->resetting || p->call || p->service_status) {
-			if (p->service_status) {
-				*reason = AST_CAUSE_REQUESTED_CHAN_UNAVAIL;
-			}
+			|| p->service_status
+#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
+			) {
 			return 0;
 		}
-#else
-		if (p->resetting || p->call) {
-			return 0;
-		}
-#endif	/* defined(HAVE_PRI_SERVICE_MESSAGES) */
 		return 1;
 	}
 

Modified: team/group/CCSS/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/sig_pri.h?view=diff&rev=251586&r1=251585&r2=251586
==============================================================================
--- team/group/CCSS/channels/sig_pri.h (original)
+++ team/group/CCSS/channels/sig_pri.h Wed Mar 10 11:02:05 2010
@@ -342,7 +342,7 @@
 
 int sig_pri_answer(struct sig_pri_chan *p, struct ast_channel *ast);
 
-int sig_pri_available(struct sig_pri_chan *p, int *reason);
+int sig_pri_available(struct sig_pri_chan *p);
 
 void sig_pri_init_pri(struct sig_pri_pri *pri);
 




More information about the svn-commits mailing list