Steve Edwards
2014-Sep-23 19:17 UTC
[asterisk-users] Playback/background audio from MySQL BLOB
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)? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
Jeff LaCoursiere
2014-Sep-23 19:33 UTC
[asterisk-users] Playback/background audio from MySQL BLOB
On 09/23/2014 02:17 PM, 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)? >How about a named pipe (fifo)? Of course then you might have issues with simultaneous calls. You would have to have a pool of them and somehow manage locking them... j
A J Stiles
2014-Sep-24 09:36 UTC
[asterisk-users] Playback/background audio from MySQL BLOB
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 .