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


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 ( 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)

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


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.



[test] secret=asecret deny= permit= read=agent write=agent

bash script


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

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

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