GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


source:programatically_list_dynamic_queue_members_from_freepbx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

source:programatically_list_dynamic_queue_members_from_freepbx [2021/09/07 10:09] – created genadminsource:programatically_list_dynamic_queue_members_from_freepbx [2021/11/01 10:32] (current) genadmin
Line 1: Line 1:
 +====== FreePBX Queue Membership ======
 +
 +Queue members are stored within AstDB, which is a Sqlite3 database so these aren't found in config files. You can influence these using the queue memmber add/remove commands via AMI or if so inclined by accessing the AstDB directly (not recommended). You can get a list of members using show queue within Asterisk (or asterisk -rx "queue show nnnnn") but we can also leverage FreePBX to get a list using the framework. 
 +
 <code PHP> <code PHP>
 <?php <?php
 +// pbxqueues.php Version 1.001a
 +// Richard Taylor 2021
 +// Chunks taken from FreePBX source
  
 if (!isset($argv[1])){ if (!isset($argv[1])){
Line 11: Line 18:
 $device=$FreePBX->Core->getDevice($argv[1]); $device=$FreePBX->Core->getDevice($argv[1]);
 $user=$FreePBX->Core->getUser($argv[1]); $user=$FreePBX->Core->getUser($argv[1]);
- 
- 
  
 if ($astman) { if ($astman) {
Line 37: Line 42:
  
 ?></code> ?></code>
 +
 +You can of course modify this code to change Queue Membership if needed. The recommended route is of course to use Asterisk's built in commands though. The format of AstDB *may* change in the future and this may break things for you. 
 +
 +A scenario where this could be useful is when we're synchronising a list of queue members with a third party system. We use the code above to get a list of current members, then open a session with Asterisk via AMI and remove those who we don't want and add those we do. 
 +
 +Remember queue membership changes occur right away and there's no need to do a dialplan reload etc. 
/home/gen.uk/domains/wiki.gen.uk/public_html/data/pages/source/programatically_list_dynamic_queue_members_from_freepbx.txt · Last modified: 2021/11/01 10:32 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki