I had hoped that I would be able to use an SQL view instead of a table to provide e.g. iaxusers
and iaxpeers
to Asterisk via dynamic realtime (ARA).
I have just noticed that iaxpeers
apparently requires several columns for Asterisk to store peer-specific information: ipaddr
, port
, regseconds
. Therefore a simple view won't do.
Is there a way to still get by with a view e.g. for iaxpeers
or do I have to create a table and perhaps sync it with my core data structures (also tables) with triggers instead of a view's (more convenient) SELECT
statement -- push instead of pull, so to speak. (I am using PostgreSQL, whose views are apparently read-only.)
I have concluded that views (instead of tables) are appropriate for some, but not all dynamic ARA families, and that they are not appropriate for
iaxpeers
at least in the case of PostgreSQL. This is because Asterisk requires read-write access e.g. for this family.I have hence switched over from a view to a table. Its rows are now "pushed" from my core data structures (i.e. other tables) by triggers, rather than "pulled" by the view.