知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
你只能選擇其中一種作為opensips的資料庫
配置資料庫
# vim /etc/opensips/opensipsctlrc DBENGINE=DBTEXT DB_PATH="/etc/opensips/dbtext" ETCDIR="/etc/opensips"
創建資料庫
# opensipsdbctl create INFO: creating DBTEXT tables at: /etc/opensips/dbtext ... Install presence related tables? (y/n): y INFO: creating DBTEXT presence tables at: /etc/opensips/dbtext ... Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist? (y/n): y INFO: creating DBTEXT extra tables at: /etc/opensips/dbtext ...
# vim /etc/opensips/opensipsctlrc
SIP_DOMAIN=opensips.org DBENGINE=MYSQL DBHOST=localhost DBNAME=opensips DBRWUSER=opensips DBRWPW="opensipsrw" USERCOL="username" ETCDIR="/etc/opensips"
創建資料庫
# opensipsdbctl create MySQL password for root: INFO: test server charset WARNING: Your current default mysql characters set cannot be used to create DB. Please choice another one from the following list: big5 dec8 cp850 hp8 koi8r latin1 latin2 swe7 ascii ujis sjis hebrew tis620 euckr koi8u gb2312 greek cp1250 gbk latin5 armscii8 cp866 keybcs2 macce macroman cp852 latin7 cp1251 utf16 cp1256 cp1257 utf32 binary geostd8 cp932 eucjpms Enter character set name: latin1 INFO: creating database opensips ... INFO: Core OpenSIPS tables succesfully created. Install presence related tables? (y/n): y INFO: creating presence tables into opensips ... INFO: Presence tables succesfully created. Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist registrant? (y/n): y INFO: creating extra tables into opensips ... INFO: Extra tables succesfully created.
提示 Enter character set name: 時輸入latin1 其餘選項輸入‘y’
測試創建用戶
# opensipsctl add 1001 123456 new user '1001' added
# vim /etc/opensips/opensipsctlrc
SIP_DOMAIN=opensips.org DBENGINE=PGSQL DBHOST=localhost DBNAME=opensips DBRWUSER=opensips DBRWPW="opensipsrw" USERCOL="username" ETCDIR="/etc/opensips"
# grep -v ^# opensipsctlrc | grep -v ^$ SIP_DOMAIN=opensips.org DBENGINE=DB_BERKELEY DB_PATH="/etc/opensips/bdb" USERCOL="username" ETCDIR="/etc/opensips"
# opensipsdbctl create which: no db4.4_dump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.5_dump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.6_dump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.7_dump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.8_dump in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.4_load in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.5_load in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.6_load in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.7_load in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) which: no db4.8_load in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/sbin//:/usr/sbin//:/usr/sbin/:/usr/local/BerkeleyDB.4.6/bin) INFO: creating Berkeley DB database at: [/etc/opensips/bdb] Install presence related tables? (y/n): y Install tables for imc cpl siptrace domainpolicy carrierroute userblacklist registrant? (y/n): y
opensipsctl start