Get DTMF tones from the user and say the digits


1 #!/usr/local/bin/php -q
2 <?php
3 /**
4 * @package phpAGI_examples
5 * @version 2.0
6 */
7
8 set_time_limit(30);
9 require('phpagi.php');
10 error_reporting(E_ALL);
11
12 $agi = new AGI();
13 $agi->answer();
14
15 $cid = $agi->parse_callerid();
16 $agi->text2wav("Hello, {$cid['name']}.");
17 do
18 {
19 $agi->text2wav('Enter some numbers and then press the pound key. Press 1 1 1 followed by the pound key to quit.');
20 $result = $agi->get_data('beep', 3000, 20);
21 $keys = $result['result'];
22 $agi->text2wav("You entered $keys");
23 } while($keys != '111');
24 $agi->text2wav('Goodbye');
25 $agi->hangup();
26 ?>

Documentation generated on Wed, 20 Jul 2005 15:21:32 +0000 by phpDocumentor 1.2.3