[asterisk-dev] 13786: fxo ks dialout hookstate check

Alec Davis sivad.a at paradise.net.nz
Mon Nov 17 02:24:06 CST 2008


I can confirm that in 1.6 the check hook seems to be needed, until the bug
is found that causes it is found.

When working towards the final patch in
http://bugs.digium.com/view.php?id=13716 I had changed the code in wctdm.c
wctdm_voicedaa_check_hook() to print each time there was an error.

"Oct 16 22:17:52 astrid kernel: [3841222.734810] check hook; HOOK On, chan
2" and I was getting lots, but assumed this was normal, and experienced by
many, as at BootCamp training in February it was mentioned, and the code
quotes "/* Try to track issues that plague slot one FXO's */" even though we
have FXO modules in all 4 slots, a TDM400P.

wctdm.c wctdm_voicedaa_check_hook() added printk's to monitor errors.

        if (fxo->offhook) {
                if (b != 0x9){
                        wctdm_setreg(wc, card, 5, 0x9);
                        if (debug) {
                                printk(KERN_DEBUG "check hook: HOOK Off,
chan %d\n", card);
                        }
                }
        } else {
                if (b != 0x8) {
                        wctdm_setreg(wc, card, 5, 0x8);
                        if (debug) {
                                printk(KERN_DEBUG "check hook; HOOK On, chan
%d\n", card );
                        }
                }
        }

I didn't try disabling the check hook code, to experience the actual
problem, It might be interesting to do so.

Alec

-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com]On Behalf Of Tzafrir Cohen
Sent: Monday, 17 November 2008 08:29 p.m.
To: Asterisk Developers list
Subject: [asterisk-dev] 13786: fxo ks dialout hookstate check


Hi

It seems that as of 1.4.22 (partially) and 1.6.0 the behaviour of
chan_zap / chan_dahdi on FXO dialout has changed.

chan_zap.c had an optional test in available(), used only in the case
of an FXO port with [FXS] KS signalling that declares the Zaptel channel
available only if it is not already off-hook. This test has been
disabled by default and only enabled if the user defines
ZT_CHECK_HOOKSTATE .

See http://svn.digium.com/svn/asterisk/tags/1.4.21/channels/chan_zap.c

I'm not sure exactly why Zaptel needs to keep the state here (rather
than Asterisk). But it seems that this feature has been disabled by
default for a reason. Not for the overhead (the extra system call is
used either way). Later on when checking how this is implemented in
Zaptel, I see that the value of chan->rxhooksig is reset at the very end
of the chanconfig function to RX_HOOKSIG_INITIAL, which means that even
if a driver wants to set it before registration or at chanconfig, it
cannot do that.

In asterisk 1.4.22, this test has been enabled by default in some cases
accidentally, as pointed out in http://bugs.digium.com/view.php?id=13786 .
In 1.6.0, however, the #define is gone, and the buggy hookstate check is
enabled by default. Any idea why?

--
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list