Openser中文网

专注于VoIP,Opensips,Kamailio等技术,QQ群:QQ群:293697898

kamailio 在debian上安装及安装其GUI,siremis


tags:kamailio siremis debian 安装 创建时间:2016-01-17 18:47:38

debian 8.2 64位虚拟机

特别注意: 每个人在不同的系统,或者相同的系统,不同的时间可能遇到的问题可能不一样,所以这篇文章只能作为参考,而不是绝对成功的教程。

一 、 Kamailio安装

上海老李

1 . 安装必要的安装包

apt-get install git-core
apt-get install gcc
apt-get install flex
apt-get install bison
apt-get install make
apt-get install libmysqlclient-dev
apt-get install libssl-dev

2 . 安装mysql server

apt-get install mysql-server

注:记住mysql server的root密码,当然也可以空密码

3 . 获取源代码

mkdir -p /usr/local/src/kamailio 
cd /usr/local/src/kamailio

Download the sources from GIT using the following commands.

git clone --depth 1 git://git.kamailio.org/kamailio kamailio
cd kamailio


 make include_modules=”db_mysql” cfg

如果要安装到自己预想的安装位置处,则

make PREFIX="/usr/local/kamailio" include_modules="db_mysql" cfg

4 . 编译并安装

make all

make install

如果查看kamailio的目录情况

root@debian440p:/usr/local/src/kamailio/kamailio# kamailio -I

```rst

Print out of kamailio internals

Version: kamailio 4.4.0-dev8 (x86_64/linux) 6f46f8

Default config: /usr/local/etc/kamailio/kamailio.cfg

Default paths to modules: /usr/local/lib64/kamailio/modules

Compile flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES

MAX_RECV_BUFFER_SIZE=262144

MAX_LISTEN=16

MAX_URI_SIZE=1024

BUF_SIZE=65535

DEFAULT PKG_SIZE=8MB

DEFAULT SHM_SIZE=64MB

ADAPTIVE_WAIT_LOOPS=1024

TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select

Source code revision ID: 6f46f8

Compiled with: gcc 4.9.2

Compiled on: 17:58:29 Jan 17 2016

Thank you for flying kamailio!

root@debian440p:/usr/local/src/kamailio/kamailio#

```

kamailio程序的安装路径默认为: /usr/local/sbin

modules路径:

/usr/local/lib/kamailio/modules/
/usr/local/lib64/kamailio/modules/

配置文件路径: /usr/local/etc/kamailio/kamailio.cfg

5 . 配置数据库信息

之前已把include_modules中包含了 db_mysql ,故而以mysql为例配置:

# $Id$
#
# The Kamailio configuration file for the control tools.
#
# Here you can set variables used in the kamctl and kamdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.

## your SIP domain
SIP_DOMAIN=nway.com.cn

## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, DBTEXT, or SQLITE
# by default none is loaded
#
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
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"

## password for database read only user
DBROPW="kamailioro"

## database access host (from where is kamctl used)
# DBACCESSHOST=192.168.0.1

## database super user (for ORACLE this is 'scheme-creator' user)
DBROOTUSER="root"

# user name column
# USERCOL="username"


# SQL definitions
# If you change this definitions here, then you must change them
# in db/schema/entities.xml too.
# FIXME

# FOREVER="2030-05-28 21:32:15"
# DEFAULT_Q="1.0"


# Program to calculate a message-digest fingerprint
# MD5="md5sum"

# awk tool
# AWK="awk"

# gdb tool
# GDB="gdb"

# If you use a system with a grep and egrep that is not 100% gnu grep compatible,
# e.g. solaris, install the gnu grep (ggrep) and specify this below.
#
# grep tool
# GREP="grep"

# egrep tool
# EGREP="egrep"

# sed tool
# SED="sed"

# tail tool
# LAST_LINE="tail -n 1"

# expr tool
# EXPR="expr"


# Describe what additional tables to install. Valid values for the variables
# below are yes/no/ask. With ask (default) it will interactively ask the user
# for an answer, while yes/no allow for automated, unassisted installs.
#

# If to install tables for the modules in the EXTRA_MODULES variable.
# INSTALL_EXTRA_TABLES=ask

# If to install presence related tables.
# INSTALL_PRESENCE_TABLES=ask

# If to install uid modules related tables.
# INSTALL_DBUID_TABLES=ask

# Define what module tables should be installed.
# If you use the postgres database and want to change the installed tables, then you
# must also adjust the STANDARD_TABLES or EXTRA_TABLES variable accordingly in the
# kamdbctl.base script.

# Kamailio standard modules
# STANDARD_MODULES="standard acc lcr domain group permissions registrar usrloc msilo
#                   alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher
#                   dialplan"

# Kamailio extra modules
# EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist htable purple sca"


## type of aliases used: DB - database aliases; UL - usrloc aliases
## - default: none
# ALIASES_TYPE="DB"

## control engine: FIFO or UNIXSOCK
## - default FIFO
# CTLENGINE="FIFO"

## path to FIFO file
# FIFOPATH="/var/run/kamailio/kamailio_fifo"

## check ACL names; default on (1); off (0)
# VERIFY_ACL=1

## ACL names - if VERIFY_ACL is set, only the ACL names from below list
## are accepted
# ACL_GROUPS="local ld int voicemail free-pstn"

## verbose - debug purposes - default '0'
# VERBOSE=1

## do (1) or don't (0) store plaintext passwords
## in the subscriber table - default '1'
# STORE_PLAINTEXT_PW=0

## Kamailio START Options
## PID file path - default is: /var/run/kamailio.pid
# PID_FILE=/var/run/kamailio/kamailio.pid

## Extra start options - default is: not set
# example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=

6 . 创建运行数据库

kamdbctl create

按提示输入mysql root用户密码后,即可创建kamailio运行数据库

7 . 配置 脚本文件kamailio.cfg

#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB

#!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"

8 . 运行kamailio

cp pkg/kamailio/deb/debian/kamailio.init /etc/init.d/kamailio
chmod 755 /etc/init.d/kamailio

cp pkg/kamailio/deb/debian/kamailio.default /etc/default/kamailio


/etc/init.d/kamailio start
/etc/init.d/kamailio stop

在这里如果启动失败,需要从系统日志中查看问题根源,centos下是/var/log/message,debian下是 /var/log/syslog

二 、 Siremis安装

1 . apache2安装

apt-get install apache2
a2enmod rewrite
apt-get install php5 php5-mysql php5-gd php5-curl

2 . 下载安装 Siremis

cd /var/www
wget http://siremis.asipto.com/pub/downloads/siremis/siremis-4.2.0.tgz
tar xvfz siremis-4.2.0.tgz
cd siremis-4.2.0
make prepare
make chown

3 . 数据库中给siremis用户赋权限

GRANT ALL PRIVILEGES ON siremis.* TO siremis@localhost IDENTIFIED BY 'siremisrw';

4 . 生成siremis的apache配置脚本

 make apache-conf

5 . 将生成的siremis脚本添加到/etc/apache2/sites-available/default 中

6 . 重启 apache /etc/init.d/apache2 restart

7 . 访问siremis并最终通过页面完成最后的配置

http://yourserveraddress/siremis/


如果在有疑问或需要沟通的地方,可以QQ:1354608370 或 加FreeSWITCH+Kamailio+Opensips QQ群: 293697898 沟通交流!