[Asterisk-Users] Setting up calls through the manager interface

Bjorn bok2 at online.no
Fri Jun 3 12:51:14 MST 2005


Hello all!

I am currently making a script which is supposed to set up a call on request from a user, say, through a web page, for support issues etc. I am new into both asterisk and php, but I am working my way through the path as good as I can.

Basically, what I would want to do, is to give the user the possibility to initiate a call by clicking a button. I?ve seen a cgi-alternative for this, but I would prefer it in PHP, furthermore, extend the functionality of this a bit:

Imagine, the user clicks a button to initiate a call. The script is called and establish a connection to the manager interface. So far so good.

The script will first call a support representative on the inside, and, when answered, it will proceed with calling the customer. If there was only one support representative, this could easily have been accomplished by executing the following:

 action: originate
context: local
exten: 555-4343
priority: 1 
channel: SIP/1234

? where channel would be the support rep.?s number. However, when there?s more than one, you?d prefer to have the calls routed to whoever is available. This is nicely fixed in the queue system, where the support representatives can log on and off, the calls goes to first available representative etc. I suppose two alternatives would be the most common ones here, to have the phone ring at all available channels within a ?support group? at the same time, or have the call distributed randomly and (preferably) transferred to another agent if it turns out there was no answer at the first representative.

I tried to achieve this by the following:


action: originate
context: local
exten: 555-4343
priority: 1 
channel: SIP/1234
channel: SIP/2345


 and

action: originate
context: local
exten: 555-4343
priority: 1 
channel: SIP/1234 & SIP/2345

.. but none of them worked.

Another nice option about the Asterisk queues is that if an agent is busy with a call he/she will not be notified about new incoming calls until the current call is finished. Since each of our softphones have six incoming lines, if one dials directly to a representative (not going into a queue) one will never get a busy tone, and the agent will be informed that there?s a call waiting. This, of course, would not be a wanted feature when I put together this system, as it will be more a ?queue of outgoing calls?. So if a support representative (or, as Asterisk calls it, an agent) is on the phone with a client, one should not be disturbed until he/she?s done.

Of course, this is a lot of information. I am not expecting anyone to actually write the code, but input on how to get around this by issuing commands through the manager interface would be greatly appreciated.

Regards,


More information about the asterisk-users mailing list