use a macro instead of an inline function, so that backtraces will report the caller...
[asterisk-bristuff.git] / doc / realtime.txt
bloba6ce28f82ece5bcb2d4ad5307119c7c3fce19f96
1 The Asterisk Realtime Architecture
2 ----------------------------------
4 The Asterisk Realtime Architecture is a new set of drivers and 
5 functions implemented in Asterisk.
7 The benefits of this architecture are many, both from a code management
8 standpoint and from an installation perspective. 
10 Additional information on the configuration of Realtime with Asterisk 
11 can be found in doc/extconfig.txt
13 The ARA is designed to be independent of storage. Currently, most
14 drivers are based on SQL, but the architecture should be able to handle
15 other storage methods in the future, like LDAP.
17 The main benefit comes in the database support. In Asterisk v1.0 some 
18 functions supported MySQL database, some PostgreSQL and other ODBC.
19 With the ARA, we have a unified database interface internally in Asterisk,
20 so if one function supports database integration, all databases that has a 
21 realtime driver will be supported in that function.
23 Currently there are three realtime database drivers:
25 * ODBC: Support for UnixODBC, integrated into Asterisk
26   The UnixODBC subsystem supports many different databases,
27   please check www.unixodbc.org for more information.
28 * MySQL: Found in the asterisk-addons subversion repository on svn.digium.com
29 * PostgreSQL: Native support for Postgres, integrated into Asterisk
31 * Two modes: Static and Realtime
32 --------------------------------
33 The ARA realtime mode is used to dynamically load and update objects.
34 This mode is used in the SIP and IAX2 channels, as well as in the voicemail
35 system. For SIP and IAX2 this is similar to the v1.0 MYSQL_FRIENDS 
36 functionality. With the ARA, we now support many more databases for
37 dynamic configuration of phones.
39 The ARA static mode is used to load configuration files. For the Asterisk
40 modules that read configurations, there's no difference between a static
41 file in the file system, like extensions.conf, and a configuration loaded
42 from a database.
44 * Realtime SIP friends
45 ----------------------
46 The SIP realtime objects are users and peers that are loaded in memory 
47 when needed, then deleted. This means that Asterisk currently can't handle
48 voicemail notification and NAT keepalives for these peers. Other than that,
49 most of the functionality works the same way for realtime friends as for
50 the ones in static configuration.
52 With caching, the device stays in memory for a specified time. More 
53 information about this is to be found in the sip.conf sample file.
55 * Realtime H.323 friends
56 ------------------------
57 Like SIP realtime friends, H.323 friends also can be configured using
58 dynamic realtime objects.
60 * New function in the dial plan: The Realtime Switch
61 ----------------------------------------------------
62 The realtime switch is more than a port of functionality in v1.0 to the
63 new architecture, this is a new feature of Asterisk based on the 
64 ARA. The realtime switch lets your Asterisk server do database lookups
65 of extensions in realtime from your dial plan. You can have many Asterisk
66 servers sharing a dynamically updated dial plan in real time with this
67 solution.
69 Note that this switch does _NOT_ support Caller ID matching, only
70 extension name/pattern matching.
72 * So what can you do?
73 ---------------------
74 The realtime Architecture lets you store all of your configuration in
75 databases and reload it whenever you want. You can force a reload over
76 the AMI, Asterisk Manager Interface or by calling Asterisk from a 
77 shell script with 
78         asterisk -rx "reload"
80 You may also dynamically add SIP and IAX devices and extensions 
81 and making them available without a reload, by using the realtime
82 objects and the realtime switch.
85 * Configuration in extconfig.conf
86 ---------------------------------
87 You configure the ARA in extconfig.conf (yes, it's a strange name, but
88 is was defined in the early days of the realtime architecture and kind
89 of stuck). Please see doc/extconfig.txt for database schemas.
91 The part of Asterisk that connects to the ARA use a well defined family
92 name to find the proper database driver. The syntax is easy:
93    <family> => <realtime driver>,<db name>[,<table>]
95 The options following the realtime driver identified depends on the
96 driver.
98 Defined well-known family names are:
100 * sippeers, sipusers    SIP peers and users
101 * iaxpeers, iaxusers    IAX2 peers and users
102 * voicemail             Voicemail accounts 
103 * queues                Queues
104 * queue_members         Queue members
105 * extensions            Realtime extensions (switch)
107 There is documentation of the SQL database in the file
108 doc/extconfig.txt in your Asterisk source code tree.
110 For voicemail storage with the support of ODBC, there is a 
111 doc/odbcstorage.txt documentation file.
114 * Limitations
115 -------------
116 Currently, realtime extensions do not support realtime hints.
119 * FreeTDS supported with connection pooling
120 -------------------------------------------
121 In order to use a FreeTDS-based database with realtime, you need to turn
122 connection pooling on in res_odbc.conf.  This is due to a limitation within
123 the FreeTDS protocol itself.  Please note that this includes databases such
124 as MS SQL Server and Sybase.  This support is new in the current release.