Just to set the scene;
I am running an outbound lead generation campaign. Qualified leads are transferred externally via the 'Transfer Conf' to our client - the transfer number is set in the campaign as a preset.
When we click 'park customer dial' it can sometimes be some time before a transfer agent (at my client's inbound call centre) becomes available.
I have been tasked with writing a query that displays when a live call is being transferred to my client, and currently waiting to be answered by the client. This will underpin a simple html/php page that flashes a horrible shade of red until the call is answered - to be used as a 'there is a call waiting - wallboard' on a computer screen in my client's call centre.
What I have so far is;
- Code: Select all
SELECT
cl.caller_code AS `callwaiting`
FROM asterisk.call_log cl
INNER JOIN asterisk.recording_log rl ON (RIGHT(rl.filename,8) = RIGHT(cl.caller_code,8) AND rl.start_time > CURDATE())
WHERE cl.number_dialed = <<TRANSFER NUMBER>>
AND cl.end_epoch IS NULL
AND rl.end_epoch IS NULL
GROUP BY cl.caller_code
LIMIT 10
This does most of the job that I want it to, it returns results from the moment the 'Park Customer Dial' button is pressed (e.g. as soon as the dialler initiates the third party call) - and when my agent leaves the 3-way call it returns no results (ending the flashing call waiting sign on the wallboard/display)
I really need to find when the call is answered by my client's transfer agent rather than when we've completed the transfer.
Also this query can take up to three seconds to execute depending on traffic, which is a serious issue as if my client opens more than one instance of the 'wallboard' it completely locks up my slave server and it's goodbye reports until we get them to shut the extra pages!
I need to find a much less resource intensive way to get this information from the dialler. I've combed the asterisk tables for anything that might help, scoured for help topics online and so far come up with nothing so would greatly appreciate any help or guidance!
Many thanks in advance,
Chris