AGI Stream Audio From URI

Home » Uncategorized » AGI Stream Audio From URI
Uncategorized 2 Comments

I suspect you’re encountering behavior that is working as intended.

Normally, when Asterisk plays back a file, it scans the file system for all files with the provided sound file name. For each file that it finds with a given file extension, it picks the best media file (where best is given by transcoding cost) that matches the channel capabilities. That works great when you have a file system that can be scanned quickly.

You can probably guess why that approach isn’t used with a remote HTTP server: making a lot of HEAD/GET requests to ‘scan’ the remote server for available file types is not a good idea for a multitude of reasons.

As such, the remote playback determines the type of file it is playing back from the extension of the resource it downloads from the remote server. If the remote resource doesn’t have an extension, then Asterisk is going to complain that it does not know what type of media it just downloaded.

That is: if your remote resource was named “sounds/prompts/nine.wav” you’d probably be okay.

Now, it would be nice if there was a way for Asterisk to be told to expect the remote resource to be in a particular file format, but to my knowledge, that feature hasn’t been added.

(As an aside, I use this functionality through AGI, so I know it isn’t “completely broken”.)

2 thoughts on - AGI Stream Audio From URI

  • Can you provide a debug level 5 log (including all higher level verbose+ messages) from Asterisk that shows the playback operation?

    Matthew Jordan Digium, Inc. | CTO
    445 Jan Davis Drive NW – Huntsville, AL 35806 – USA
    Check us out at: http://digium.com & http://asterisk.org

  • So, that’s not quite a debug log, but just the console log with Verbose+
    output.

    A debug log will show a lot more information, including what the media cache modules are trying to do when they go to get the file.

    You can find information on getting debug information on the Asterisk here:

    https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

    You may also want to verify that the res_http_media_cache module is loaded. That module is what actually does the work of pulling the remote file down for local playback.