[Asterisk-cvs] asterisk/channels chan_zap.c,1.330,1.331

markster at lists.digium.com markster at lists.digium.com
Thu Sep 2 15:04:12 CDT 2004


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

Modified Files:
	chan_zap.c 
Log Message:
Don't use FXO's with no battery (bug #2359)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.330
retrieving revision 1.331
diff -u -d -r1.330 -r1.331
--- chan_zap.c	2 Sep 2004 03:32:07 -0000	1.330
+++ chan_zap.c	2 Sep 2004 19:07:24 -0000	1.331
@@ -6289,9 +6289,6 @@
 				return 1;
 		}
 #endif
-		if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS) ||
-			(p->sig == SIG_FXSGS) || !p->sig)
-			return 1;
 		if (!p->radio)
 		{
 			/* Check hook state */
@@ -6304,6 +6301,14 @@
 			}
 			if (res) {
 				ast_log(LOG_WARNING, "Unable to check hook state on channel %d\n", p->channel);
+			} else if ((p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS) ||
+				(p->sig == SIG_FXSGS) || !p->sig) {
+				/* When "onhook" that means no battery on the line, and thus
+				  it is out of service... */
+				if (par.rxisoffhook)
+					return 1;
+				else
+					return 0;
 			} else if (par.rxisoffhook) {
 				ast_log(LOG_DEBUG, "Channel %d off hook, can't use\n", p->channel);
 				/* Not available when the other end is off hook */




More information about the svn-commits mailing list