Page 296 - Asterisk™: The Future of Telephony
P. 296
Pooled: no
Connected: yes
Using Realtime
The Asterisk Realtime Architecture (ARA) is a method of storing the configuration files
(that would normally be found in /etc/asterisk) and their configuration options in a
database table. There are two types of realtime; static and dynamic. The static version
is similar to the traditional method of reading a configuration file, except that the data
is read from the database instead. The dynamic realtime method is used for things such
as user and peer objects (SIP, IAX2), and voicemail which loads and updates the in-
formation as it is required. Changes to static information requires a reload just as if you
had changed the text file on the system, but dynamic information is polled by Asterisk
as needed and requires no reload. Realtime is configured in the extconfig.conf file lo-
cated in the /etc/asterisk directory. This file tells Asterisk what to load from the database
and where to load it from, allowing certain files to be loaded from the database and
other files to be loaded from the standard configuration files.
Static Realtime
Static realtime is used when you want to store the configuration that you would nor-
mally place in the configuration files in /etc/asterisk but want to load from a database.
The same rules that apply to flat files on your system still apply when using static
realtime, such as requiring you to either run the reload command from the Asterisk
CLI, or to reload the module associated with the configuration file (i.e., module reload
chan_sip.so).
Using the preload Directive
Most files are able to be loaded via static realtime, but a few files are not able to be
loaded using this method. These include asterisk.conf, extconfig.conf, and logger.conf.
Additionally, the files manager.conf, cdr.conf, and rtp.conf cannot be loaded from static
realtime unless the storage drivers are loaded before the main Asterisk core initializes
(this is because the configuration files need to be loaded by realtime before the module
goes to read its configuration). Since we are using ODBC in this chapter, we would
need to add the following lines to modules.conf:
; /etc/asterisk/modules.conf
preload => res_odbc.so
preload => res_config_odbc.so
268 | Chapter 12: Relational Database Integration