I am new to programming, trying to create a PHP AGI to check a queue status before placing the call on that queue. If the Queue has more than 10 calls waiting then i want to play an IVR saying the “Queue is busy” if call waiting is less than 10, call will directly placed on queue. I have the dial plan ready for this. But, need the AGI to execute below command and give an verbose as BUSY or FREE – help please.
asterisk -rx ‘queue show queue_name’ | grep queue_name
queue_name has 5 calls (max unlimited) in ‘rrmemory’ strategy (7s holdtime, 146s talktime), W:0, C:82720, A:26544, SL:4.4% within 0s