[asterisk-users] Skype-like dialing from web page

A J Stiles asterisk_list at earthshod.co.uk
Wed May 18 06:52:21 CDT 2011


On Tuesday 17 May 2011, Mike wrote:
> Hi,
> Is there any softphone or TAPI plug-in that allows one to dial from a web
> page?

Just write a simple CGI script  (running from the Asterisk server)  which 
looks up the nearest phone from the remote IP address ( $ENV{REMOTE_ADDR} in 
Perl), and inject a suitably-modified call file into the 
folder /var/spool/asterisk.outgoing/ .  The file needs to look something like 
the below example:

-----8<-----
Channel: SIP/$SRC
Context: $CTXT
Extension: $DEST
Priority: 1
CallerId: $SRC
----->8-----

where $SRC = source number, $CTXT = context and $DEST = destination.

NB, create the file in /tmp/ first then mv it; this way you can be sure 
Asterisk will never try to parse an incomplete callfile.  If doing this in 
Perl, you *may* get away with keeping the callfile under 1 disk block as long 
as $| = 0 on the filehandle, but this is by no means portable.

-- 
AJS

Answers come *after* questions.



More information about the asterisk-users mailing list