[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] Extended maximum number of pickupgroups (callgroup/pickupgroup)
From:       "Tilghman Lesher" <reviewboard () asterisk ! org>
Date:       2012-07-26 22:09:09
Message-ID: 20120726220909.6046.11449 () hotblack ! digium ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2043/#review6824
-----------------------------------------------------------



/trunk/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/2043/#comment13139>

    This appears to treat the channel as a storage mechanism, instead of ab=
stracting out the API functionality.  The purpose of the channel abstractio=
n layer was so that we could change the internals of how particular values =
are stored without changing the API.  That is not what this does.  See how =
dialled causes are stored within the channel for an example of the proper a=
bstraction.


- Tilghman


On July 20, 2012, 9:16 a.m., Guenther Kelleter wrote:
> =

> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2043/
> -----------------------------------------------------------
> =

> (Updated July 20, 2012, 9:16 a.m.)
> =

> =

> Review request for Asterisk Developers, Mark Michelson, Matt Jordan, and =
Thomas Arimont.
> =

> =

> Summary
> -------
> =

> This patch adds the feature "Extended maximum number of pickupgroups (cal=
lgroup/pickupgroup)".
> =

> The feature is implemented as named pickup/call groups which can be used =
in parallel to but independent from the already known numbered call/pickup =
groups. Named groups will allow an unlimited number of pickup/call groups.
> Named groups are configured with the keywords "namedcallgroup" and "named=
pickupgroup" (conforming to "callgroup" and "pickupgroup").
> A namedpickupgroup "4" does not match the callgroup number 4.
> =

> Additionally the behavior of the undirected pickup is changed so that the=
 oldest ringing channel (creation time of the channel) is picked up when mo=
re than one channel could be picked up. This will be required by another ne=
w feature which is yet to be posted.
> =

> A few words to describe the implementation:
> Names of named groups are collected in a container at configuration time =
of a user. This container will be copied (in fact referenced) around to the=
 channels in parallel with the numbered groups bitfield.
> When an undirected pickup is executed, the pickup and call groups are mat=
ched against each other, and the oldest target channel which matches is cho=
sen. Notably there is almost no overhead for the named group handling when =
no pickup is executed, except referencing of the containers.
> =

> =

> Diffs
> -----
> =

>   /trunk/CHANGES 370245 =

>   /trunk/channels/chan_dahdi.c 370245 =

>   /trunk/channels/chan_misdn.c 370245 =

>   /trunk/channels/chan_sip.c 370245 =

>   /trunk/channels/misdn/chan_misdn_config.h 370245 =

>   /trunk/channels/misdn_config.c 370245 =

>   /trunk/channels/sip/include/sip.h 370245 =

>   /trunk/configs/chan_dahdi.conf.sample 370245 =

>   /trunk/configs/misdn.conf.sample 370245 =

>   /trunk/configs/sip.conf.sample 370245 =

>   /trunk/include/asterisk/channel.h 370245 =

>   /trunk/main/channel.c 370245 =

>   /trunk/main/channel_internal_api.c 370245 =

>   /trunk/main/features.c 370245 =

> =

> Diff: https://reviewboard.asterisk.org/r/2043/diff
> =

> =

> Testing
> -------
> =

> Call pickup tested for sip, dahdi and misdn channels. Reference counter h=
andling of ao2_container (which includes the group names) checked with addi=
tional debug output.
> =

> =

> Thanks,
> =

> Guenther
> =

>


