Mobile Art && Code

I am here at CMU in Pittsburgh at a conference called Mobile Art && Code. Great talks, great workshops, glad I came.

I am doing a workshop called Interactive Telephony for New Media Arts, here is the full set of notes.

One thing that I did for the workshop is a put together an Asterisk driven webservice in PHP for getting at live phone call data. If you have been working projects that get information from asterisk or use phone calls to control other applications, it might be worth checking out.

PHP AGI Script:

#!/usr/bin/php -q
<?PHP
require('/var/lib/asterisk/agi-bin/phpagi.php');

$agi = new AGI();

$agi->stream_file("vm-extension");
$return = $agi->wait_for_digit(10000);
while ($return['result'] > 0)
{
        $ascii = chr($return['result']);
        $agi->say_number($ascii);
        file_put_contents("/var/www/html/webservice/data.txt",time() . "," . $agi->request["agi_uniqueid"] . "," . $agi->request["agi_callerid"] . "," . $ascii . "\n",FILE_APPEND);
        $return = $agi->wait_for_digit(100000);
}
?>

PHP Web Service Script:

<?
	// The client will send a timestamp if it want's new stuff from the timestamp
	$timestamp = 0;
	if (isset($_GET['ts']))
	{
		$timestamp = $_GET['ts'];
	}

	$data = file_get_contents("data.txt");
	$dataarray = explode("\n",$data);
	if ($timestamp > 0)
	{
		// Send everything from the timestamp forward
		for ($i = sizeof($dataarray) - 10; $i < sizeof($dataarray); $i++)
		{
			$currentline = explode(",",$dataarray[$i]);
			if (sizeof($currentline) > 0)
			{
				if ($currentline[0] > $timestamp)
				{
					echo($dataarray[$i]."\n");
				}
			}
		}
	}
	else
	{
		// Just send the last one
		if (sizeof($dataarray) > 1)
		{
			echo($dataarray[sizeof($dataarray)-2]);
		}
	}
?>

Processing Example

I should note that this was built very quickly and therefore somewhat buggy. I don’t think the Processing example is thread safe and the PHP should really be using a database.. Also, the Processing example is a riff off of something Dan Shiffman put together for getting Asterisk and Processing to talk through a Java server.

ITP Show in full swing

ITP’s end of semester show is all the rage at the moment. Been floating around playing with projects and taking some snapshots.

More soon but here is a teaser courtesy of Meredith Hasson’s Video Mosiac

And another courtesy of Nobuyuki Nakaguchi’s Breath Note

(I love the digital take home)

ITP End of Year Events – Thesis Presentations and End of Semester Show

ITP Spring Show 2006
A two day exhibition of interactive sight, sound and physical objects from the student artists of ITP.

This event is free and open to the public. No need to RSVP.

ITP Thesis Presentations 2006
ITP’s graduating students will be presenting a wide variety of highly creative and interactive projects that they have constructed over the course of their final project seminars.

Students have been encouraged to undertake projects that bring together the conceptual and design issues that they have engaged in during their two years of study at ITP.

Projects will include installation based work, digital video and audio pieces, interactive 3D, games and educational applications, to name only a few.

ITP will be providing a live webcast of all the thesis presentations.