专注于VoIP,Opensips,Kamailio等技术,QQ群:QQ群:293697898
一般都是安官网的流程去弄,但很多人说找不到或英文的原因弄不来,所以才整理一下。以下以centos6.x 64为例
1 . 安装步骤
a. epel 源
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
注意:Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again ,需要修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉。即可。
同时,最基本的要求是能解析域名,很多人装了后不配域名解析,就想成功,也是折腾人。
b. 更新
yum update
c. 安装必要包
yum clean all
yum makecache
yum install -y git subversion autoconf automake libtool gcc-c++ ncurses-devel make
yum -y install expat-devel openssl-devel libtiff-devel libX11-devel unixODBC-devel libssl-devel python-devel
yum -y install zlib-devel libzrtpcpp-devel alsa-lib-devel libogg-devel libvorbis-devel perl-libs gdbm-devel
yum -y install libdb-devel uuid-devel @development-tools patch
yum -y install ldns-devel libidn-devel unbound-devel
yum -y install libjpeg-devel
yum -y install pcre-devel bison flex
yum -y install speex-devel
yum -y install gcc gcc-cpp bison flex yacc nasm yasm
yum -y install libxslt
yum -y install mysql-server mysql-devel
yum -y install ncurses-devel
注:如果还有缺,则缺什么补什么,过不去就会有提示的了。
d. 下载源代码
cd /usr/local/src
wget http://opensips.org/pub/opensips/1.11.1/src/opensips-1.11.1_src.tar.gz
tar zxvf opensips-1.11.1_src.tar.gz
cd opensips-1.11.1-tls/
e. 编译源代码
make include_modules="db_mysql" prefix="/usr/local/opensips"
make install
f. vim opensipsctlrc 配置数据库相关信息 如:
## your SIP domain
SIP_DOMAIN=opensips.net.cn
## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"
## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT,
## by default none is loaded
# If you want to setup a database with opensipsdbctl, you must at least specify
# this parameter.
DBENGINE=MYSQL
## database host
DBHOST=localhost
## database name (for ORACLE this is TNS name)
DBNAME=opensips
# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/opensips/dbtext"
## database read/write user
DBRWUSER=opensips
## password for database read/write user
DBRWPW="opensipsrw"
## database super user (for ORACLE this is 'scheme-creator' user)
DBROOTUSER="root"
g. 生成数据库信息 opensipsdbctl create opensips
h. 配置相应的cfg
i. 启动并添加帐号测试
./opensipsctl start
./opensipsctl add 10010 123456