[asterisk-users] realtime table customization to track iax registrations

Benny Amorsen benny+usenet at amorsen.dk
Tue Feb 19 11:45:29 CST 2008


"Cavalera Claudio Luigi" <Claudio.Cavalera at italtel.it> writes:

> Hello,
> I'm experimenting with Asterisk and MySQL.
> Up to know I've just put iax.conf in a MySQL database and it seems to
> work: when a Iax2 client registers the corrispondent row in db is
> updated. Good.
> However when I have many asterisk boxes pointing to the same db a
> problem arises: I need an additional column in iax_buddies table called
> for example "Asterisk ID" which tells me on which asterisk box a
> particular user is registered.

I have solved this by creating views for each asterisk, like this:
create view customer1_sip as select * from sip where customer = 'customer1';
and so on. This works in MySQL which has updatable views, but not in
PostgreSQL, but you can achieve the same effect with triggers I
believe.

It is not a particularly nice solution because you need to remove and
recreate all views if you add a new column to the table. We're going
back to generating config files from a database though.


/Benny





More information about the asterisk-users mailing list