Originating a call from a web page

I have created an extension which dials out a number, plays a sound file through the connected channel, and then hangs up. This works fine when I use a softphone and the dial the extension ( which then dials out as described above ). For simplicities sake, I have created a web page with one button which when pressed calls the originate action. However, since I don’t have a channel which will pick up ( the calling channel ) it never executes the dialplan for the extension. e.g
Channel = ??? ( no channel since this is the web )
Context = context which has my extension
Exten = xxxx ( where this extension has a dial plan which calls out )

Can someone pehaps point me to an existing post or in the right direction on how to address this. Many thanks.

You’re on the right track but you have things a bit backwards…

You need a text box for user to enter their phone number, we’ll call this variable ‘phone’

Then do an originate like so:

Channel: Zap/g1/$phone
Context: context
Exten = xxxx (where this plays the sound file and hangs up).

This way, the “caller” is rung FIRST, and when they pick up, the extension is then dialed via asterisk and the sound file played back.

Note: if you’re not using Zap trunks, this still applies, simply change the channel type and login info

Channel: IAX2/username:password@provider/exten (in this case exten is a phone number)

Hope this helps.

Sweet. That did the trick. Thanks a million!

would you please post a copy of your html page and any cgi-script that you used to do this?