How can we help you?

Pause queue members patch on recent FreePBX versions (>=2.11)
Posted by: Nicolás Gudiño Posted on: Aug-4th, 2015 9:24

Recent FreePBX versions, for some odd reason, use only device states to 'pause' members, losing the builtin functionality in Asterisk queues to log pauses and reasons so they can be reported.



If you use FreePBX and builtin feature codes to pause/unpause members, but they do not show on Asternic reports or realtime view, then this might help you.



Here is a patch contributed by a fellow user that solves the problem by adding the missing commands to the .agi responsible of pausing/unpausing members:



The file to modify is /var/lib/asterisk/agi-bin/queue_devstate.agi

And also posibli this one: /var/www/html/admin/modules/queues/agi-bin/queue_devstate.agi

You will find this code:



$new_state = $paused_state ? '0' : '1';
foreach ($agent_queues as $q) {
$agi->set_variable("QUEUE_MEMBER($q,paused,$user_interface)", $new_state);
debug("QUEUE_MEMBER($q,paused,$user_interface)=$new_state");
}
$agi->set_variable("TOGGLEPAUSED", $new_state);

After that you must add the following:



if($new_state)
$agi->exec('PauseQueueMember',",$user_interface");
else
$agi->exec('UnPauseQueueMember',",$user_interface");
So, the final code should look like this:



$new_state = $paused_state ? '0' : '1';
foreach ($agent_queues as $q) {
$agi->set_variable("QUEUE_MEMBER($q,paused,$user_interface)", $new_state);
debug("QUEUE_MEMBER($q,paused,$user_interface)=$new_state");
}
$agi->set_variable("TOGGLEPAUSED", $new_state);
if($new_state)
$agi->exec('PauseQueueMember',",$user_interface");
else
$agi->exec('UnPauseQueueMember',",$user_interface");



Nicolás Gudiño Apr-5th, 2016 17:05

Maybe is this one: /var/www/html/admin/modules/queues/agi-bin/queue_devstate.agi

vkichenko Dec-1st, 2015 14:22

It works fine. But it is overwriting by default file when asterisk is reload every time.
Where is default file?

|frepbx 2.11
|elastix 2.5.0

Leave a comment