Te puede servir como ejemplo....bueno estuvimos hablando del uso de BASH...
No se si es bien lo que necesitas...pero puede servir.
Un abrazo ,Helius
Webdial with Asterisk
For Webdial to work with Asterisk, a web server that can handle CGI scripts, has to run on the same machine. When you click the OK button of the input box, a small popup window is created, in which the CGI script is run. It first closes the popup, then creates a call file that rings your phone and when you pick up the receiver, Asterisk connects you to the number you clicked on. Therefore it needs to know your extension number in addition to the number you want to dial. A sample shell script to achieve this is provided below, but this can be just as easily coded in Perl or PHP. It uses the query arguments, channel, from for the caller, to for the number to call, context and timeout to determine how many seconds to ring your phone. Some changes to the sample might be on order to make it work in your environment.
#!/bin/sh
echo -e "Content-type: text/html\\n\\n" # Close the popup
callfile=/tmp/`sed -e 's/[^0-9]//g' /proc/uptime`.call # Create a unique filename
eval `echo $QUERY_STRING|sed -e 's/&/ /g'` # Create variables from arguments
cat <
Channel: $channel/$from
Callerid: $from
WaitTime: $timeout
Context: $context
Priority: 1
Extension: $to
EOF
mv $callfile /var/spool/asterisk/outgoing
Make sure the script is executable for the user, your web server is running under. To test it enter something like
http://server/path/webdial.cgi?channel=SIP&context=default&from=123&to=4567890&timeout=15
in your browser, where channel is the channel your phone is connected to, context is the one for calling out, from is your extension, to is a number you want to dial and timeout the number of seconds, you want your phone to ring. If this works, you can create the bookmarklet.
Create Webdial bookmarklet to work with Asterisk
