Posts Tagged NewsPost
Heavy Queue Usage in FreePBX
When it comes to busy queues and FreePBX, it often results in requests for help in the forums and to our support department because of overloaded systems or certain functions that do not seem work right. FreePBX was designed to be an SMB PBX concentrating on feature rich capabilities at the expense of complex dialplan and AGI scripts, all of which take their toll when you setup a reasonable size call center and start throwing lots of simultaneous calls at a group of queue members. This Technical Corner post will discuss some of the advancements introduced in FreePBX over the years to help accommodate systems that make extensive use of queues. These same changes will have positive impact on low power appliances and any other system that uses queues.
Throughout the article we will refer to FreePBX Queue Agents as members to be consistent with the Asterisk naming convention. FreePBX commonly refers to any queue member as a Queue Agent which is someone who answers calls destined for the queue and does not specifically refer to the Asterisk agents.conf agents.
Before going into the solutions we will frame the problem and describe why FreePBX runs into issues that other Asterisk configurations may not. The root cause of the issues described in this article hinge on two fundamentals that are employed by FreePBX. First of all, FreePBX abstracts extensions from the device(s) they are associated with. You can read more about this in a past article FreePBX Devices and Users Under the Hood. As a result, queue members are not dialed by calling the device directly but instead are sent down the Asterisk dialplan through the Local channel. This allows the extension to be called in the same way that they would be dialed by another user on the system. It also enables all possible features such as call forwarding, follow-me, etc. It further allows arbitrary external phone numbers to be treated as members in addition to other creative uses. This leads to the second fundamental, all internal calls in FreePBX employ the use of the dialparties.agi AGI script along with other AGI scripts when making calls. As a result, calling a queue member is a “heavy” operation (as is calling any extension on the system). In the case of a queue, this is multiplied when employing a ringall strategy (very common) because every queue call that is dispatched ends up in simultaneous calls to every member, and thus a barrage of heavy dialplan and AGI scripts are launched, often just to find out that most of the members are currently in use and should not have their phones rung anyhow.