[asterisk-users] Disconnect queues members every night
Benoit
maverick at maverick.eu.org
Wed Dec 31 03:27:34 CST 2008
Hi,
Well, i've made it that way, a AEL macro, that disconnect every member,
with the ability to except one:
macro empty_queue (queue,except)
{
queueSize=${QUEUE_MEMBER_COUNT(${queue})};
Set(queueMemberList=${QUEUE_MEMBER_LIST(${queue})});
for (x=1; ${x} <= ${queueSize}; x=${x}+1) {
Set(agent=${CUT(queueMemberList,\,,${x})});
Set(agentNum=${CUT(agent,/,2)});
if ("${except}" != "" && "${agentNum}" = "${except}") {
} else {
RemoveQueueMember(${queue}|Local/${agentNum}@queues/n);
}
}
}
And an extension that trigger it:
exten => 750,1,Macro(empty_queue,queue1)
exten => 750,n,Macro(empty_queue,queue2,888)
And last a cron job that generate a call file:
0 13,18 * * 1,2,3,4,5 asterisk echo -e "Channel:
Local/750 at queue-special\nContext: queue-special\nExtension: 750\n" >
/var/spool/asterisk/outgoing/`date +%Y%m%d%H%M%S`
(however the call file does trigger a warning or two when watching from
the console with verbose level 3)
Lenz Emilitri a écrit :
> You could use a very simple approach and just disconnect them all
> without caring if they are connected or not.
> Something like:
> asterisk -rx "agent logoff agent/101"
> asterisk -rx "agent logoff agent/102"
> asterisk -rx "agent logoff agent/103"
> ..and so on....
> to be executed at a given time.
> Of course I would put in place a monitoring mechanism first - if an
> agent has the responsability of logging off at the end of their shift,
> they must do so. Putting in place an automated soluition will make
> them sloppier, so be sure this is something you can control.
> Just my two eurocents,
> l.
> 2008/12/22 Benoit <maverick at maverick.eu.org
> <mailto:maverick at maverick.eu.org>>
>
>
> Hi,
>
> To force user to behave correctly, i want to make a process of
> disconnecting
> every member but one (special alarm phone) every day at a special
> time.
>
> I'm thinking of a cron job that will create a "call file" that
> will dial an
> appropriate extension to do the job, is this the correct way ?
>
> I'm facing two problems however, the call file system is here to
> connect a
> channel to an extension, but since i want this to be fully
> automated, i
> can't ring
> someone. Should i use the Local/ construct in this case ?
>
> something like that would to do job (provided the extension is
> 'autodialout' in the context 'queue') ?
>
> Channel: Local/autodialout at queues
> Context: queues
> Extension: autodialout
>
>
> The other question is how to make this so it is working through
> configuration upgrades,
> There is a way to list user from a named queue
> (QUEUE_MEMBER_LIST()) but
> i can't find
> a way to list all queues, is there one or should i manually maintain a
> list ?
>
>
> regards,
> benoit
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> --
> Loway - home of QueueMetrics - http://queuemetrics.com
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
More information about the asterisk-users
mailing list