Hello, Has anyone already implemented some sort of call preemption in Asterisk ? I am trying to achieve something like this : - I want to limit the number of calls on a given SIP peer to 10 - on the other hand, some calls have higher priority than others - when the ceiling of 10 calls is reached and a call with a high priority is attempted, I would like to drop a call with a lower priority to let the new one go through Monitoring the ceiling is easy with channel groups, but it is does not help in implementing call preemption since there is no function to retrieve all the channels of a given group. Does anyone have an idea ? Regards Jean Aunis
The task itself sounds like a job for an AGI script to me... check for amount of calls, if 10, hangup one. But how do you determine the priority of a call? Am 07.11.2017 um 12:21 schrieb Jean Aunis:> Hello, > > Has anyone already implemented some sort of call preemption in Asterisk > ? I am trying to achieve something like this : > [...] > > Does anyone have an idea ?
Please don't top-post. On Wed, 8 Nov 2017, Markus wrote:> The task itself sounds like a job for an AGI script to me... check for amount > of calls, if 10, hangup one. > > But how do you determine the priority of a call? > > > Am 07.11.2017 um 12:21 schrieb Jean Aunis: >> Hello, >> >> Has anyone already implemented some sort of call preemption in Asterisk ? I >> am trying to achieve something like this : >> [...] >> >> Does anyone have an idea ?An AGI using AMI to do 'core show channels concise', parse the output, pick your victim, AMI to do 'channel request hangup x' Note that there are 'race condition' opportunities. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST https://www.linkedin.com/in/steve-edwards-4244281
The easiest thing to do might be to limit the peer to 11 calls in your sip.conf or pjsip.conf and then use the GROUP and GROUP_COUNT functions to limit the extension to 10 concurrent calls, Then when you get call #11 who is high priority you can allow it through or otherwise return busy. https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_GROUP https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_GROUP_COUNT On Tue, Nov 7, 2017 at 4:21 AM, Jean Aunis <jean.aunis at prescom.fr> wrote:> Hello, > > Has anyone already implemented some sort of call preemption in Asterisk ? > I am trying to achieve something like this : > > - I want to limit the number of calls on a given SIP peer to 10 > > - on the other hand, some calls have higher priority than others > > - when the ceiling of 10 calls is reached and a call with a high priority > is attempted, I would like to drop a call with a lower priority to let the > new one go through > > Monitoring the ceiling is easy with channel groups, but it is does not > help in implementing call preemption since there is no function to retrieve > all the channels of a given group. > > Does anyone have an idea ? > > Regards > > Jean Aunis > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. ---Heinlein -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20171108/913ea9c0/attachment.html>
Le 08/11/2017 ? 20:35, John Kiniston a ?crit?:> The easiest thing to do might be to limit the peer to 11 calls in your > sip.conf or pjsip.conf and then use the GROUP and GROUP_COUNT > functions to limit the extension to 10 concurrent calls, Then when you > get call #11 who is high priority you can allow it through or > otherwise return busy. > > https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_GROUP > > https://wiki.asterisk.org/wiki/display/AST/Asterisk+15+Function_GROUP_COUNT > > On Tue, Nov 7, 2017 at 4:21 AM, Jean Aunis <jean.aunis at prescom.fr > <mailto:jean.aunis at prescom.fr>> wrote: > > Hello, > > Has anyone already implemented some sort of call preemption in > Asterisk ? I am trying to achieve something like this : > > - I want to limit the number of calls on a given SIP peer to 10 > > - on the other hand, some calls have higher priority than others > > - when the ceiling of 10 calls is reached and a call with a high > priority is attempted, I would like to drop a call with a lower > priority to let the new one go through > > Monitoring the ceiling is easy with channel groups, but it is does > not help in implementing call preemption since there is no > function to retrieve all the channels of a given group. > > Does anyone have an idea ? > > Regards > > Jean Aunis > >Thank you for your answer. I'm already using GROUP and GROUP_COUNT to limit the amount of calls. The problem is that I do not want to drop the last incoming call, I want to drop one of the calls previously set up in the same group, in order to leave room to the new call. Unfortunately, it seems here is no function to list all the channels being part of a given group. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20171109/09ea4d33/attachment.html>