[Attachment #5 (text/html)]

<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/2043/">https://reviewboard.asterisk.org/r/2043/</a>
  </td>
    </tr>
   </table>
   <br />









<div>




<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/2043/diff/2/?file=30510#file30510line1039" \
style="color: black; font-weight: bold; text-decoration: \
underline;">/trunk/main/channel_internal_api.c</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; \
">ast_group_t ast_channel_pickupgroup(const struct ast_channel *chan)</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">1039</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="k">struct</span> <span class="n">ao2_container</span> <span \
class="o">*</span><span class="nf">ast_channel_named_callgroups</span><span \
class="p">(</span><span class="k">const</span> <span class="k">struct</span> <span \
class="n">ast_channel</span> <span class="o">*</span><span class="n">chan</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">1040</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1041</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">	<span \
class="k">return</span> <span class="n">chan</span><span class="o">-&gt;</span><span \
class="n">named_callgroups</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">1042</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1043</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="kt">void</span> <span class="nf">ast_channel_named_callgroups_set</span><span \
class="p">(</span><span class="k">struct</span> <span class="n">ast_channel</span> \
<span class="o">*</span><span class="n">chan</span><span class="p">,</span> <span \
class="k">struct</span> <span class="n">ao2_container</span> <span \
class="o">*</span><span class="n">value</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">1044</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1045</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">	<span \
class="n">chan</span><span class="o">-&gt;</span><span \
class="n">named_callgroups</span> <span class="o">=</span> <span \
class="n">value</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">1046</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1047</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="k">struct</span> <span class="n">ao2_container</span> <span \
class="o">*</span><span class="nf">ast_channel_named_pickupgroups</span><span \
class="p">(</span><span class="k">const</span> <span class="k">struct</span> <span \
class="n">ast_channel</span> <span class="o">*</span><span class="n">chan</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">1048</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1049</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">	<span \
class="k">return</span> <span class="n">chan</span><span class="o">-&gt;</span><span \
class="n">named_pickupgroups</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">1050</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1051</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="kt">void</span> <span \
class="nf">ast_channel_named_pickupgroups_set</span><span class="p">(</span><span \
class="k">struct</span> <span class="n">ast_channel</span> <span \
class="o">*</span><span class="n">chan</span><span class="p">,</span> <span \
class="k">struct</span> <span class="n">ao2_container</span> <span \
class="o">*</span><span class="n">value</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">1052</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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">1053</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">	<span \
class="n">chan</span><span class="o">-&gt;</span><span \
class="n">named_pickupgroups</span> <span class="o">=</span> <span \
class="n">value</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">1054</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="p">}</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This \
appears to treat the channel as a storage mechanism, instead of abstracting out the \
API functionality.  The purpose of the channel abstraction layer was so that we could \
change the internals of how particular values are stored without changing the API.  \
That is not what this does.  See how dialled causes are stored within the channel for \
an example of the proper abstraction.</pre> </div>
<br />



<p>- Tilghman</p>


<br />
<p>On July 20th, 2012, 9:16 a.m., Guenther Kelleter 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, Mark Michelson, Matt Jordan, and Thomas \
Arimont.</div> <div>By Guenther Kelleter.</div>


<p style="color: grey;"><i>Updated July 20, 2012, 9:16 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;">This patch adds the feature &quot;Extended maximum number of \
pickupgroups (callgroup/pickupgroup)&quot;.

The feature is implemented as named pickup/call groups which can be used in parallel \
to but independent from the already known numbered call/pickup groups. Named groups \
will allow an unlimited number of pickup/call groups. Named groups are configured \
with the keywords &quot;namedcallgroup&quot; and &quot;namedpickupgroup&quot; \
(conforming to &quot;callgroup&quot; and &quot;pickupgroup&quot;). A namedpickupgroup \
&quot;4&quot; does not match the callgroup number 4.

Additionally the behavior of the undirected pickup is changed so that the oldest \
ringing channel (creation time of the channel) is picked up when more than one \
channel could be picked up. This will be required by another new feature which is yet \
to be posted.

A few words to describe the implementation:
Names of named groups are collected in a container at configuration time of a user. \
This container will be copied (in fact referenced) around to the channels in parallel \
with the numbered groups bitfield. When an undirected pickup is executed, the pickup \
and call groups are matched against each other, and the oldest target channel which \
matches is chosen. Notably there is almost no overhead for the named group handling \
when no pickup is executed, except referencing of the containers.</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;">Call pickup tested for sip, dahdi and misdn channels. Reference counter \
handling of ao2_container (which includes the group names) checked with additional \
debug output.</pre>  </td>
 </tr>
</table>




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

 <li>/trunk/CHANGES <span style="color: grey">(370245)</span></li>

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

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

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

 <li>/trunk/channels/misdn/chan_misdn_config.h <span style="color: \
grey">(370245)</span></li>

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

 <li>/trunk/channels/sip/include/sip.h <span style="color: grey">(370245)</span></li>

 <li>/trunk/configs/chan_dahdi.conf.sample <span style="color: \
grey">(370245)</span></li>

 <li>/trunk/configs/misdn.conf.sample <span style="color: grey">(370245)</span></li>

 <li>/trunk/configs/sip.conf.sample <span style="color: grey">(370245)</span></li>

 <li>/trunk/include/asterisk/channel.h <span style="color: grey">(370245)</span></li>

 <li>/trunk/main/channel.c <span style="color: grey">(370245)</span></li>

 <li>/trunk/main/channel_internal_api.c <span style="color: \
grey">(370245)</span></li>

 <li>/trunk/main/features.c <span style="color: grey">(370245)</span></li>

</ul>

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




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








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



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic