I'm new to asterisk and struggling with it. I'd appreciate any help.

I'm building a schedule call feature in a CRM. I have a list of phone-numbers stored in a table in mysql.

I'm using AMI Originate to make calls to these phone-numbers and connect them to agents in a queue. The problem is that Originate first calls client and puts him on hold and then calls the queue. I need to first call the queue, wait for an agent to answer, put the agent on HOLD, and then call the client, So i dont make the client wait for a call he does not know what it is and probably hangup on the call.

I've seen this working in wombat dialer, but i dont know how it actually works. 

Thanks in advance