ProphecyBoy

Back in the office after an excellent weekend in CT with Tim, fireworks, BBQs, billions of stars; every bug bite worth the effort to get it. - more on Twitter

AGI scripting and call files

We’ve started working with AGI scripting, which allows you to interface with Asterisk from an external file. And we’ve got the handy phpAGI library installed, so we can perform most Asterisk functions from a PHP script, plus have access to MySQL and all the advanced functions of PHP, which certainly seems the route to go for any sort of web integration. To start experimenting with AGI, I built a wakeup call service which allows you to enter a time at which to be called back (the sound files are placeholders at the moment). It uses a function which I adapted from Shawn’s script to generate a call file, which is then moved to the outgoing directory and then has its modified time set to the call time. That’s Asterisk’s somewhat janky way of scheduling outgoing calls. When the time comes, Asterisk calls you back and drops you into the ajs292_wake context, which just plays an audio file.

There’s also a web implementation (which seems like a more likely use case, to me) here.

my extensions file:
[redial_ajs292]
exten => s,1,Answer()
exten => s,n,AGI(/home/ajs292/asterisk_agi/ajs292_wake.php)

[ajs292_wake]
exten => s,1,Background(/home/ajs292/asterisk_sounds/intro)

and Wakeup Call PHP file (sorry for the link, wordpress seems to hate posting PHP, even within )

Colophon

Turning coffee into feats of intellectual derring-do since 2001

Hi there, I'm Adam Simon. I'm currently finishing up my masters at NYU's ITP (Interactive Telecommunications Program), doing research in large scale game design, social networking, urban computing, performative technology, and networked objects. You can find info on my thesis here, and a big list of all my ITP-related posts here

I sometimes work at area/code.

Projects that I've been a part of which you might have heard of include Socialbomb, BootyDialer, The Invention of Murder, Rumplestiltskin (An Aretefactual Performance), & Sharkrunners

You can email me at adam @ [the name of this website].

Syndicate