Asterisk Realtime Architecture (ARA) 讓 Asterisk 使用各種外部資料庫 (稱為 engine) 來作設定,包括靜態設定跟 realtime 設定。靜態設定跟使用相關的 *.conf 設定檔一樣,只是設定值從資料庫讀取。realtime 設定是在需要時才去查看。(資料庫更新?)
res_config_*.so
目前支援的外部資料庫有 odbc、sqlite、sqlite3、pgsql、curl、ldap、mysql (),對應的模組是 res_config_*.so。(跟 res_*.so 有關係嗎?)
ARA 的設定檔是 extconfig.conf,extconfig.conf 只有一個區塊,叫做 [settings]。靜態設定的格式是
file.conf => driver,database[,table[,priority]]
對應特定 *.conf 設定檔到指定的資料庫 driver, database and table (or uses the name of the file as the table if not specified)
設定檔 asterisk.conf、extconfig.conf、logger.conf 不能使用 ARA。設定檔 manager.conf、cdr.conf、rtp.conf 則必須在 modules.conf preload 資料庫模組才能使用。
Realtime 設定對應特定 family 設定到指定資料庫 driver, database and table (or uses the name of the family if the table is not specified
已知的 family 有
sippeers, sipregs, sipusers, extensions, ...
ast_config_engine_register()
ast_config_engine_deregister()
- 註冊資料庫引擎,除了名稱外,提供下列功能
- load_func()/unload_func():載入/釋出設定
- realtime_func()
- realtime_multi_func()
- update_func()
- update2_func()
- store_func()
- destroy_func()
- require_func()
ast_check_realtime(family):檢查 family 有沒有對應的 realtime database
ast_load_realtime()/ast_load_realtime_
ast_update_realtime():執行資料庫引擎的 update_func()。
參考來源
- https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
- asterisk 11: main/config.c