Menu

[r10]: / trunk / examples / dtmf.php  Maximize  Restore  History

Download this file

22 lines (19 with data), 545 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/local/bin/php -q
<?php
set_time_limit(30);
require('phpagi.php');
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();
$cid = $agi->parse_callerid();
$agi->text2wav("Hello, {$cid['name']}.");
do
{
$agi->text2wav('Enter some numbers and then press the pound key. Press 1 1 1 followed by the pound key to quit.');
$result = $agi->get_data('beep', 3000, 20);
$keys = $result['result'];
$agi->text2wav("You entered $keys");
} while($keys != '111');
$agi->text2wav('Goodbye');
$agi->hangup();
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.