Language-Independent IVR Proxy (a MUA = Messed-Up Acronym)
by Alex Deva (alxx at indigenious dot ro) - Feb. 2009
Featuring some code written by Jonathan Palley in his Telegraph
Liverpie is a proxy. On one end, it talks to FreeSWITCH; on the other, it talks to your web application by sending HTTP requests to it. The requests contain events coming from FreeSWITCH and the responses from the webapp should contain FreeSWITCH commands, and expected events.
That makes Liverpie language-independent on the application end. That means you can write your IVR application in any language you prefer or even use simple text files. It also means that it lets you access all the features that FreeSWITCH offers via mod_event_socket.
FreeSWITCH is <quote>an open source telephony platform designed to facilitate
the creation of voice and chat driven products scaling from a soft-phone up to
a soft-switch.
It can be used as a simple switching engine, a PBX, a media gateway or a media
server to host IVR applications using simple scripts or XML to control the
callflow.</quote>
FreeSWITCH is here: http://www.freeswitch.org
To create dynamic voice applications with FreeSWITCH, one way is to use its mod_event_socket in outbound or inbound mode. The thing is like AGI + AMI on steroids, for those familiar with Asterisk. It connects to a remote application server via TCP/IP and receives commands there, sending back events. (Like: 'answer the line' and 'done'.)
There have been many attempts to make language-specific libraries, to aid in the purpose of creating voice applications with this method. Most of them are incomplete (in the sense that they do not implement everything that FreeSWITCH offers), and they all offer their particular approach on the architecture of an IVR (Interactive Voice Response system).
Liverpie borrows a lot from Telegraph, so...
OK, here's how.
You no longer have to keep the server that speaks to FreeSWITCH on the same machine as the application itself, like it's the case with Telegraph, RAGI et co., because they talk by HTTP, not by direct function calls (Dispatcher, etc.)
Actually quite little. Liverpie is a server for FreeSWITCH, and a client for as many webapps as you wish. (That makes it a proxy.)
In its first capacity, it can receive events and give commands to FreeSWITCH.
In its second, it forwards the stuff that FreeSWITCH puts out to a webapp, in the form of POST request parameters; it parses the received reply and passes it on to FreeSWITCH.
The replies are in YAML format and they also contain the trigger for the next request (see usage).
The exception to that rule are DTMF events, for which the webapp may return nothing at all.