Cavalera Claudio Luigi
2008-Feb-18 15:53 UTC
[asterisk-users] realtime table customization to track iax registrations
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. Is there a way to achieve this? I've seen this function: ASB*CLI> -= Info about function 'REALTIME' =- [Syntax] REALTIME(family|fieldmatch[|value[|delim1[|delim2]]]) on read REALTIME(family|fieldmatch|value|field) on write [Synopsis] RealTime Read/Write Functions [...] but I don't think I can use this during client registration as it will only be available in dialplan. Any hints appreciated. Regards, Claudio Internet Email Confidentiality Footer ----------------------------------------------------------------------------------------------------- La presente comunicazione, con le informazioni in essa contenute e ogni documento o file allegato, e' rivolta unicamente alla/e persona/e cui e' indirizzata ed alle altre da questa autorizzata/e a riceverla. Se non siete i destinatari/autorizzati siete avvisati che qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto di tali informazioni e' vietata e potrebbe essere contro la legge (art. 616 C.P., D.Lgs n. 196/2003 Codice in materia di protezione dei dati personali). Se avete ricevuto questa comunicazione per errore, vi preghiamo di darne immediata notizia al mittente e di distruggere il messaggio originale e ogni file allegato senza farne copia alcuna o riprodurne in alcun modo il contenuto. This e-mail and its attachments are intended for the addressee(s) only and are confidential and/or may contain legally privileged information. If you have received this message by mistake or are not one of the addressees above, you may take no action based on it, and you may not copy or show it to anyone; please reply to this e-mail and point out the error which has occurred. -----------------------------------------------------------------------------------------------------
Benny Amorsen
2008-Feb-19 17:45 UTC
[asterisk-users] realtime table customization to track iax registrations
"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