[asterisk-users] AGI STREAM FILE not working?

Steve Edwards asterisk.org at sedwards.com
Mon Jun 6 09:10:43 CDT 2011


> On Mon, Jun 6, 2011 at 2:26 AM, Steve Edwards 
> <asterisk.org at sedwards.com> wrote:
> 
> I strongly suggest using an existing library for the language of your 
> choice.

On Mon, 6 Jun 2011, A E [Gmail] wrote:

> Copy that. Not planning to write an AGI script in bash actually...it 
> will be written in C# running on a remote system.
> 
> 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.

Well, C# means you're getting your data from a Windows host, so I'd fix 
that first :)

Without knowing all the details, the options I see are:

) Transfer the file using HTTP, FTP, SCP, etc. You'll have to wait until 
the entire file is transferred before you can start playing.

) '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...

) 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.

Sometimes you can be a little bit 'sneaky' and hide uncomfortable waits in 
your 'caller experience.'

Many years ago, I built an Asterisk system that needed to authorize a 
credit card transaction before delivering content (aka adult chat). The 
boss was a real picky SOB (we're still good friends) and always complained 
about the smallest interruption in the 'caller experience.'

My solution was a multi-threaded AGI where one thread did the credit card 
thing while another thread played 'please hold while we authorize this 
transaction -- and get ready for a great time.'

By the time the prompt finished, the response was back from the credit 
card processor and the process appeared (to the caller) to be 
instantaneous.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list