[asterisk-users] Playback/background audio from MySQL BLOB
A J Stiles
asterisk_list at earthshod.co.uk
Wed Sep 24 04:36:07 CDT 2014
On Tuesday 23 Sep 2014, Steve Edwards wrote:
> For some applications, storing recorded audio (prompts and caller
> recordings) as a BLOB in MySQL has advantages.
>
> So, once I have the audio in the database, how can I play it?
>
> Creating temporary files seems so tacky.
>
> Is there another way to playback or background audio either by specifying
> a URL or from a memory buffer (either C or PHP)?
Depending how many messages you have, you could use a named pipe (FIFO) or a
Unix-domain socket for each one; and have the individual backend processes
interrogate the database and dump the contents of the relevant field down it.
As far as Asterisk is concerned, the socket / FIFO looks just like a file; it
doesn't care much that the data in it is really coming from a process on the
other end. This obviously suffers from the problem of decreasing
manageability, the more message "files" you have.
But personally, I'd just store the filenames in the database; and rely on the
unix filesystem for storing the actual file contents. After all, that's what a
filesystem is for.
--
AJS
Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .
More information about the asterisk-users
mailing list