aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-21 17:44:20 +0000
committertzafrir <tzafrir@f38db490-d61c-443f-a65b-d21fe96a405b>2010-07-21 17:44:20 +0000
commit45ef2c791eef54779cb211ea5fb6d16bb21c6bc7 (patch)
tree0bdb5712303e36c6ea55c53224689db2cd204a49 /channels
parent4c8dd06b79f18570068c47adf87303372086b294 (diff)
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/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278501 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c7
-rw-r--r--channels/sig_analog.c21
2 files changed, 12 insertions, 16 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index eae6ceb96..3112bfaaa 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -286,13 +286,6 @@ static struct ast_jb_conf global_jbconf;
*/
/* #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
diff --git a/channels/sig_analog.c b/channels/sig_analog.c
index 1e84e27b5..68677f561 100644
--- a/channels/sig_analog.c
+++ b/channels/sig_analog.c
@@ -42,6 +42,13 @@
#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
#define MIN_MS_SINCE_FLASH ( (2000) ) /*!< 2000 ms */
@@ -684,23 +691,19 @@ int analog_available(struct analog_pvt *p)
/* 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;