[asterisk-users] Record() Cmd and My SQL

David Backeberg dbackeberg at gmail.com
Fri Sep 24 12:55:46 CDT 2010


On Fri, Sep 24, 2010 at 1:32 PM, Don Kelly <dk at donkelly.biz> wrote:
> Don sez: I don't know how to make Outlook indent. I usually top-post, but I
> don't like getting yelled at.
>
> Why do you say "Don't do that"? Is there a real reason that it would be bad?

Performance is a real reason. Multiple simultaneous write streams into
a database sounds like a disaster. While trying to read from the db
and use it to listen to recordings sounds like a bigger disaster.

/path/to/the/recording

is a short varchar string

the actual recording is a massive, usually multi-megabyte, potentially
multi-gigabyte blob.
http://en.wikipedia.org/wiki/Blob_(computing)

If you're not actually taking advantage of the recording being in the
database, doing computing that is easier because of the database, such
as nearest neighbor searches, indexing, and the like, you're just
slowing down your ability to store and retrieve recordings.

> I'd like to put the recordings in a database so they are available to
> another application that has no other relationship to the Asterisk server.

Sounds like a filesystem. I can store my pdf file with my web browser,
and read it on another computer after I store it to my shared
filesystem.

> The application uses the database to determine if the recording has been
> listened to, by whom and if it needs additional attention.

Database can maintain metadata (as can a filesystem, owner, creation
date, access date), but you could still just store a pointer to the
actual file in the db. If you were paranoid about the filesystem and
db getting out of step you could do referential integrity checks in
the application.

If you want to do something wholesale to all the recordings, like
carve off the first five seconds, it's quite straightforward with a
batched sox call against the filesystem. If you want to do that in a
db, it's a select, write output to a file, convert the file, and
replace on the value to store it back into the db.



More information about the asterisk-users mailing list