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

Leo Burd leob at media.mit.edu
Wed Feb 10 12:47:24 CST 2010


Hello Ben, thanks for your message!

I'm implementing a framework to integrate Asterisk and Drupal (a 
powerful tool for the creation of social- and media-rich websites).  
Since the voip and the web components of the system are likely to run on 
separate servers owned by different organizations, I don't think I could 
rely on a shared filesystem solution.

Currently, I save Asterisk audio files on the Asterisk server, convert 
them to MP3, upload them to the Drupal server, and display them on the 
website.  This process takes time and ends up duplicating a lot of 
content.  That's why I was exploring ways of doing all the audio 
processing on the Drupal server with FastAGI and EAGI.  Is there any 
easy way for Asterisk to  play  audio files located in remote servers?

Another alternative would be to get Drupal to play  audio files directly 
from the Asterisk server.  Would you have any suggestions for that?

Thanks once again for all your support!

Leo

 

Ben Dinnerville wrote:

> There is the EAGI protocol that will allow this but the easiest way I 
> find to do this sort of thing is to have a shared file system between 
> the app / web server and the asterisk server(s). We run a clustered 
> setup with 12 asterisk systems and a clustered jboss environment with a 
> NFS mount shared between all the systems. For applications such as call 
> recording asterisk does the monitor into the NSF mounted share / 
> directory which is also visible on the jboss servers (mainly for 
> permission checks / security etc) and the web server (for download etc). 
> As long as you have a scheme that ensures you do not have duplicate file 
> names (which can be controlled by a central database and via your php 
> script) then you will not have any issues. There are a number of other 
> file system alternatives out there that will achieve the same thing but 
> NFS seems to be proven and stable and we have not any issues with it to 
> date. Your php script can then be a simple AGI / FastAGI that simply 
> executes a Playback(path/to/nfs/directory/file) - you can also 
> incorporate things like checking if the file exists in your PHP script 
> and implementing access restrictions etc.
>
> We also share our sounds directory between systems this way so that all 
> our sounds only have to reside in one place but are visible across all 
> the systems.
>
> Cheers,
>
> Ben
>
>
>   
>> Leo Burd wrote:
>>     
>>> Hello there,
>>>
>>> I'm trying to figure out how to run a PHP script on a remote machine and 
>>> still have access to the audio stream associated with the call. 
>>>
>>> Ideally, I'd love to play/record audio files directly from/to the remote 
>>> server without having to copy them back and forth to the Asterisk 
>>> server.  What is the best way to do this?
>>>
>>> Is it possible to combine EAGI with FastAGI in PHP?
>>>
>>> Thanks in advance,
>>>
>>> Leo
>>>
>>>
>>>       
>>
>>
>>     




More information about the asterisk-users mailing list