// Set a script timeout of 60 seconds set_time_limit(60); // Require the phpagi.php class require_once 'phpagi.php'; // Report on all errors. error_reporting(E_ALL); // Require class.jaiku.php to talk to Jaiku require_once "/www/php-classes/jaiku/class.jaiku.php"; // Create a new Jaiku object; replace with your username, password and screen name here. $j = new Jaiku("username", "password", 'screenname'); // Create a new AGI object. $agi = new AGI(); // Answer the incoming call. $agi->answer(); // Say hello. $agi->text2wav("Hello."); // Read back the current presence ReadPresence($agi, $j); // Loop until we've either quit, timed out, or completed. $alldone = 0; do { $text = EnterPresence($agi); $rv = UpdateMenu($agi, $j, $text); } while (!$alldone); // Say good-bye $agi->text2wav('Goodbye'); // Hang up the call. $agi->hangup(); /** * Read back the current Jaiku presence. * @param object $agi the AGI object