I have made some progress in debugging. What I found is that I like to use short hang time of 5 because the transmitters that we use have built in time out timers and so it is necessary for the repeater transmitter to drop between users. If I have a 2 second hang time then the transmitter never goes off the air and the repeater transmitter built in time out timer is always expiring.
If I set hang time to 21 then the tail messages work fine, but each number less than 21 and the tail message gets increasingly flaky. With a hangtime of 5 then the tail message totally ignores that the repeater is in use and sends the initial message right on top of the first user and then seems to be always quashed after that.
the code where this happens is
i = myrpt->tailtimer;
if (myrpt->tailtimer) myrpt->tailtimer -= elap;
if (myrpt->tailtimer < 0) myrpt->tailtimer = 0;
if((i) && (myrpt->tailtimer == 0)){
myrpt->tailevent = 1;
ast_log(LOG_NOTICE,"Tail Event SET tailtimer before decrement= %d elap= %d\n", i, elap); //CAH I added this debugging line
}
if ((!myrpt->p.s[myrpt->p.sysstate_cur].totdisable) && myrpt->totimer) myrpt->totimer -= elap;
if (myrpt->totimer < 0) myrpt->totimer = 0;
if (myrpt->idtimer) myrpt->idtimer -= elap;
if (myrpt->idtimer < 0) myrpt->idtimer = 0;
if (myrpt->tmsgtimer) myrpt->tmsgtimer -= elap;
if (myrpt->tmsgtimer < 0) myrpt->tmsgtimer = 0;
if (myrpt->voxtotimer) myrpt->voxtotimer -= elap;
if (myrpt->voxtotimer < 0) myrpt->voxtotimer = 0;
Previously in code "tailtimer" is set to hangtime. In my case that is 5 for a half second hang time.
"elap" varies from 7 to 20 for each pass here.
So for every pass the "tailtimer == 0" evaluates true and sets "tailevent" true and that causes the "tailmessage" to be sent immediately on key down elsewhere in code.
If "hangtime" is 21 or more than the "tailtimer == 0" only evaluates true if the input signal is gone and the hang time has expired.
But with a value of 21, my transmitter is almost always timed out.
I am still trying to learn what causes "elap" to vary and what sets it. I think I will find it and fix it eventually, unless someone else beats me to it. :)
oksy I found that elap is set to MSWAIT which is set to 20 in the following line.
and this code
ms = MSWAIT;
who = ast_waitfor_n(cs,n,&ms);
if (who == NULL) ms = 0;
elap = MSWAIT - ms;
maybe I can just change the define for MSWAIT and that might fix it, but 20ms is important in relation to the voter so maybe changing it will break everything.
Hmmmmmmmmm.
Jim, HELP!!!
Chuck, ccie2285(retired), WB9UUS