Implementing CLID AGI Script with Queue()

Hi All,

We have done the following;

  1. We have a call centre with AgentLogin() method for having Agents logged on to some queue and ready to take calls once the calls gets connected to the queue and there are ready Agents.

  2. Agents receiving the calls hears “U have a Call” and the caller gets connected to the agent automatically after the agents announcement.

  3. we have built an AGI script to collect the CLID (calling line identification) or calling number and search through customers table with numbers, name, etc from a DB, and if a match is found the script displays or popup the caller’s name to the Agents screen or popup the caller’s number if its doesn’t match any name in the DB so the Agents can update the DB with the number, so it can be displayed next time the caller called.

  4. We’ve been able to achieve the screen popup so that the Agents can Greet or call the customer by the name once connected to the customer. It makes so much sense for frequent customers.

Now, draw back is that, the popup comes a bit late for the Agents to see whats the name is before attending to the customer, so MOST of the time that does not happen.

We want to put some delay between when the AGI script runs and when the call enters the queue, but we need the call to enter the queue first, so that the AGI can pick up some variable that will be set (e.g UNIQUE_ID of the call) when the call enters the queue.

We have the following code snipped;

… some codes…
exten => 4000,n,AGI(cid.php)
exten => 4000,n,Queue(4000,t,custom/Uhaveacall)
… other codes…

So, how or where can we put this delay inside the Queue() command, since the call MUST enter the queue before our cid.php worked correctly?

We use Asterisk version 1.4.26 and it support calling AGI scripts inside the Queue(). We have tried calling the cid.php script inside the Queue() with AGI with no success.

Any idea on how to achieve the delay as explained and needed above will be appreciated.

Cheers to All.

we have also tried the following with no success;

…some code…
exten => 4000,n,Queue(4000,t,custom/Uhaveacall,cid.php)
…other codes…

inside cid.php we added the following snippet;
#!/usr/bin/php -q

<? require 'phpagi.php'; $agi = new AGI(); [color=#FF8000]$agi->answer(); $agi->wait(10);[/color] ... the other codes... ?>

We expect the codes in orange to put some hold on the calling channel so that the Agents can have some seconds to get the popup before speaking to the customer. We still didn’t get the required delay.

Can someone please throw some ideas on how to put the calling channel on-hold for some seconds using the scenario as explained above.

cheers to All.

  1. I assume the reason why you need the caller connected to the queue is to know which agent to popup the information to?

  2. The member macro you are running only starts that code once a caller is connected to the agent. You want a before event, not an after event. To my knowledge, Membermacro is an after event.

  3. The AGI option you are using in your queue() application is no different AFAIK than the MemberMacro. In fact, the Membermacro can do an AGI() call anyways. It’s still an after event AFAIK too.

The only thing I can think about is the memberdelay setting on a queue. Try putting in memberdelay=15 in your queues.conf file where you are defining that queue. I have not used it, but it might allow the MemberMacro to fire and then wait 15 seconds before actually connecting to the agent.

Make sure that 15 seconds though still has Moh…

Thanks so much for this hint and idea.

I have tried the memberdelay parameter as described and it got me to the point where the Agent got a beep and delayed the caller for the specified seconds. I still did not get the popup in a timely manner though, but I will do more testing around this and let you know how it goes.