PHP-AGI question: Trigger PHP script if no agents available

Hello,

I’m very new to PHP-AGI. I have two questions:

  1. When a queue with no available agents is called, I want to execute a PHP script. I want to trigger the script for all queues, not a specific queue. How can I do that? Which file should I edit? (In queue settings, “join empty” is “no” and “leave empty” is “strict”.)

  2. Is it possible to use the queue number as a variable in my PHP script?

Thanks in advance.

You can do the first using normal dialplan, and various functions.

Queues don’t have numbers; they have names. You can always make the name of queue a channel variable (although check the list of standard channel variables).

(In my view AGI is over-used for things that could be done with plain dialplan code.)