System information
same => n,Playback(silence/2&pls-try-call-later)
same => n,Hangup()
Our service_provider might look something like this in sip.conf:
[service_provider]
type=friend
host=switch1.service_provider.net
defaultuser=my_username
fromuser=my_username
secret=welcome
context=incoming
canreinvite=no
disallow=all
allow=ulaw
Now that we’ve implemented a fairly complex feature in the dialplan with the help of
func_odbc to retrieve and store data in a remote relational database, hopefully you’re
starting to get why we think this is so cool. With a handful of self-defined dialplan
functions in the func_odbc.conf file and a couple of tables in a database, we can create
some fairly rich applications!
How many things have you just thought of that you could apply func_odbc to?
Using Realtime
The Asterisk Realtime Architecture (ARA) enables you to store 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, which loads and updates the information as it is re-
quired, is used for things such as SIP/IAX2 user and peer objects and voicemail.
Making changes to static information requires a reload, just as if you had changed a
text file on the system, but dynamic information is polled by Asterisk as needed, so no
reload is required when changes are made to this data. Realtime is configured in the
extconfig.conf file located 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 useful when you want to load from a database the configuration that
you would normally place in the configuration files in /etc/asterisk. The same rules that
apply to flat files on your system still apply when using static realtime. For example,
after making changes to the configuration you must either run the reload command
368 | Chapter 16: Relational Database Integration