[asterisk-users] IVR and MySQL

James FitzGibbon james.fitzgibbon at gmail.com
Tue Aug 14 07:45:35 CDT 2007


On 8/14/07, Atis <atis at best.eu.org> wrote:
>
> That's possible, but i wouldn't recommend on large production system.
> Using MySQL you would need to connect and disconnect all the time, and
> it takes resources.. I would suggest to append that info to CDR
> userfield (if you are storing your CDR in MySQL), and run periodically
> some script that extracts them. Of course it's more complex, but that
> would be my way.


If the data you wish to store is more complex than stuffing in the CDR
userfield would allow, you can always call out to an AGI which can write the
data to whatever file format you want for later loading into a database.

If you used FastAGI and a pre-forking AGI server model, you could even take
the database connection hit when the AGI server starts.  The per-call cost
would then be the cost to establish the socket connection to the AGI server
from Asterisk, the cost to perform the SQL inserts over an established
database connection, plus whatever other calculation or transformation you
needed to do before doing the insert.

That architecture would hold up under a fairly large load.  Perl's
Asterisk::FastAGI framework lets you specify the number of pre-forked
children to launch, plus you can tell each child to exit (spawning a
replacement for the pool) after processing a certain number of
transactions.  It's very similar to the Apache prefork model.

-- 
j.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070814/5bce4d49/attachment.htm 


More information about the asterisk-users mailing list