[asterisk-dev] [Code Review] 2393: Add directed pickup to features

rmudgett reviewboard at asterisk.org
Thu May 2 11:48:49 CDT 2013



> On April 4, 2013, 8:44 p.m., rmudgett wrote:
> > Since this is a chan_skinny specific feature, it should not affect other channel drivers.
> > 
> > I think this feature could work this way:
> > 1) Device requests feature.
> > 2) Device supplies exten to attempt pickup.
> > 3) Driver creates a channel.
> > 4) Driver sets a channel variable with the requested exten to pickup.  Say SKINNY_PICKUP_EXTEN?
> > 5) Driver starts dialplan at a location configured by the skinny.conf file for this feature.
> > 6) Dialplan uses Pickup(${SKINNY_PICKUP_EXTEN}@context) to fetch the call.
> > 7) If the pickup attempt was not successful, Pickup continues in the dialplan so the user could do something else like play a file.
> > 
> > At the very least, I don't think special directed pickup group options are needed.  The existing pickup groups and named pickup groups are sufficient to restrict the available extensions to select the requested exten.
> >
> 
> wedhorn wrote:
>     Broadly, the idea was not to be skinny specific. Sure my code only implements the functionality for skinny, but the backend functions for this functionality were written in features.c (basically copying ast_pickup_chan handling) so other channels could also implement. I didn't write it for SIP, or any other channel driver because I've no idea about the those code bases or RFC's. However, given that group pickup is implemented in various other channel drivers (eg SIP/IAX) I see no reason that this functionality couldn't be implemented in those other drivers.
>     
>     Your suggested method would be horribly convoluted for skinny. Also it is significantly different from ast_chan_pickup which is very similar to this code in both functionality and code. I can't really see why we would want two completly different ways to do something that is so similar ("group pickup" vs "group pickup where exten matches").
>     
>     Agree to a certain extent on the groups. Suggest I remove directed_callgroup (should remove changes to sip) but leave directed_pickupgroup (should only be skinny code - or other channel that implements this functionality). The reason being that directed pickup typically encompasses a larger set than group pickup.

For Asterisk 12, the features.c file is for the most part being gutted.  For this directed pickup, it really would be better if you implemented it like I suggested so the administrator could control the call pickup in dialplan.  Also, only channel drivers that intimately control the behavior of their devices like chan_skinny can support this kind of feature within the channel driver.  Other channel drivers for protocols like SIP and IAX would need to do this in dialplan anyway.

If I could, I would remove the features.conf pickup feature map.  There is no good reason why channel drivers should know about a special pickup exten.  All you need to do is put an exten in your dialplan using the Pickup application.  The dialplan even allows more flexibility.  Admittedly, to get feature parity with the special pickup exten, the Pickup application needs to add pickup success/fail sound options.

Could a channel variable be used in place of your configured directed pickup groups?  This would eliminate the need to modify the ast_channel struct and allow other channel drivers like SIP and IAX to participate without changing their drivers.  Another benefit is that you would not be limited to 64 groups.


- rmudgett


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


On April 5, 2013, 7:16 a.m., wedhorn wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2393/
> -----------------------------------------------------------
> 
> (Updated April 5, 2013, 7:16 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Added ast_pickup_call_directed to features. Included some refactoring of ast_pickup_call to reuse same code.
> 
> In order to use ast_pickup_call, the chan passed in must have the exten set of the intended target. Will only pickup the target if the exten's match and the pickupgroupdirected and callgroupdirected of the chans match.
> 
> Also add ast_channel_callgroupdirected and ast_channel_pickupgroupdirected functions (and set functions) including code to set both of these in skinny and sip.
> 
> Code to actually do a directed pickup included in skinny.
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 383948 
>   /trunk/channels/chan_skinny.c 383948 
>   /trunk/configs/skinny.conf.sample 383948 
>   /trunk/include/asterisk/channel.h 383948 
>   /trunk/include/asterisk/features.h 383948 
>   /trunk/main/channel_internal_api.c 383948 
>   /trunk/main/features.c 383948 
> 
> Diff: https://reviewboard.asterisk.org/r/2393/diff/
> 
> 
> Testing
> -------
> 
> Directed pickup to non ringing skinny and non ringing sip device (with matching and unset groups). Returns without picking up.
> 
> Directed pickup to ringing skinny and ringing sip device, with matching groups, picks up call, with unmatching groups return without pickup.
> 
> 
> Thanks,
> 
> wedhorn
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130502/70b1514c/attachment-0001.htm>


More information about the asterisk-dev mailing list