Sunday, January 18, 2009

First Agi code in trixbox using text2wav

first text2wav must be installed
yum install festival

find / -name phpagi.conf
find / -name text2wave
These should give you /etc/asterisk/phpagi.conf and /usr/bin/text2wave

Now nano /etc/asterisk/phpagi.conf and change text2wave=/usr/src/festival/bin/text2wave to text2wave=/usr/bin/text2wave and Voila! It works!


----php code------------

#!/usr/local/bin/php -q

$agi = new AGI();
$agi->answer();
$cid = $agi->parse_callerid();
$agi->text2wav("Hello, {$cid['name']}. Let's enter some text.");
$text = $agi->text_input('UPPERCASE');
$agi->text2wav("You entered $text");
$agi->text2wav('Goodbye');
$agi->hangup();
?>



------extensions_custom.php------------
exten => 311,1,Answer
exten => 311,2 Wait(1)
exten => 311,3,DigitTimeout(7)
exten => 311,4,ResponseTimeout(10)

exten => 311,5,AGI(input.php





No comments:

Post a Comment