<div>On Wed, Mar 6, 2013 at 2:57 PM, Optical Phoenix <span dir="ltr"><<a href="mailto:opticalphoenix@gmail.com" target="_blank">opticalphoenix@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<div>Thanks very much for your input. I would very much like to create a new signalling type,I have been intimidated by the complexity of the driver. Would it be very difficult to create a new type? </div><div><br></div>
<div>> case DAHDI_SIG_FXSLS:<br>> if (!(~cursig & DAHDI_BBIT)) { /*Dennis RINGING */ /*<----- I think<div class="im"><br>> this is checking if the state is different from a set value? needs<br>> clarification*/<br>
> /* Check for ringing first */<br>> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);<br>> break;<br>> }</div></div><div>I added the tilde before cursig, It should now check if the signal is a "1" correct?</div>
<div><br></div><div>and here, I have done a similar thing</div><div><div>}</div><div><span style="white-space:pre-wrap">                </span>if ((chan->sig != DAHDI_SIG_FXSLS) && (~cursig & DAHDI_BITS_ABCD)) { /* added tilde Should be true if cursig is 0000, I think?*/</div>
<div class="im">
<div><span style="white-space:pre-wrap">                        </span> /* if went on hook */</div><div><span style="white-space:pre-wrap">                        </span>__dahdi_hooksig_pvt(chan, DAHDI_RXSIG_ONHOOK);</div></div><div>
<span style="white-space:pre-wrap">                </span>} else {</div><div><span style="white-space:pre-wrap">                        </span>__dahdi_hooksig_pvt(chan, DAHDI_RXSIG_OFFHOOK);</div><div><span style="white-space:pre-wrap">                </span>}</div>
</div><div><br></div><div>To give a little background, my goal is to create a PLAR signalling type. Since PLAR is very simple in comparison to FXO/S and is completely symmetrical(both sides signal the same way), It took me a while to figure out that there were tx and rx sections because I was only familiar with PLAR and E&M, and didn't expect there to be different cases.</div>
<div>ON HOOK is all ones (1111)</div><div>OFF HOOK is all zeros (0000)</div><div><br></div><div>Thanks again,</div><div>Dennis</div><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">On Wed, Mar 6, 2013 at 1:21 PM, Shaun Ruffell <span dir="ltr"><<a href="mailto:sruffell@digium.com" target="_blank">sruffell@digium.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dennis,<br>
<div><br>
On Wed, Mar 06, 2013 at 11:42:54AM -0500, Optical Phoenix wrote:<br>
> Greeting,<br>
> I am trying to setup PLAR signalling in asterisk. I have modified the FXSLS<br>
> TX bits in dahdi-base.c on line 2580, and I can make calls.<br>
<br>
</div>After you get things woring, what about adding a new signalling type<br>
instead of modifying loopstart?<br>
<div><br>
> .sig_type = DAHDI_SIG_FXSLS,<br>
> .bits[DAHDI_TXSIG_ONHOOK] = DAHDI_BITS_ABCD, /*changed by for PLAR*/<br>
> .bits[DAHDI_TXSIG_OFFHOOK] = (0), /*changed by for PLAR*/<br>
> .bits[DAHDI_TXSIG_START] = DAHDI_BITS_ABCD, /*changed by for PLAR*/<br>
><br>
> When I go to change the rx, its a bit more complex. I have learned from<br>
> this list that dahdi_rbsbits() handles the rx bits, but my changes seem to<br>
> have no effect. Does anyone have a good understanding of this function? I<br>
> would appreciate any help you can provide.<br>
><br>
> case DAHDI_SIG_FXSLS:<br>
> if (!(cursig & DAHDI_BBIT)) { /*Dennis RINGING */ /*<----- I think<br>
> this is checking if the state is different from a set value? needs<br>
> clarification*/<br>
> /* Check for ringing first */<br>
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);<br>
> break;<br>
> }<br>
<br>
</div>This is just checking if new BBIT is 0, which would indicate a ring.<br>
At the top of dahdi_rbsbits there was already a check to see if<br>
cursig is different from the previously saved rxsig.<br>
<div><br>
> if ((chan->sig != DAHDI_SIG_FXSLS) && (cursig & DAHDI_ABIT)) { /*<------<br>
> Why is it checking DAHDI_SIG_FXSLS? do I need to modify this to be 1111<br>
> also?*/<br>
<br>
</div>I'm not sure about this question. When using Loop start signalling,<br>
the central office cannot indicate that the call was terminated to<br>
the remote station. Hence, that is why the only events sent to<br>
__dahdi_hooksig_pvt are DAHDI_RXSIG_RING and DAHDI_RXSIG_OFFHOOK<br>
when configured with FSX Loop Start signalling. So basically, that<br>
check is to ensure that the ABIT is only looked at in FXSKS and<br>
FXSGS signalling (which shares this code block with the FXSLS<br>
signalling).<br>
<div><br>
> /* if went on hook */<br>
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_ONHOOK); /*<----------I think this<br>
> is passing it to a function that reacts to the signal in this case the<br>
> onhook signal?*/<br>
> } else {<br>
> __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_OFFHOOK); /* <------ same here but<br>
> with the off hook? */<br>
> }<br>
<br>
</div>Essentially, yes. dahdi_hooksig_pvt processes real state<br>
transitions on the line and converts them into events for Asterisk.<br>
For example, dahdi_rbsbits knows when a line goes offhook / onhook,<br>
but that could result in a WINK, FLASH, OFFHOOK, ONHOOK event to<br>
asterisk depending on the current state and timing of the actual<br>
line transitions.<br>
<br>
Hope this helps.<br>
<br>
--<br>
Shaun Ruffell<br>
Digium, Inc. | Linux Kernel Developer<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: <a href="http://www.digium.com" target="_blank">www.digium.com</a> & <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div>Hi Again,</div><div><br></div><div>Above Shaun was kind enough to point out that "<span style="font-size:13px;color:rgb(80,0,80);font-family:arial,sans-serif;background-color:rgb(255,255,255)">if (!(cursig & DAHDI_BBIT))" was checking if the BBit is zero. (thanks again!) </span><span style="background-color:rgb(255,255,255);color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"> for what values is this statement not true? it seems that no matter what I put in, it comes out as true. </span></div>
<div><span style="background-color:rgb(255,255,255);color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="background-color:rgb(255,255,255);color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">Thanks,<br>
Dennis</span></div><div><br></div><div><br></div>