?? realtime.tex
字號:
\subsubsection{Introduction}The Asterisk Realtime Architecture is a new set of drivers andfunctions implemented in Asterisk.The benefits of this architecture are many, both from a code managementstandpoint and from an installation perspective.The ARA is designed to be independent of storage. Currently, mostdrivers are based on SQL, but the architecture should be able to handleother storage methods in the future, like LDAP.The main benefit comes in the database support. In Asterisk v1.0 somefunctions supported MySQL database, some PostgreSQL and other ODBC.With the ARA, we have a unified database interface internally in Asterisk,so if one function supports database integration, all databases that has arealtime driver will be supported in that function.Currently there are three realtime database drivers:\begin{itemize} \item ODBC: Support for UnixODBC, integrated into Asterisk The UnixODBC subsystem supports many different databases, please check \url{www.unixodbc.org} for more information. \item MySQL: Found in the asterisk-addons subversion repository on \url{svn.digium.com} \item PostgreSQL: Native support for Postgres, integrated into Asterisk\end{itemize}\subsubsection{Two modes: Static and Realtime}The ARA realtime mode is used to dynamically load and update objects.This mode is used in the SIP and IAX2 channels, as well as in the voicemailsystem. For SIP and IAX2 this is similar to the v1.0 MYSQL\_FRIENDSfunctionality. With the ARA, we now support many more databases fordynamic configuration of phones.The ARA static mode is used to load configuration files. For the Asteriskmodules that read configurations, there's no difference between a staticfile in the file system, like extensions.conf, and a configuration loadedfrom a database.You just have to always make sure the var\_metric values are properly set andordered as you expect in your database server if you're using the static modewith ARA (either sequentially or with the same var\_metric value for everybody).If you have an option that depends on another one in a given configurationfile (i.e, 'musiconhold' depending on 'agent' from agents.conf) but theirvar\_metric are not sequential you'll probably get default values being assigned forthose options instead of the desired ones. You can still use the samevar\_metric for all entries in your DB, just make sure the entriesare recorded in an order that does not break the option dependency.That doesn't happen when you use a static file in the file system. Althoughthis might be interpreted as a bug or limitation, it is not.\subsubsection{Realtime SIP friends}The SIP realtime objects are users and peers that are loaded in memorywhen needed, then deleted. This means that Asterisk currently can't handlevoicemail notification and NAT keepalives for these peers. Other than that,most of the functionality works the same way for realtime friends as forthe ones in static configuration.With caching, the device stays in memory for a specified time. Moreinformation about this is to be found in the sip.conf sample file.If you specify a separate family called "sipregs" SIP registrationdata will be stored in that table and not in the "sippeers" table.\subsubsection{Realtime H.323 friends}Like SIP realtime friends, H.323 friends also can be configured usingdynamic realtime objects.\subsubsection{New function in the dial plan: The Realtime Switch}The realtime switch is more than a port of functionality in v1.0 to thenew architecture, this is a new feature of Asterisk based on theARA. The realtime switch lets your Asterisk server do database lookupsof extensions in realtime from your dial plan. You can have many Asteriskservers sharing a dynamically updated dial plan in real time with thissolution.Note that this switch does NOT support Caller ID matching, onlyextension name or pattern matching.\subsubsection{Capabilities}The realtime Architecture lets you store all of your configuration indatabases and reload it whenever you want. You can force a reload overthe AMI, Asterisk Manager Interface or by calling Asterisk from ashell script with asterisk -rx "reload"You may also dynamically add SIP and IAX devices and extensionsand making them available without a reload, by using the realtimeobjects and the realtime switch.\subsubsection{Configuration in extconfig.conf}You configure the ARA in extconfig.conf (yes, it's a strange name, butis was defined in the early days of the realtime architecture and kindof stuck).The part of Asterisk that connects to the ARA use a well defined familyname to find the proper database driver. The syntax is easy:\begin{verbatim} <family> => <realtime driver>,<db name>[,<table>]\end{verbatim}The options following the realtime driver identified depends on thedriver.Defined well-known family names are:\begin{itemize} \item sippeers, sipusers - SIP peers and users \item iaxpeers, iaxusers - IAX2 peers and users \item voicemail - Voicemail accounts \item queues - Queues \item queue\_members - Queue members \item extensions - Realtime extensions (switch)\end{itemize}Voicemail storage with the support of ODBC described in file\path{docs/odbcstorage.tex} (\ref{odbcstorage}).\subsubsection{Limitations}Currently, realtime extensions do not support realtime hints. There isa workaround available by using func\_odbc. See the sample func\_odbc.conffor more information.\subsubsection{FreeTDS supported with connection pooling}In order to use a FreeTDS-based database with realtime, you need to turnconnection pooling on in res\_odbc.conf. This is due to a limitation withinthe FreeTDS protocol itself. Please note that this includes databases suchas MS SQL Server and Sybase. This support is new in the current release.
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -