[asterisk-users] Retrieving sound files from DB as opposed to filesystem

A E [Gmail] all.eforums at gmail.com
Tue May 3 06:26:25 CDT 2011


On Tue, May 3, 2011 at 5:19 AM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>wrote:

> On Tue, May 03, 2011 at 01:09:14AM -0400, A E [Gmail] wrote:
> > On Mon, May 2, 2011 at 9:45 PM, C F <shmaltz at gmail.com> wrote:
> >
> > > Just from my experience with different DBs, stay away from BLOB data
> > > types as much as possible.
> > >
> > > Hi CF,
> > any particular reason why? I've had a good experience with it, in fact
> > that's recommended by DB developers when it's a case of small files. They
> > say only larger files greater than 500K-1MB should be stored on the
> > filesystem using filestream or similar etc.
> >
> > Although at this point, this might be a moot point, as so far no one's
> been
> > able to suggest a way to be able to stream the content of the BLOB field
> to
> > Asterisk over the AGI connection into the current channel, such that
> > Asterisk can just play it on the fly. We'll have to just go with getting
> the
> > file to the requesting * server and then play it
>
> Short answer: Asterisk has support for playing local files. As for
> performance: The file system already caches reading the file once it has
> been read once, so you're likely to read it from memory. Especialy small
> files and frequently-used files. If you want to play sounds from a DB,
> you'll need to provide some infrastructure.
>
> The sound file to be played is a file that should be read and consumed
> (played by Asterisk into a channel) in a steady manner. You can't afford
> any delays. That's not a typical constraint with e.g. web content
> serving where you can easily wait a while to cache content.
>
>
Thanks Tzafrir,
yes, after having noodled with this for a while, it appears that the best
way would be to somehow replicate what the Realtime Voicemail does but just
not bother storing the media files in the DB. Extracting the BLOB data,
storing it as a temp file and playing it Voicemail used to work fairly well
with no perceivable latency, so I'm hoping not having to pick up the file
from the DB but directly from the filesystem and copying it over to the {*}
machine should be slightly faster. I doubt though, anything useful will be
in the cache as we don't expect the same files to be accessed too often but
then again, you never know. BTW, does that happen by default or do I need to
set this up via memcached and stuff like that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110503/274f87f6/attachment.htm>


More information about the asterisk-users mailing list