[Asterisk-Users] Re: Asterisk Question
Alexander Lopez
Alex.Lopez at OpSys.com
Mon Feb 27 21:46:33 MST 2006
read STDIN
while [ "x$STDIN" != "x" ]
do
export VARNAME=`echo $STDIN | cut -f1 -d ":"`
export VARVALUE=`echo "$STDIN" |cut -f2 -d ":" | cut -c2-255`
case $VARNAME in
("agi_request") export AGIREQUEST=$VARVALUE;;
("agi_channel") export AGICHANNEL=$VARVALUE;;
("agi_language") export AGILANGUAGE=$VARVALUE;;
("agi_type") export AGITYPE=$VARVALUE;;
("agi_uniqueid") export AGIUNIQUEID=$VARVALUE;;
("agi_callerid") export AGICALLERID="$VARVALUE";;
("agi_calleridname") export
AGICALLERIDNAME="$VARVALUE";;
("agi_dnid") export AGIDNID=$VARVALUE;;
("agi_rdnis") export AGIRDNIS=$VARVALUE;;
("agi_context") export AGICONTEXT=$VARVALUE;;
("agi_extension") export AGIEXTENSION=$VARVALUE;;
("agi_priority") export AGIPRIORITY=$VARVALUE;;
("agi_enhanced") export AGIENHANCED=$VARVALUE;;
("agi_accountcode") export AGIACCOUNTCODE=$VARVALUE;;
esac
read STDIN
done
}
#
# You now have all the stuff Asterisk gives you stored in Variables
#
#
# Do what ever you want here:
#
#
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of
> pdhales at optusnet.com.au
> Sent: Monday, February 27, 2006 10:53 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [Asterisk-Users] Re: Asterisk Question
>
>
> I was going to see if I can execute a bash script as an AGI -
> just looking around the internet for examples at the moment.
> Anybody got an example spare?
> I'm just a bit stuck on how to start this, but I am quite
> comfortable writing asterisk dialplan stuff and bash scripts....
>
> later,
>
> PaulH
More information about the asterisk-users
mailing list