<div dir="ltr"><div class="gmail_quote">On Mon, Jun 6, 2011 at 10:10 AM, Steve Edwards <span dir="ltr"><<a href="http://asterisk.org" target="_blank">asterisk.org</a>@<a href="http://sedwards.com" target="_blank">sedwards.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
On Mon, Jun 6, 2011 at 2:26 AM, Steve Edwards <<a href="http://asterisk.org" target="_blank">asterisk.org</a>@<a href="http://sedwards.com" target="_blank">sedwards.com</a>> wrote:<br>
<br></div><div>
I strongly suggest using an existing library for the language of your choice.<br>
</div></blockquote>
<br><div>
On Mon, 6 Jun 2011, A E [Gmail] wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Copy that. Not planning to write an AGI script in bash actually...it will be written in C# running on a remote system.<br>
<br></div><div>
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.<br>
</div></blockquote>
<br>
Well, C# means you're getting your data from a Windows host, so I'd fix that first :)<br>
<br></blockquote><div><font face="'trebuchet ms', sans-serif" color="#000099">now now. It works pretty well actually, can implement extremely complicated logic, multi-threaded, can run as a service, and integrates with the web-app which is all in <a href="http://asp.net" target="_blank">asp.net</a> etc. anyway, moving on </font></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Without knowing all the details, the options I see are:<br>
<br>
) Transfer the file using HTTP, FTP, SCP, etc. You'll have to wait until the entire file is transferred before you can start playing.<br>
<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">) 'Stream' the file using a shared file system like NFS or Samba. If the 'source' and 'target' hosts are on different continents this may not be practical. If they are in the same rack...<br>
<br>
) Stream the file using a custom application. app_playback.c is only about 550 lines (1.8.0) which includes all the standard application 'boilerplate' for help, cli interface, loading, unloading, etc. as well as all of playback's little buddies like SayAlpha, SayDigits, SayNumber, etc. so a custom application cribbed from app_playback.c should only be 100 lines or so.<br>
<br></blockquote><div> </div><div><font class="Apple-style-span" face="'trebuchet ms', sans-serif" color="#000099">Right. Had thought about all of those, but looking for something along the lines of an application that can be invoked from inside the AGI socket connection i.e. picking a file over the network from a fast/lite http server (ala lighthttpd/nginx) and "streaming" it into the channel. So kind of like a 'Playback/Background over the network' kind of an app so one doesn't have to worry about bringing the file over, using NFS/SAMBA fileshares, caching and thus avoiding excessive file i/o. Does the MP3Player application do that? We could do that but ideally I'd like to avoid any transcoding etc. so we can create and save files in a ulaw/g729 etc formats and then just stream them avoiding all latency, file i/o, CPU issues. </font></div>
<div><font class="Apple-style-span" face="'trebuchet ms', sans-serif" color="#000099"><br></font></div><div><font class="Apple-style-span" face="'trebuchet ms', sans-serif" color="#000099">You're right, playback/background could be modified, unfortunately I'm not a C developer, so I might not be able to do it. But if someone knows of something that does the above from inside an AGI connection, that'd be awesome.</font></div>
<div><font class="Apple-style-span" face="'trebuchet ms', sans-serif" color="#000099"><br></font></div><div><font class="Apple-style-span" face="'trebuchet ms', sans-serif" color="#000099">Thanks so much</font></div>
</div></div>