In article <[EMAIL PROTECTED]>,
Bjorn <[EMAIL PROTECTED]> 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/2345

No, 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/[EMAIL PROTECTED])
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/[EMAIL PROTECTED]
Context: external
Exten: 0123456789
Priority: 1

See http://www.voip-info.org/wiki-Asterisk+Local+channels for more info.

Cheers
Tony
-- 
Tony Mountifield
Work: [EMAIL PROTECTED] - http://www.softins.co.uk
Play: [EMAIL PROTECTED] - http://tony.mountifield.org
_______________________________________________
Asterisk-Users mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to