[asterisk-users] AGI STREAM FILE not working?

A E [Gmail] all.eforums at gmail.com
Mon Jun 6 01:38:25 CDT 2011


On Mon, Jun 6, 2011 at 2:26 AM, Steve Edwards <asterisk.org at sedwards.com>wrote:

>  On Mon, Jun 6, 2011 at 2:06 AM, Steve Edwards <asterisk.org at sedwards.com>
>> wrote:
>>
>
>  AGI is an interface. It consists of reading the AGI environment from STDIN
>> and then, writing requests on STDOUT and reading the response from STDIN.
>>
>
> On Mon, 6 Jun 2011, A E [Gmail] wrote:
>
>  Right! I did read that, the problem is how do I do this in bash?? I tried
>> read the result in and just post a Noop kind of a thing just to tell that I
>> read something, but it didn't help. I also explicitly did that in the perl
>> script, but doesn't work. It only works in PHP.
>>
>
> Bash would probably be my last choice of language to write an AGI with.
>
> Personally, I use C because it is my sharpest tool and because you can
> execute hundreds of AGIs written in C in the time it takes to load the Perl
> or PHP interpreter and parse your script.
>
> I suspect that the problems you are experiencing with Perl may have
> something to do with flushing STDOUT or reading the complete response from
> STDIN.
>
> I strongly suggest using an existing library for the language of your
> choice.
>
>
> Copy that. Not planning to write an AGI script in bash actually...it will
be written in C# running on a remote system. I was just doing a quick PoC to
figure out how would I use the stream file function to actually read audio
files over the network and even though I used to teach Perl 10+ yrs ago, I
don't do much scripting/coding for a long time, so the brain doesn't think
like a coder anymore. Just needed to try various tricks w.r.t to how can I
dynamically bring over audio files from another server, convert them to the
codec of my channel and then play/store them locally (cache if you will) but
wanted to learn the right way to do it with a local file first before I
tried something fancier. Guess I'll continue playing with the php script
that worked and once I figure the process out, will give it to the C# dev to
implement. Can't believe I wasted more than 2-3 hrs on this :(

BTW, I'd raised that a while ago, and got no conclusive response. How / what
is the best way to stream audio files (not MOH/Internet Radio/TV and what
not) inside a dialplan using AGI without comprising performance/adding
latency too much. no examples of shout/ICE I could find that show how to do
that simply by allowing me to run a web server remotely and use a shoutcast
module to play the audio right into the channel

ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110606/0b8d1b7e/attachment.htm>


More information about the asterisk-users mailing list