Bjorn
2005-Jun-03 12:51 UTC
[Asterisk-Users] Setting up calls through the manager interface
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,
Bjorn
2005-Jun-04 01:21 UTC
SV: [Asterisk-Users] Setting up calls through the manager interface
I guess the simple solution for the problem below would be if there was a way through the management interface to establish a call between two extensions defined in the dialplan, and not an extension and a specified channel. If anyone knows how, I'd appreciate the feedback. Regards, Bjorn =========================================================================== 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,
Tony Mountifield
2005-Jun-04 02:35 UTC
[Asterisk-Users] Re: Setting up calls through the manager interface
In article <8357030.1117828274649.JavaMail.adm-moff@moffice11.nsc.no>, Bjorn <bok2@online.no> wrote:> -=-=-=-=-=- > > 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/2345No, you need to use the "Local" channel type. So as not to confuse between labels I'll use a different name for the contexts. So in extensions.conf you might have something like this: [internal] exten => _1XXX,1,Dial(SIP/${EXTEN}) exten => _1XXX,2,NoOp(DIALSTATUS=${DIALSTATUS}) exten => _1XXX,3,Hangup [external] exten => _X.,1,Dial(SIP/${EXTEN}@provider) exten => _X.,2,NoOp(DIALSTATUS=${DIALSTATUS}) exten => _X.,3,Hangup Then if you wanted to dial your internal extension of 1234 and when answered connect them to the outside number 0123456789, through the manager API you do the following: Action: Originate Channel: Local/1234@internal Context: external Exten: 0123456789 Priority: 1 See http://www.voip-info.org/wiki-Asterisk+Local+channels for more info. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org