[asterisk-dev] Change RX Signalling Bits in Dahdi drivers

Shaun Ruffell sruffell at digium.com
Wed Mar 6 12:21:20 CST 2013


Hi Dennis,

On Wed, Mar 06, 2013 at 11:42:54AM -0500, Optical Phoenix wrote:
> Greeting,
> I am trying to setup PLAR signalling in asterisk. I have modified the FXSLS
> TX bits in dahdi-base.c on line 2580, and I can make calls.

After you get things woring, what about adding a new signalling type
instead of modifying loopstart?

> .sig_type = DAHDI_SIG_FXSLS,
> .bits[DAHDI_TXSIG_ONHOOK]  = DAHDI_BITS_ABCD, /*changed by  for PLAR*/
>  .bits[DAHDI_TXSIG_OFFHOOK] = (0), /*changed by  for PLAR*/
> .bits[DAHDI_TXSIG_START]   = DAHDI_BITS_ABCD, /*changed by for PLAR*/
> 
> When I go to change the rx, its a bit more complex. I have learned from
> this list that dahdi_rbsbits() handles the rx bits, but my changes seem to
> have no effect. Does anyone have a good understanding of this function? I
> would appreciate any help you can provide.
>
> case DAHDI_SIG_FXSLS:
> if (!(cursig & DAHDI_BBIT)) {      /*Dennis RINGING  */  /*<----- I think
> this is checking if the state is different from a set value? needs
> clarification*/
>  /* Check for ringing first */
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);
> break;
>  }

This is just checking if new BBIT is 0, which would indicate a ring.
At the top of dahdi_rbsbits there was already a check to see if
cursig is different from the previously saved rxsig.

> if ((chan->sig != DAHDI_SIG_FXSLS) && (cursig & DAHDI_ABIT)) {  /*<------
> Why is it checking DAHDI_SIG_FXSLS? do I need to modify this to be 1111
> also?*/

I'm not sure about this question. When using Loop start signalling,
the central office cannot indicate that the call was terminated to
the remote station.  Hence, that is why the only events sent to
__dahdi_hooksig_pvt are DAHDI_RXSIG_RING and DAHDI_RXSIG_OFFHOOK
when configured with FSX Loop Start signalling. So basically, that
check is to ensure that the ABIT is only looked at in FXSKS and
FXSGS signalling (which shares this code block with the FXSLS
signalling).

>      /* if went on hook */
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_ONHOOK);  /*<----------I think this
> is passing it to a function that reacts to the signal in this case the
> onhook signal?*/
>  } else {
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_OFFHOOK);  /* <------ same here but
> with the off hook? */
>  }

Essentially, yes. dahdi_hooksig_pvt processes real state
transitions on the line and converts them into events for Asterisk.
For example, dahdi_rbsbits knows when a line goes offhook / onhook,
but that could result in a WINK, FLASH, OFFHOOK, ONHOOK event to
asterisk depending on the current state and timing of the actual
line transitions.

Hope this helps.

-- 
Shaun Ruffell
Digium, Inc. | Linux Kernel Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list