[asterisk-users] How to run a remote PHP script and still have access to audio stream?

David Backeberg dbackeberg at gmail.com
Fri Feb 19 19:38:56 CST 2010


On Wed, Feb 10, 2010 at 2:13 PM, Leo Burd <leob at media.mit.edu> wrote:
> How much control do the ssh processes have over the call, if any?

It occurred to me that I might be answering this backwards.

So from the perspective of server A, trying to talk to a remote system
B running asterisk, server A can invoke:

asterisk -rx "do something on the asterisk cli"

and it will be done to asterisk on that system. So for example,
I have built a nifty web gui that displays current call status in the
system, along with a bunch of buttons.

Among those buttons, is one that will hangup a call, on an appropriate
channel, as corresponds to the database state I've been maintaining.
And this does happen to have been done in PHP.

And to do this hangup, I actually do NOT run ssh with keys, but rather
I use asterisk manager. And send I use a nice PHP Asterisk manager
library that somebody else wrote to manage the connection, then I send
the Hangup() command on the appropriate channel, and the PHP Asterisk
manager takes care of the dirty work of closing and cleaning up the
connection.

I chose to use PHP and asterisk manager, but I could have done the
same thing with ssh keys and asterisk -rx '' approach.

Hopefully that helps.



More information about the asterisk-users mailing list