[asterisk-dev] Adding a call preemption feature
James Finstrom
jfinstrom at gmail.com
Mon Nov 13 09:56:45 CST 2017
Generally the idea of arbitrarily killing calls seems awful, even if the
behavior is expected.
Yeah so john we need to .<CLICK> RING.... John is confused, your brain has
to reset because whatever was happening no longer matters.
You can have priority queues and allow the agents to manage the transition
rather than have the carpet yanked from their feet.
For the most part, arbitrary automation of call control between 2 humans
should avoided IMHO.
On Mon, Nov 13, 2017 at 2:31 AM, Jean Aunis <jean.aunis at prescom.fr> wrote:
> Hello,
>
> As I highlighted recently on the asterisk-users list (
> http://lists.digium.com/pipermail/asterisk-users/2017-November/292079.html),
> there is no native way in Asterisk to implement call preemption. By call
> preemption, I mean the following :
>
> - given calls have a priority, which may be notified by the network (see
> the SIP header Priority for instance), or which may be set by another way
>
> - given the number of calls to or from a given peer is limited
>
> - when this limit is reached, and an additional call comes in with a
> higher priority than previous ones, one of these calls should be hanged up
> to leave room to the new call.
>
> At the moment, it is possible to limit the number of calls to a peer using
> the GROUP/GROUP_COUNT functions. It is also possible to list all channels
> in Asterisk and choose one to hangup in an AGI script, but there is no way
> to list channels in a particular group. And there is no concept of priority
> attached to a channel.
>
> Therefore, I plan to add a new dialplan application which would preempt a
> channel in a particular group, below a given priority. It would be used
> this way : ChannelPreempt(mygroup,5) where "mygroup" is the group in which
> to look for a channel to hangup, and "5" is the priority below which the
> channel must by chosen. The application would return the preemption status
> and the preempted channel in channel variables.
>
> I would like to have your opinions about the best way to implement this.
> Here are my thoughts so far:
>
> 1- add a "priority" field to the channel structure
>
> 2- allow the CHANNEL function to read and write this field
>
> 3- inside the new ChannelPreempt application:
>
> - loop through the group list, and find the channel in the given group
> with the lowest priority
>
> - if this priority is lower than the provided one, hangup the selected
> channel with ast_softhangup
>
> - otherwise, do nothing
>
> - set the following dialplan variables on completion:
>
> * PREEMPTION_STATUS: "SUCCESS" if we found a channel to hang up,
> "FAILURE" otherwise
>
> * PREEMPTED_CHANNEL: the name of the channel that was hanged up in
> case of success, empty otherwise
>
> By the way, would this feature have a chance to be merged upstream ?
>
> Regards
>
> Jean Aunis
>
>
> --
> _____________________________________________________________________
> -- 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
--
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20171113/604404d6/attachment.html>
More information about the asterisk-dev
mailing list