Hi.This patch should work...
I'm experiencing a strange issue with *. I have a dev kit, aka a T100P + a zhone cb.
Sometimes, on certains phones (on the fxo ports of the cb) , when the phone rings, * detect it as answered after the first ring, even if no one is at the phone!
The result is that on the other party (which called the phone) hears only silence. (since the caller is bridged with an on-hook phone, but is detected as off-hook)
The problem is that I can't reproduce it, it happens randomly. The debug logs report the same as if the channel was normally answered.
Any hint ?
Regards
Petr Michalek
diff -u -r ./zaptel/zaptel.c ./astmodules/zaptel/zaptel.c
--- ./zaptel/zaptel.c Sun Mar 2 22:03:21 2003
+++ ./astmodules/zaptel/zaptel.c Sun Mar 2 22:05:50 2003
@@ -4325,6 +4325,12 @@
void zt_rbsbits(struct zt_chan *chan, int cursig)
{
if (cursig == chan->rxsig)
+ {
+ chan->rxsigtimer=0;
+ return;
+ }
+
+ if( chan->rxsigtimer++ < ZT_RXSIGTIME && (chan->txstate == ZT_TXSTATE_RINGON
|| chan->txstate == ZT_TXSTATE_RINGOFF) )
return;
switch(chan->sig) {
@@ -4370,6 +4376,7 @@
}
/* Keep track of signalling for next time */
chan->rxsig = cursig;
+ chan->rxsigtimer=0;
}
void zt_ec_chunk(struct zt_chan *ss, unsigned char *rxchunk, const unsigned char
*txchunk)
diff -u -r ./zaptel/zaptel.h ./astmodules/zaptel/zaptel.h
--- ./zaptel/zaptel.h Sun Mar 2 22:03:24 2003
+++ ./astmodules/zaptel/zaptel.h Sun Mar 2 22:08:51 2003
@@ -756,6 +756,8 @@
#define ZT_KEWLTIME 500 /* 500ms for kewl pulse */
#define ZT_AFTERKEWLTIME 300 /* 300ms after kewl pulse */
+#define ZT_RXSIGTIME 30 /* 30??(loops) for prevent "autoanswer" */
+
#define ZT_MAX_SPANS 128 /* Max, 128 spans */
#define ZT_MAX_CHANNELS 1024 /* Max, 1024 channels */
#define ZT_MAX_CONF 1024 /* Max, 1024 conferences */
@@ -946,6 +948,7 @@
int gotgs;
int txstate;
int rxsig;
+ int rxsigtimer;
int txsig;
int rxsigstate;
