While Adhearsion is written in
Ruby, every effort had been made to make it accessible from virtually any modern development language. The
RPC subsystem in Adhearsion makes available several methods for accessing the APIs. Out of the box the RPC methods include
Distributed Ruby,
STOMP and
REST. While we have not included
SOAP/
XML by default, the framework may be easily extended to make this method available as well.
There are many websites and applications written in
PHP. The great thing is that all of those applications may take advantage of what Adhearsion has to offer. In this example we show how to invoke the Adhearsion REST API from a PHP script that could be embedded in virtually any application.
In this case a phone call will be placed between two parties, extension 303 and 304, using the
Asterisk originate action. For example, this could be used to build a '
click to call' frame in an existing website. The PHP script creates an Adhearsion class to connect to Adhearsion and then invokes the originate as an
HTTP POST with
JSON (script available
here):
Read the rest of this post »