[asterisk-users] What makes TDM400 FXS Connection to TELCO go into Off Hook State?

Jim Duda jim at duda.tzo.com
Tue Nov 11 18:05:23 CST 2008


>> When it fails, I get this message:
>> [Nov  9 19:12:26] WARNING[18916] app_dial.c: Unable to create channel of type 'DAHDI' (cause 0 - Unknown)
> 
> Can you enable debug logging? Do you see any message about the casue for
> that?

Yes, I enabled logging, however, no additional logging was available.
I instrumented the code myself with additional logging.  I have provided the code snipet 
from chan_dahdi.c below.  It appears that my problem is caused by the TDM channel being
in the Onhook state.  Something makes the channel go Offhook, and things begin to work
properly.  I'm able to solve the Onhook case by changing the code to always return 1
when Onhook, indicating Offhook.

I'm hoping someone might shed some light on the "onhook" comments here.  What causes both
par.rxbits == -1 and par.rxisoffhook == 0?

chan_dahdi.c line 3786

if (res) {
	ast_log(LOG_WARNING, "Unable to check hook state on channel %d: %s\n", p->channel, strerror(errno));
} else if ((p->sig == SIG_FXSKS) || (p->sig == 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... */
	if (par.rxbits > -1)
		return 1;
	if (par.rxisoffhook)
		return 1;
	else {
	    ast_log(LOG_WARNING, "available 6c par.rxbits: %d par.rxisoffhook: %d\n", par.rxbits, par.rxisoffhook);
//            return 0;
	    return 1;
	}

Jim





More information about the asterisk-users mailing list