[asterisk-dev] Pickup peculiarities

Joshua C. Colp jcolp at sangoma.com
Sun Sep 3 04:23:10 CDT 2023


On Sat, Sep 2, 2023 at 7:33 PM <asterisk at phreaknet.org> wrote:

<snip>


>   * Semantically, should the above scenario work with the builtin pickup
>     functionality, or is it by design that this case is excluded, e.g.
>     channels with a PBX but not yet answered (I'm guessing no, since how
>     would one distinguish between valid cases such as these, and most
>     any other? After all, to the core, it's a channel that's executing
>     dialplan)
>

The pickup implementation is not written for such a scenario. It requires a
dialed channel to exist so the channel picking up can take its place,
otherwise you are essentially doing the ChannelRedirect you mention to rip
the calling channel out of its existing flow which the code doesn't do,
likely since it predates even having the ability to set up a bridge to
allow the exchange of audio. It was written for a particular use case.


>   * What would be the prototypical "Asterisk way" of doing the above
>     scenario? Something like ChannelRedirect() should work, but I mean
>     more within the bounds of the pickup construct (and maybe there
>     isn't any, just want to confirm I haven't missed something). Put
>     another way, how would you do the above, in the simplest way
>     possible? (high level, no code necessary)
>

There isn't for pickup.


>   * I'm thinking that one way to accomplish this given the way that
>     pickup is would be to have some kind of dummy "sink" channel driver,
>     e.g. something that can be called, but will never actually answer,
>     and can't do anything useful. This should make the above scenario
>     function without creating any further additional channels or ringing
>     any "real" endpoints. Local channels would not suffice, because they
>     begin executing dialplan immediately. The dummy channel driver
>     wouldn't do that, or really do anything, it would just be a valid
>     target for Dial() that would satisfy the properties expected by
>     pickup.c, to allow a channel currently ringing the dummy channel
>     driver to be picked up. A toy example:
>

A Local channel should work, because there are two of them and the one you
pick up (;1) should be the one that is not executing dialplan. The dialplan
one (;2) just has to do a Wait(360) or something.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20230903/6a8ee327/attachment.html>


More information about the asterisk-dev mailing list