C# Call back

Coordinator
Jan 14, 2014 at 10:05 AM
-- Moved from issue --

want to put a "call me now" button on my C# application that will place the
request into an asterisk call queue and then when an agent picks up the
call in the queue, place the outbound call to the customer.

The following AMI command works, but it calls the customer first, before
an agent is necessarily available.
------------------------Code-----------------------------
    OriginateAction oc = new OriginateAction();
    oc.Context = "from-internal";
    oc.Priority = 1;
    oc.Channel = "SIP/103"; //this the number of customer to dial;
    oc.CallerId = "Asterisk.Net";
    oc.Exten = "501"; // this is sales queue number
    oc.Timeout = 90000;
    oc.Async = true;
ManagerResponse originateResponse = manager.SendAction(oc, oc.Timeout);

Closed Mon at 11:47 AM by skrusty

comments

mohsinabbas wrote Mon at 7:00 AM [x]

Please help me out,,,,

Thanks..:)
skrusty wrote Mon at 11:00 AM [x]

Originate will always connect to the channel first, then the dialplan! Maybe consider changing the way you're trying to Originate. I assume your use case is something like: -

website -> call me
call me-> AMI
AMI -> Originate

If so, you will always have an issue here that an Agent might not be available. Better instead to place that request in a queue (say a db), when an agent is free, then do your originate.

You could also call the customer right away and put them in a queue. Or put them into an AsyncAGI and then leave them there until an agent is free, then bridge originate the agent to the ASync AGI?

Either way, you wont get the behavior you want by default just using Originate.
mohsinabbas wrote Today at 5:38 AM [x]

I have started AMI programming just 2 weeks ago and I am not getting your point...
I will explain what I am trying to do then you will understand my case:
I have an app lets say "customer" that communicate with my main application (which is connected with Asterisk through AMI) lets say "AMI application":
=> customer app sends a number (extension) to AMI application though TCP/IP
=> AMI application should place a request to asterisk queue (sales)
=> when It's turn comes, AMI application should call to customer and connect to the agent who answered the queued call

Is it possible to do using AMI or I should research some other alternatives ?
If possible then guide me please
Jan 15, 2014 at 4:32 AM
What you think is the suitable solution ?