[asterisk-users] Call preemption

Jean Aunis jean.aunis at prescom.fr
Thu Nov 9 04:02:48 CST 2017

>> 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.
Thank you for your answers. In this case the priority would be 
transmitted in the SIP signalling with the SIP "Priority" header, but in 
the future it could be determined by other means (for instance, by 
searching the caller in a list of privileged numbers).

The problem with "core show channels concise" is that it will display 
all the channels currently existing in Asterisk, whereas I want to pick 
the channel to hangup in a subset of the existing channels. For example 
: I don't care about the number of channels dedicated to "internal" 
calls, but I want to limit the number of calls to 10 for a SIP trunk A, 
and to 15 for a SIP trunk B.

I'm currently using GROUP and GROUP_COUNT to gather my channels in 
groups, which already allows me to limit the amount of calls to a given 
SIP trunk. Ideally, I would like to pick a channel to hangup in a 
particular group. But if there is a mechanism better than groups to do 
this, I'll take it.

More information about the asterisk-users mailing list