Kamailio安装指南
2015-11-25 22:43
417 查看
Kamailio(前身为OpenSER)是一个开源的SIP服务器项目,基于GPL授权。它以处理性能见长,每秒钟能处理上千个并发呼叫。其官方主页为http://www.kamailio.org。本文描述Kamailio的安装配置过程。安装环境为CentOS6.0。
1.编译安装
下载源码
用自己熟悉的编辑工具打开"modules.lst"文件,找到"exclude_modules"变量,删除db_mysql字段(这里可以根据自己的需要调整编译的模块)。然后编译:
缺省情况下,Kamailio的可执行文件安装在"/usr/local/sbin"路径下,配置文件安装在"/usr/local/etc/kamailio"路径下。
几个可执行文件功能如下:
kamailio-Kamailio服务器的执行文件
kamdbctl-创建和管理数据库的脚本
kamctl-管理和控制Kamailio服务器的脚本
sercmd-CLI,一个命令行工具,访问提供Kamailio服务器的接口
2.配置
配置环境变量:
Kamailio的环境变量存储在/usr/local/etc/kamailio/kamctlrc文件中,安装时,就已经安装好模板文件了,只需要编辑一些简单的配置项即可。
打开/usr/local/etc/kamailio/kamailio.cfg,添加下面几行(应该添加在"#######DefinedValues#########"这一行之前):
执行下面命令创建DB:
3.启动Kamailio服务
4.监视Kamailio
5.添加用户帐号
其中第一个1000为username;第二个1000为password,添加完毕后,配置你的SIP终端注册上来看看,祝你好运。
1.编译安装
下载源码
#cd~ #wget #tarzxvfkamailio-3.3.2_src.tar.gz #cdkamailio-3.3.2 #makeFLAVOUR=kamailiocfg |
#makeall #makeinstall |
几个可执行文件功能如下:
kamailio-Kamailio服务器的执行文件
kamdbctl-创建和管理数据库的脚本
kamctl-管理和控制Kamailio服务器的脚本
sercmd-CLI,一个命令行工具,访问提供Kamailio服务器的接口
2.配置
配置环境变量:
Kamailio的环境变量存储在/usr/local/etc/kamailio/kamctlrc文件中,安装时,就已经安装好模板文件了,只需要编辑一些简单的配置项即可。
#cat/usr/local/etc/kamailio/kamctlrc #$Id$ # #TheKamailioconfigurationfileforthecontroltools. # #Hereyoucansetvariablesusedinthekamctlandkamdbctlsetup #scripts.Perdefaultallvariablesherearecommentedout,thecontroltools #willusetheirinternaldefaultvalues. ##yourSIPdomain SIP_DOMAIN=kamailio.org ##chrooteddirectory #$CHROOT_DIR="/path/to/chrooted/directory" ##databasetype:MYSQL,PGSQL,ORACLE,DB_BERKELEY,orDBTEXT,bydefaultnoneisloaded #Ifyouwanttosetupadatabasewithkamdbctl,youmustatleastspecify #thisparameter. DBENGINE=MYSQL ##databasehost DBHOST=localhost ##databasename(forORACLEthisisTNSname) DBNAME=openser #databasepathusedbydbtextordb_berkeley #DB_PATH="/usr/local/etc/kamailio/dbtext" ##databaseread/writeuser DBRWUSER=openser ##passwordfordatabaseread/writeuser DBRWPW="openserrw" ##databasereadonlyuser #DBROUSER=openserro DBROUSER=openserro ##passwordfordatabasereadonlyuser DBROPW=openserro ##databasesuperuser(forORACLEthisis'scheme-creator'user) DBROOTUSER="root" #usernamecolumn USERCOL="username" #SQLdefinitions #Ifyouchangethisdefinitionshere,thenyoumustchangethem #indb/schema/entities.xmltoo. #FIXME #FOREVER="2020-05-2821:32:15" #DEFAULT_ALIASES_EXPIRES=$FOREVER #DEFAULT_Q="1.0" #DEFAULT_CALLID="Default-Call-ID" #DEFAULT_CSEQ="13" #DEFAULT_LOCATION_EXPIRES=$FOREVER #Programtocalculateamessage-digestfingerprint #MD5="md5sum" #awktool #AWK="awk" #Ifyouuseasystemwithagrepandegrepthatisnot100%gnugrepcompatible, #e.g.solaris,installthegnugrep(ggrep)andspecifythisbelow. # #greptool #GREP="grep" #egreptool #EGREP="egrep" #sedtool #SED="sed" #tailtool #LAST_LINE="tail-n1" #exprtool #EXPR="expr" #Describewhatadditionaltablestoinstall.Validvaluesforthevariables #belowareyes/no/ask.Withask(default)itwillinteractivelyasktheuser #forananswer,whileyes/noallowforautomated,unassistedinstalls. # #IftoinstalltablesforthemodulesintheEXTRA_MODULESvariable. #INSTALL_EXTRA_TABLES=ask #Iftoinstallpresencerelatedtables. #INSTALL_PRESENCE_TABLES=ask #Definewhatmoduletablesshouldbeinstalled. #Ifyouusethepostgresdatabaseandwanttochangetheinstalledtables,thenyou #mustalsoadjusttheSTANDARD_TABLESorEXTRA_TABLESvariableaccordinglyinthe #kamdbctl.basescript. #Kamailiostandardmodules #STANDARD_MODULES="standardacclcrdomaingrouppermissionsregistrarusrlocmsilo #alias_dburi_dbspeeddialavpopsauth_dbpdtdialogdispatcher #dialplan" #Kamailioextramodules #EXTRA_MODULES="imccplsiptracedomainpolicycarrierrouteuserblacklisthtablepurple" ##typeofaliasesused:DB-databasealiases;UL-usrlocaliases ##-default:none #ALIASES_TYPE="DB" ##controlengine:FIFOorUNIXSOCK ##-defaultFIFO #CTLENGINE="FIFO" ##pathtoFIFOfile #OSER_FIFO="FIFO" ##checkACLnames;defaulton(1);off(0) #VERIFY_ACL=1 ##ACLnames-ifVERIFY_ACLisset,onlytheACLnamesfrombelowlist ##areaccepted #ACL_GROUPS="localldintvoicemailfree-pstn" ##verbose-debugpurposes-default'0' VERBOSE=1 ##do(1)ordon't(0)storeplaintextpasswords ##inthesubscribertable-default'1' #STORE_PLAINTEXT_PW=0 ##OPENSERSTARTOptions ##PIDfilepath-defaultis:/var/run/kamailio.pid #PID_FILE=/var/run/kamailio.pid PID_FILE=/var/run/kamailio.pid ##Extrastartoptions-defaultis:notset #example:startKamailiowith64MBsharememory:STARTOPTIONS="-m64" #STARTOPTIONS= |
...... #!defineWITH_MYSQL #!defineWITH_AUTH #!defineWITH_USRLOCDB #!defineWITH_NAT ...... |
执行下面命令创建DB:
#/usr/local/sbin/kamdbctlcreate |
#/usr/local/sbin/kamctlstart |
#/usr/local/sbin/kamctlmoni |
#kamctladd10001000 |
相关文章推荐
- Kamailio 的 SIP服务器使用经验
- (转载)高速ADC的关键指标:量化误差、offset/gain error、DNL、INL、ENOB、分辨率、RMS、SFDR、THD、SINAD、dBFS、TWO-TONE IMD
- Daily Scrum - 11/25
- Chroot相关
- ST3插件——PlainTasks的使用
- Contains Duplicate in c
- yum报错: Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
- LeetCode Contains Duplicate II
- AIDL 写法
- main函数的参数传递
- 载入OpenSSL的动态库——学会使用tryToLoadOpenSslWin32Library和QPair
- SharePoint 2013 Error - File names can't contain the following characters: & " ? < > # {} % ~ / \.
- Handler一定要在主线程实例化吗?new Handler()和new Handler(Looper.getMainLooper())的区别
- mybaits 多个参数传入用#{0,1,....}或者@Param注释
- 获取子进程终止状态:wait和waitpid
- ATL创建COM组件时找不到dllmain入口函数
- 深度分析WM_PAINT和WM_ERASEBKGND消息
- Lock&Condition实现线程同步通信
- codeforces-242A-Heads or Tails【暴力】
- ORA-01994: GRANT failed: password file missing or disabled