Performing an * function in a script... ael help

Hi,

I want to create a simple bash script that performs the QUEUE_MEMBER_COUNT function and if $result = 0 then it sends an email.

I’m guessing AGI is the way to go but i looked through the list of agi commands (http://gundy.org/asterisk/agi.html) and couldn’t find anything relating to executing a function.

I know I must be wrong! A little help…! :smile:[/url]

You probably want to use the AMI instead of AGI for this. AGI’s typically run on a live channel (But you can go around this using local channels)
voip-info.org/wiki/view/Asterisk+manager+API

Thanks, this seems to be setting me down the right path.

But…!

Using the bash login example on the wiki I am unable to login. * CLI is reporting an authentication error but my manager.conf and script passwords match.

*CLI

manager.conf

[test] secret=asecret deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read=agent write=agent

bash script

[code]#1/bin/sh

echo "open localhost 5038"
sleep 1
echo "Action: Login"
echo "UserName: test"
echo "Secret: asecret"
echo
echo "Action: QueueStatus"
echo [/code]

Oh and possibly also of importance, the CLI output when I run the script…

Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. Asterisk Call Manager/1.1 Connection closed by foreign host.