Hi, Iam developing a ragi application. In order to make use of the speak_text method, i added the swift.agi file in /var/lib/asterisk/agi-bin directory.
I give all read/write permission to the file. when i try to call the extension i get the following error:
[color=red]Lauched AGI script /var/lib/asterisk/agi-bin /swift.agi
/var/lib/asterisk/agi-bin /swift.agi: Line 2: text: command not found
/var/lib/asterisk/agi-bin /swift.agi: Line 3: stdin: command not found
/var/lib/asterisk/agi-bin /swift.agi: Line 20: syntax error: unexpected end of file[/color]
my swift.agi file is as given below: the line #2, #3 and @20 are in bold
#!/bin/sh
text = echo $*
stdin = “0”
while “$stdin” != ""
do
read stdin
if “$stdin” != ""
then
stdin2=echo $stdin | sed -e 's/: /=/' -e 's/"//g' -e 's/$/"/' -e 's/=/="/ '
eval echo $stdin2
fi
done
calleridnum=echo $agi_callerid | cut -f2 -d\< | cut -f1 -d\>
calleridname=echo $agi_callerid | cut -f1 -d\<
/usr/local/bin/swift -o /tmp/$agi_uniqueid.wav -p audio/channels=1,audio/sampling-rate=8000 " $text "
echo “stream file /tmp/$agi_uniqueid #”
read stream
rm /tmp/$agi_uniqueid.wav
exit 0
–Please suggest me on this errors. How should i resolve them.