[Asterisk-Users] How do i configure so an incoming call triggers an http request?

Alastair Maw asterisk at almaw.com
Wed Aug 13 07:31:56 MST 2003


Dave Wilson wrote:
> [...]
>
> [default]
> s,1,AGI(bash-scriptname.sh)
> 
> To call my script from asterisk?

That should work fine. You need to put the shell/perl script in the 
agi-bin directory specified in /etc/asterisk/asterisk.conf (typically 
/var/lib/asterisk/agi-bin/). Make sure you remember to chmod +x your 
bash script, or it won't execute. :)

Something like this should work fine:

#!/bin/sh
# uncomment one of these:
#/usr/bin/lynx -source http://your.site.com/foo > /dev/null 2>&1
/usr/bin/wget -O - http://your.site.com/foo > /dev/null 2>&1

You can write AGI scripts in anything you like - it uses stdin and
stdout to communicate with Asterisk (set variables, send commands,
etc.). Check out the last link I sent in my previous mail for details.

-- 
Alastair Maw <al.maw at mxtelecom.com>
MX Telecom - Systems Analyst
http://www.mxtelecom.com




More information about the asterisk-users mailing list