[asterisk-commits] tzafrir: trunk r278501 - in /trunk/channels: chan_dahdi.c sig_analog.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 21 12:44:31 CDT 2010


Author: tzafrir
Date: Wed Jul 21 12:44:20 2010
New Revision: 278501

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278501
Log:
Fix invalid test for rxisoffhook in FXO channels

This fixes some cases of no outgoing calls on FXO before an incoming call.

Remove an unnecessary testing of an "off-hook" bit from DAHDI for FXO
(KS/GS) channels.In some cases the bit would not be initialized properly
before the first inbound call and thus prevent an outgoing call.

If those tests are actually required by anybody, they should define
DAHDI_CHECK_HOOKSTATE in channels/sig_analog.c .

(closes issue #14577)
Reported by: jkroon
Patches:
      asterisk_chan_dahdi_hookstate_fix_trunk_new.diff uploaded by frawd (license 610)
Tested by: frawd

Review: https://reviewboard.asterisk.org/r/699/

Modified:
    trunk/channels/chan_dahdi.c
    trunk/channels/sig_analog.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=278501&r1=278500&r2=278501
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Wed Jul 21 12:44:20 2010
@@ -285,13 +285,6 @@
  * even though their web site says they support their products for life.
  */
 /* #define ZHONE_HACK */
-
-/*! \note
- * Define if you want to check the hook state for an FXO (FXS signalled) interface
- * before dialing on it.  Certain FXO interfaces always think they're out of
- * service with this method however.
- */
-/* #define DAHDI_CHECK_HOOKSTATE */
 
 /*! \brief Typically, how many rings before we should send Caller*ID */
 #define DEFAULT_CIDRINGS 1

Modified: trunk/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_analog.c?view=diff&rev=278501&r1=278500&r2=278501
==============================================================================
--- trunk/channels/sig_analog.c (original)
+++ trunk/channels/sig_analog.c Wed Jul 21 12:44:20 2010
@@ -41,6 +41,13 @@
 #include "asterisk/causes.h"
 
 #include "sig_analog.h"
+
+/*! \note
+ * Define if you want to check the hook state for an FXO (FXS signalled) interface
+ * before dialing on it.  Certain FXO interfaces always think they're out of
+ * service with this method however.
+ */
+/* #define DAHDI_CHECK_HOOKSTATE */
 
 #define POLARITY_IDLE 0
 #define POLARITY_REV    1
@@ -684,23 +691,19 @@
 
 	/* If no owner definitely available */
 	if (!p->owner) {
-		if (p->sig == ANALOG_SIG_FXSLS) {
-			return 1;
-		}
-
 		offhook = analog_is_off_hook(p);
 
-		if ((p->sig == ANALOG_SIG_FXSKS) || (p->sig == ANALOG_SIG_FXSGS)) {
-			/* When "onhook" that means no battery on the line, and thus
-			  it is out of service..., if it's on a TDM card... If it's a channel
-			  bank, there is no telling... */
+		/* TDM FXO card, "onhook" means out of service (no battery on the line) */
+		if ((p->sig == ANALOG_SIG_FXSLS) || (p->sig == ANALOG_SIG_FXSKS) || (p->sig == ANALOG_SIG_FXSGS)) {
+#ifdef DAHDI_CHECK_HOOKSTATE
 			if (offhook) {
 				return 1;
 			}
 			return 0;
+#endif
+		/* TDM FXS card, "offhook" means someone took the hook off so it's unavailable! */
 		} else if (offhook) {
 			ast_debug(1, "Channel %d off hook, can't use\n", p->channel);
-			/* Not available when the other end is off hook */
 			return 0;
 		}
 		return 1;




More information about the asterisk-commits mailing list