<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1676/">https://reviewboard.asterisk.org/r/1676/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On March 8th, 2012, 4:22 p.m., <b>rmudgett</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1676/diff/2/?file=23473#file23473line221" style="color: black; font-weight: bold; text-decoration: underline;">trunk/channels/sig_ss7.h</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">struct sig_ss7_chan {</pre></td>

  </tr>
 </tbody>






 
 

 <tbody>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">211</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">char</span> <span class="n">orig_called_num</span><span class="p">[</span><span class="mi">50</span><span class="p">];</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">221</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">char</span> <span class="n">orig_called_num</span><span class="p">[</span><span class="mi">50</span><span class="p">];</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">212</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">char</span> <span class="n">redirecting_num</span><span class="p">[</span><span class="mi">50</span><span class="p">];</span></pre></td>
    <th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">222</font></th>
    <td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">char</span> <span class="n">redirecting_num</span><span class="p">[</span><span class="mi">50</span><span class="p">];</span></pre></td>
  </tr>

 </tbody>



 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">223</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_counter</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">224</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_info</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">225</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_info_ind</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">226</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_info_orig_reas</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">227</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_info_counter</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">228</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">redirect_info_reas</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This redirecting information should also be put into the ast_channel.redirecting.from structure.  The redirecting information is accessed by the REDIRECTING dialplan function.  Other channel technologies (SIP and ISDN) use the ast_channel.redirecting information instead of channel variables.

Outgoing calls should prefer the data in the ast_channel.redirecting.from structure instead of the SS7 channel technology specific channel variable.</pre>
 </blockquote>



 <p>On March 21st, 2012, 7:17 a.m., <b>KNK</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I am having some problems with this change:
1. REDIRECTING dialplan function sets ast_channel.redirecting.from and ast_channel.redirecting.to only, while for SS7 there is also the original from. Should the function be extended with orig_from ast_party_id and orig_reason or we should store only the last from and use SS7 specific variables for the orig_*
2. There are two redirect counters and info_indication, which should also go in ast_party_redirecting?
3. How the indication info should be translated from/to XXX-num-pres?

I think we should store only the from and to numbers for the other channels (if redirection information presentation is not restricted) and presentation to allowed/restricted (from indication info), use the highest redirect counter (they should be equal), but keep the specific variables.
For outgoing calls: parse redirecting data only if SS7_REDIRECT_INFO_IND is defined and also keep SS7_REDIRECT_INFO_ORIG_REAS specific variable. If SS7_REDIRECT_INFO_IND is set to allowed it may be changed to restricted based on the from/to presentation or force the provided value.</pre>
 </blockquote>





 <p>On April 4th, 2012, 8:45 a.m., <b>KNK</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Review 1829 adds orig_* to REDIRECTING(), so they should go there as i understand.

According to http://tools.ietf.org/html/draft-levy-sip-diversion-11#page-39 if i understand it properly the redirect_info_ind should be set from the orig-num-pres (presentation allowed/restricted) and probably from the to-num-pres (when set to restricted) we can set the indication to XXX_INFO_RESTRICTED.

The CALL_REROUTED_ / CALL_DIVERTED_ part comes from the reason field, so there is no need of separate field for redirecting info indication, but to keep the possibility to override it from the dialplan i will keep that variable for both in/out.

For the outgoing calls i am planning to set both redirect counters from the same value (ast_party_redirecting.count) and for the incoming to store the highest one, but issue a warning if they are different.

Is this the correct approach?</pre>
 </blockquote>





 <p>On April 4th, 2012, 1:18 p.m., <b>rmudgett</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I added the original redirecting party to REDIRECTING because ISDN Q.SIG and ETSI PTP also supply and use that information.  The ISDN code was already stubbed out to handle it.  At the time I did not feel it was worth it to add an original party ID to the REDIRECTING function just for ISDN since that information was not going to change.  Since SS7 also has that information, I have added it.  (See https://reviewboard.asterisk.org/r/1829/ )

For existing channel variables that REDIRECTING took over, what I did with ISDN is to make those channel variables status only and just use the values from REDIRECTING().  (You cannot have a source preference order if both sources are always present.)  PRIREDIRECTREASON is the principle example.

The difference between the apparent duplicate redirecting information from SS7 could be a matter of the source supplying it.  This would be similar to the difference between Caller-ID and ANI.  Caller-ID is user supplied while ANI is network supplied.  Since the additional redirecting information is SS7 specific, it makes sense to use channel variables for that information.
</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The variables in question are not existing channel variables - they are added with this patch and meant to be set from the dialplan, so there is no need to keep them at all even as status only variables.
I will go ahead and replace them all with the REDIRECTING function, with the only exception of redirect_info_ind, which if provided will override the logic in place that generates it from the REDIRECTING data.</pre>
<br />




<p>- KNK</p>


<br />
<p>On March 21st, 2012, 5:14 a.m., KNK wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By KNK.</div>


<p style="color: grey;"><i>Updated March 21, 2012, 5:14 a.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">chan_dahdi / sig_ss7 part of changes</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">compiles, link setup, cli commands, bassic calls
Passed my phone calls through local SS7 loop for few days without problems</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/SS7-27">SS7-27</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>trunk/channels/chan_dahdi.c <span style="color: grey">(358623)</span></li>

 <li>trunk/channels/sig_ss7.h <span style="color: grey">(358623)</span></li>

 <li>trunk/channels/sig_ss7.c <span style="color: grey">(358623)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1676/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>