Asterisk实时数据库

问题描述 投票:0回答:2

sip.conf
中的注册语句允许您的Asterisk服务器向提供商注册。

是否可以将这个注册语句放入实时数据库并实时更新?

asterisk
2个回答
2
投票

我建议您阅读专门用于此目的的 extconfig.conf 文件:

;
; Static and realtime external configuration
; engine configuration
;
; See https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration
; for basic table formatting information.
;
[settings]
;
; Static configuration files:
;
; file.conf => driver,database[,table[,priority]]
;
; maps a particular configuration file to the given
; database driver, database and table (or uses the
; name of the file as the table if not specified)
;
;uncomment to load queues.conf via the odbc engine.
;
;queues.conf => odbc,asterisk,ast_config
;extensions.conf => sqlite,asterisk,ast_config

2
投票

我建议您遵循所有步骤。

1)最后写下下面的代码,或者你可以将值放在文件/etc/asterisk/res_config_mysql.conf中的[general]部分

 [general]
 dbhost = 127.0.0.1 
 dbname = [dbname]
 dbuser = root 
 dbpass = [dbpass]
 dbport = 3306

2) 在 /etc/asterisk/extconfig.conf 中写入以下代码

iaxusers => mysql,general,cc_iax_buddies 
iaxpeers => mysql,general,cc_iax_buddies
sipusers => mysql,general,cc_sip_buddies
sippeers => mysql,general,cc_sip_buddies

3)检查mysql状态

    cli> realtime mysql status

4)如果未添加模块,则从源文件中添加,如下所示

cd /root/download/asterisk/asterisk-1.8.1.12.1 (Path of asterisk source)
make menuselect
*app-mysql
*res_config_mysql.conf
exit(esc)
make
make install

5) /etc/asterisk/sip.conf 取消注释 rtcachefriends=yes,如下所示

rtcachefriends=yes
;rtsavesysname=yes
rtupdate=yes
rtautoclear=yes
© www.soinside.com 2019 - 2024. All rights reserved.