Kamailio是一个开源的SIP服务器,原名OpenSER
Ubuntu版本是:10.04.4
【 编译前准备】
编译前,需要安装下面的软件
sudo apt-get install gcc
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install libmysqlclient15-dev
sudo apt-get install make
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libxml2-dev
sudo apt-get install libpcre3-dev
【下载】
1,下载地址:http://www.kamailio.org/pub/kamailio/latest/src/
2,下载的压缩包:kamailio-4.3.1_src.tar.gz
【编译】
1,解压缩 tar -zxvf kamailio-4.1.0_src.tar.gz
2,make all
【安装与配置】
1,make install
2,配置/usr/local/etc/kamailio/kamailio.cfg,这个配置文件好像不需要配置
3,配置 /usr/local/etc/kamailio/kamctlrc
SIP_DOMAIN= x.x.x.x DBENGINE=MYSQL ## database host DBHOST=localhost ## database name (for Oracle this is TNS name) DBNAME=kamailio # database path used by dbtext, db_berkeley or sqlite # DB_PATH="/usr/local/etc/kamailio/dbtext" ## database read/write user DBRWUSER="kamailio" ## password for database read/write user DBRWPW="kamailiorw" ## database read only user DBROUSER="kamailioro"
【安装 mysql server】
【建立数据库】
/usr/local/sbin/kamdbctl create
【增加用户】
kamctl add 1 1
【安装rtpproxy】
apt-get install rtpproxy
【配置rtpproxy】
vim /etc/default/rtpproxy, 内容改成如下:
# Defaults for rtpproxy # The control socket. #CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock" # To listen on an UDP socket, uncomment this line: CONTROL_SOCK=udp:127.0.0.1:7722 # Additional options that are passed to the daemon. EXTRA_OPTS="" LISTEN_ADDR=x.x.x.x #公网IP EXTRA_OPTS="-l ${LISTEN_ADDR}"
【重启rtpproxy】
/etc/init.d/rtpproxy restart
【启动服务】
./kamctl start