<div>On Wed, Mar 6, 2013 at 2:57 PM, Optical Phoenix <span dir="ltr">&lt;<a href="mailto:opticalphoenix@gmail.com" target="_blank">opticalphoenix@gmail.com</a>&gt;</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>&gt; case DAHDI_SIG_FXSLS:<br>&gt; if (!(~cursig &amp; DAHDI_BBIT)) {      /*Dennis RINGING  */  /*&lt;----- I think<div class="im"><br>&gt; this is checking if the state is different from a set value? needs<br>&gt; clarification*/<br>

&gt;  /* Check for ringing first */<br>&gt; __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);<br>&gt; break;<br>&gt;  }</div></div><div>I added the tilde before cursig, It should now check if the signal is a &quot;1&quot; 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-&gt;sig != DAHDI_SIG_FXSLS) &amp;&amp; (~cursig &amp; 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&amp;M, and didn&#39;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">&lt;<a href="mailto:sruffell@digium.com" target="_blank">sruffell@digium.com</a>&gt;</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>
&gt; Greeting,<br>
&gt; I am trying to setup PLAR signalling in asterisk. I have modified the FXSLS<br>
&gt; 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>
&gt; .sig_type = DAHDI_SIG_FXSLS,<br>
&gt; .bits[DAHDI_TXSIG_ONHOOK]  = DAHDI_BITS_ABCD, /*changed by  for PLAR*/<br>
&gt;  .bits[DAHDI_TXSIG_OFFHOOK] = (0), /*changed by  for PLAR*/<br>
&gt; .bits[DAHDI_TXSIG_START]   = DAHDI_BITS_ABCD, /*changed by for PLAR*/<br>
&gt;<br>
&gt; When I go to change the rx, its a bit more complex. I have learned from<br>
&gt; this list that dahdi_rbsbits() handles the rx bits, but my changes seem to<br>
&gt; have no effect. Does anyone have a good understanding of this function? I<br>
&gt; would appreciate any help you can provide.<br>
&gt;<br>
&gt; case DAHDI_SIG_FXSLS:<br>
&gt; if (!(cursig &amp; DAHDI_BBIT)) {      /*Dennis RINGING  */  /*&lt;----- I think<br>
&gt; this is checking if the state is different from a set value? needs<br>
&gt; clarification*/<br>
&gt;  /* Check for ringing first */<br>
&gt; __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_RING);<br>
&gt; break;<br>
&gt;  }<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>
&gt; if ((chan-&gt;sig != DAHDI_SIG_FXSLS) &amp;&amp; (cursig &amp; DAHDI_ABIT)) {  /*&lt;------<br>
&gt; Why is it checking DAHDI_SIG_FXSLS? do I need to modify this to be 1111<br>
&gt; also?*/<br>
<br>
</div>I&#39;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>
&gt;      /* if went on hook */<br>
&gt; __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_ONHOOK);  /*&lt;----------I think this<br>
&gt; is passing it to a function that reacts to the signal in this case the<br>
&gt; onhook signal?*/<br>
&gt;  } else {<br>
&gt; __dahdi_hooksig_pvt(chan, DAHDI_RXSIG_OFFHOOK);  /* &lt;------ same here but<br>
&gt; with the off hook? */<br>
&gt;  }<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> &amp; <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  &quot;<span style="font-size:13px;color:rgb(80,0,80);font-family:arial,sans-serif;background-color:rgb(255,255,255)">if (!(cursig &amp; DAHDI_BBIT))&quot; 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>