http://www.kamailio.org/wiki/cookbooks/4.1.x/core

IMS 支持接口

MSC接口,信令:ISUP over IP和SIP, 用户面: rtp协议

PCRF接口,Rx接口

HSS接口, Cx接口

Kamailio 和 openIMS,  Kamailio本身就是一个SIP AS(Application server), 而且可以通过加载模块的方式在支持不同的接口,而且目前已经支持Rx Cx接口



Kamailio v4.1
=============

http://www.kamailio.org

kamailio install

SIP SERVER

INSTALL   INSTALL2

opensis

ngrep

less than one hour



撒花。继续加载模块。

nothing is unreachable.

notes:

1.  mkdir -p /usr/local/src/kamailio-devel
cd /usr/local/src/kamailio-devel
 make cfg
  nano -w modules.lst
 include_modules= db_mysql 
 make include_modules="db_mysql dialplan" cfg //to enable modules which are not compiled by default, 

2.
make all
make install

The binaries and executable scripts were installed in:

  /usr/local/sbin
  • kamailio - Kamailio SIP server
  • kamdbctl - script to create and manage the Databases
  • kamctl - script to manage and control Kamailio SIP server
  • sercmd - CLI - command line tool to interface with Kamailio SIP server
  PATH=$PATH:/usr/local/sbin
export PATH

Kamailio (OpenSER) modules are installed in:

  /usr/local/lib/kamailio/modules/

The documentation and readme files are installed in:

  /usr/local/share/doc/kamailio/

The man pages are installed in:

  /usr/local/share/man/man5/
/usr/local/share/man/man8/

The configuration file was installed in:

  /usr/local/etc/kamailio/kamailio.cfg


3. database

 试试:service mysqld start 

mysql -u root

mysqladmin -u root password vankom

To create the MySQL database, you have to use the database setup script. First edit kamctlrc file to set the database server type:

  nano -w /usr/local/etc/kamailio/kamctlrc

Locate DBENGINE variable and set it to MYSQL:

DBENGINE=MYSQL

You can change other values in kamctlrc file, at least it is recommended to change the default passwords for the users to be created to connect to database.

Once you are done updating kamctlrc file, run the script to create the database used by Kamailio:

  /usr/local/sbin/kamdbctl create

You can call this script without any parameter to get some help for the usage. You will be asked for the domain name Kamailio is going to serve (e.g., mysipserver.com) and the password of the 'root' MySQL user. The script will create a database named 'kamailio' containing the tables required by Kamailio. You can change the default settings in the kamctlrc file mentioned above.

The script will add two users in MySQL:

kamailio - (with default password 'kamailiorw') - user which has full access rights to 'kamailio' database

kamailioro - (with default password 'kamailioro') - user which has read-only access rights to 'kamailio' database

Do change the passwords for these two users to something different that the default values that come with sources.

4. Edit configuration file

To fit your requirements for the VoIP platform, you have to edit the configuration file.

  /usr/local/etc/kamailio/kamailio.cfg

Follow the instruction in the comments to enable usage of MySQL. Basically you have to add several lines at the top of config file, like:

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

If you changed the password for the 'kamailio' user of MySQL, you have to update the value for 'db_url' parameters.

You can browse kamailio.cfg online on GIT repository.

5. The init.d script

The init.d script can be used to start/stop the Kamailio server in a nicer way. A sample of init.d script for Kamailio is provided at:

/usr/local/src/kamailio-devel/kamailio/pkg/kamailio/deb/debian/kamailio.init

Just copy the init file into the /etc/init.d/kamailio. Then change the permisions:

  chmod 755 /etc/init.d/kamailio 

then edit the file updating the $DAEMON and $CFGFILE values:

  DAEMON=/usr/local/sbin/kamailio
CFGFILE=/usr/local/etc/kamailio/kamailio.cfg

You need also setup a configuration file in the /etc/default/ directory. This file can be found at:

  /usr/local/src/kamailio-devel/pkg/kamailio/debian/kamailio.default

You need to rename the file to 'kamailio' after you've copied it. Then edit this file and set RUN_KAMAILIO=yes. Edit the other options at your convenience.

Create the directory for pid file:

mkdir -p /var/run/kamailio

Default setting is to run Kamailio as user “kamailio” and group “kamailio”. For that you need to create the user:

adduser --quiet --system --group --disabled-password \
--shell /bin/false --gecos "Kamailio" \
--home /var/run/kamailio kamailio # set ownership to /var/run/kamailio
chown kamailio:kamailio /var/run/kamailio

Then you can start/stop Kamailio using the following commands:

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

6. Ready to rock

Now everything is in place. You can start the VoIP service, creating new accounts and setting the phones.

A new account can be added using 'kamctl' tool via 'kamctl add <username> <password> <email>'. (or try without the email)

kamctl add test testpasswd test@mysipserver.com

If you are asked for SIP_DOMAIN environment variable do one of the following option.

  1.
export SIP_DOMAIN=mysipserver.com 2.
edit '/root/.kamctlrc' and add:
SIP_DOMAIN=mysipserver.com

7. Maintenance

The maintenance process is very simple right now. You have to be user 'root' and execute following commands:

  cd /usr/local/src/kamailio-devel/kamailio
git pull origin
make all
make install
/etc/init.d/kamailio restart

Now you have the latest Kamailio devel running on your system.

8. Time for maintenance service

Notification about GIT commits are sent to the mailing list: sr-dev@lists.sip-router.org. Each commit notification contains the reference to the branch where the commit has been done. If the commit message contains the lines:

Module: sip-router
Branch: master

then an update has been made to Kamailio devel version and it will be available to the public GIT in no time.


OpenSUR




5.31 i am back!

Kamailio Modules
----------------
acc Accounting
acc_radius Accounting with RADIUS backend
alias_db Alias management in database modules
 
async Asynchronus SIP request handling functions
 
acp Collection of functions for handling AVP's (from SER)
avpops Attribute-value pair operations ("variables")
benchmark Development benchmark module
blst Blacklisting API for configuration scripts
call_control Call timeouts and management (depends on Dialog module)
carrierroute A telephony routing module
cdp C Diameter Peer - core communication engine
cdp_avp C Diameter Peer - application extensions
cfg_db Database driver for configuration API
cfg_rpc Update core and module parameters from RPC
cfgutils Various configuration utilities
corex Core extensions
counters Internal counter API for configuration
cpl-c Implementation of SIP Call Processing Language (RFC 3880)
ctl Control connector for RPC interface (fifo, unixsock, tcp, udp)
 
db_mysql Database :: Mysql
 
debugger Interactive configuration processing debugger
dialog Dialog ("call") state module
dialplan Dialplan management
dialog_ng Dialog tracking module - next generation
dispatcher Load balancing and failover
diversion Call redirect support (SIP Diversion: header)
dmq Devel :: Distributed message queue system using SIP (early development)
domain Proxy :: Multiple domain support using databases
 
drouting Proxy :: Dynamic routing
enum Enum support
exec External exec module
geoip GeoIP API to configuration file
group Utils :: Group membership checking
 
htable Utils :: Hash table support
imc IM :: Instant messaging conference

ims_auth IMS authentication module
ims_icscf IMS ICSCF component module
ims_isc IMS ISC component module
ims_qos IMS Diameter Rx interface
ims_registrar_pcscf IMS PCSCF registrar module
ims_registrar_scscf IMS SCSCF registrar module

ipops IP and DNS related operations
iptrtpproxy NAT traversal :: Kernel based RTP proxy
jabber IM :: Jabber gateway
json Access to JSON document attributes
jsonrpc-c JSON-RPC client over netstrings protocol
kex Proxy :: Kamailio core functions (backwards compatibility)
lcr Least cost routing
ldap LDAP Directory access
malloc_test Functions for stress-testing memory manager (from SER)
mangler SIP message mangling functions (from SER)
matrix Matrix operations
maxfwd SIP loop detection prevention (max-forwards header - "ttl")
mediaproxy Nat traversal :: Mediaproxy (AG projects)
memcached Utils :: In-memory caching support (memcached)
mi_datagram Management interface :: UDP
mi_fifo Management Interface :: Unix FIFO
mi_rpc Management Interface :: RPC support
mi_xmlrpc Management Interface :: XML-rpc
misc_radius Various Radius functions
msilo Text message storage
msrp Embedded MSRP relay (RFC 4975 and RFC 4976)
mqueue Message queue system for configuration file
nat_traversal NAT :: NAT traversal module
nathelper NAT :: NAT traversal module :: RTPproxy (SIPPY software)
ndb_redis Connector to REDIS NoSQL Database engine
osp Open Settlement Protocol support
outbound SIP Outbound Implementation
p_usrloc Partitioned and distributed user location services
path Path: header support
pdb Number portability using external server
pdt Proxy :: Routing based on numeric prefix
peering SIP peering between service providers
permissions Security :: TCP-wrapper-like ACL functions
pike Security :: DOS-attack prevention
pipelimit Traffic shaping policies
prefix_route Execute config file route blocks based on prefix
presence Presence :: Core presence module
presence_conference Presence :: Conference events handling
presence_dialoginfo Presence :: Dialog info
presence_mwi Presence :: Message waiting indication
presence_profile Presence :: User profile extensions (RFC 6080)
presence_reginfo Presence :: Registration info (RFC 3680)
presence_xml Presence :: XML handler
print DEVEL :: Basic sample of a module
print_lib DEVEL :: Basic sample of a module with dependency on other modules
pua Presence :: Common module
pua_bla Presence :: BLA
pua_dialoginfo Presence :: Dialog Info support
pua_mi Presence :: Management interface
pua_reginfo Presence :: Registration information (RFC 3680)
pua_usrloc Presence :: USRLOC integration
pua_xmpp Presence :: XMPP/Jabber gateway
purple Presence :: Libpurple support
pv Pseudo-variable implementation
qos Dialogs :: SDP management
ratelimit Traffic shaping module
regex Regular expression support
registrar Registrar/location server support
rls Presence :: Resource list server
rr Proxy :: Record routing
rtimer Utils :: Timer based routing script processing
rtpproxy NAT :: Nat traversal module for RTPproxy control
sanity Syntax checking for incoming SIP requests
sca PRESENCE :: Shared call appearances
sdpops SDP operations
seas Application server interface
sipcapture SIP Capture Server module (used in the Homer project)
siptrace Store SIP messages in database
siputils Various utilities for SIP call handling
sl Proxy :: Stateless handling of SIP messages
sms SMS gateway support
snmpstats SNMP support (net-snmp agentx)
speeddial Per-user speed-dial controller module
sqlops SQL operations
sst SIP Session Timers implementation
statistics Script statistics support
textops Text operations
textopsx Extra Text operations
timer Execute routing blocks on core timers (From SER)
tls SSL/TLS support
tm Proxy :: SIP transaction support (stateful)
tmx Proxy :: Kamailio transaction extensions (TM module)
topoh Topology hinding
uac UAC functions (From: mangling and UAC auth)
uac_redirect UAC redirection support
uid_auth_db Authentication module using unique IDs (from SER)
uid_avp_db AVP Database operations using unique IDs (from SER)
uid_domain Domain management using unique IDs (from SER)
uid_gflags Global attributes and flags using Unique IDs (from SER)
uid_uri_db Database URI operations using unique IDs (from SER)
uri_db URI operation with database support
userblacklist User-specific blacklists
usrloc Proxy :: Location server
utils Various utilities (http query, xcap status)
websocket HTTP :: Websocket transport layer for proxy
xcap_client Presence :: XCAP support
xcap_server Presence :: XCAP server implementation
xhttp HTTP :: The server
xhttp_pi HTTP :: Provisioning interface for Kamailio
xhttp_rpc HTTP :: RPC Command support
xlog Utils :: Extended logging support
xmlops XML operations using XPath
xmlrpc HTTP :: XMLrpc support
xmpp Presence/IM :: XMPP/jabber gateway
xprint Functions for printing messages with specifiers (from SER)


ims_qos IMS Diameter Rx interface

2.1. Kamailio Modules

The Following mouldes must be loaded before this module:
* Dialog2
* Usrloc PCSCF
* TM - Transaction Manager
* CDP - C Diameter Peer
* CDP_AVP - CDP AVP Applications

2.2. External Libraries or Applications

This modules requires the internal IMS library.

3. Parameters

3.1. rx_dest_realm (string)
3.2. rx_forced_peer (string)
3.3. rx_auth_expiry (integer)
3.4. cdp_event_latency (integer)
3.5. cdp_event_threshold (integer)
3.6. cdp_event_latency_log (integer)

3.1. rx_dest_realm (string)

This is the name of the Diameter realm of the Diameter server(typically a PCRF).Default value is 'ims.smilecoms.com'.

Example 1.1. rx_dest_realm parameter usage
...
modparam("ims_qos", "rx_dest_realm", "ims.smilecoms.com")
...

3.2. rx_forced_peer (string)

This is the optional name of the origin host of the Diameter server(typically a PCRF). If not set then realm routing is used.Default value is ''.

Example 1.2. rx_forced_peer parameter usage
...
modparam("ims_qos", "rx_forced_peer", "pcrf.ims.smilecoms.com")
...

3.3. rx_auth_expiry (integer)

This is the expiry length in seconds of the initiated Diameter sessions.Default value is 7200.

Example 1.3. rx_auth_expiry parameter usage
...
modparam("ims_qos", "rx_auth_expiry", 14400)
...

3.4. cdp_event_latency (integer)

This is a flag to determine whether or slow CDP responses should be reported in the log file. 1 is enabled and 0 is disabled.Default value is 1.

Example 1.4. cdp_event_latency parameter usage
...
modparam("ims_qos", "cdp_event_latency", 1)
...

3.5. cdp_event_threshold (integer)

This time in milliseconds is the limit we should report a CDP response as slow. i.e. if a CDP response exceeds this limit it will be reported in the log file. This is only relevant is cdp_event_latency is enabled (set to 0).

Default value is 500.

Example 1.5. cdp_event_threshold parameter usage
...
modparam("ims_qos", "cdp_event_threshold", 500)
...

3.6. cdp_event_latency_log (integer)

This time log level at which we should report slow CDP responses. 0 is ERROR, 1 is WARN, 2 is INFO and 3 is DEBUG. This is only relevant is cdp_event_latency is enabled (set to 0)Default value is 0.

Example 1.6. cdp_event_latency_log parameter usage
...
modparam("ims_qos", "cdp_event_latency_log", 1)
...

4. Functions

4.1. Rx_AAR_Register(domain)
4.2. Rx_AAR(domain)

4.1. Rx_AAR_Register(domain)

Perform a AAR on Diameter RX interface to subscribe to signalling
status. This purpose of this is tell a Diameter server (typically a
PCRF) to inform the requesting Diameter client on changes to the status
of signalling bearer for the same framed IP address. For more details
see 3GGP TS 29.214.

Meaning of the parameters is as follows:
* domain that usrloc_pcscf uses to store user information.

This function can be used from REQUEST_ROUTE.

p.s. this is executed asynchronously. See example on how to retrieve
return value

Example 1.7. Rx_AAR_Register
...
Rx_AAR_Register("location");

switch ($avp(s:aar_return_code)) {
case 1:
xlog("L_DBG", "Diameter: AAR success on subscription to signalling\n
");
break;
default:
xlog("L_ERR", "Diameter: AAR failed on subscription to signalling\n"
);
t_reply("403", "Can't register to QoS for signalling");
exit;
}

...

4.2. Rx_AAR(domain)

Perform a AAR on Diameter RX interface to request resource
authorisation from a Diameter server (typically a PCRF). For more
details see 3GGP TS 29.214.

Meaning of the parameters is as follows:
* domain that usrloc_pcscf uses to store user information.

This function can be used from REQUEST_ROUTE or ONREPLY_ROUTE.

p.s. this is executed asynchronously. See example on how to retrieve
return value

Example 1.8. Rx_AAR
...
Rx_AAR("location");

switch ($avp(s:aar_return_code)) {
case 1:
xlog("L_DBG", "Diameter: AAR success\n");
break;
default:
xlog("L_ERR", "Diameter: AAR failed\n");
t_reply("403", "QoS not authorized");
exit;
}

...

5. Statistics

5.1. AAR Timeouts (aar_timeouts)
5.2. Average AAR Response Time (aar_avg_response_time)

5.1. AAR Timeouts (aar_timeouts)

The number of timeouts on sending a AAR. i.e. no response to AAR.

5.2. Average AAR Response Time (aar_avg_response_time)

The average response time in milliseconds for AAR-AAA transaction.

												

Kamailio的更多相关文章

  1. Ubuntu下编译运行Kamailio

    kamailio----配置没有成功,这个文档过几天删除,因为这个项目的文档非常少,而且qq群里的人也不活跃,现在正在研究Freeswitch,如果能够满足,就不研究这个了,这篇文档会删除. Kama ...

  2. kamailio 云部署 配置NAT

    公有云配置NAT 第一步:将内网ip广播至公网ip,编辑/etc/kamailio/kamailio.cfg文件,搜索listen,添加如下配置 # listen=udp: listen= adver ...

  3. Ubuntu 安装 kamailio

    首先安装前,你已经对kamailio的基本用法了解.可根据情况选择安装方式,本次安装基于Ubuntu18.04系统安装,对于16.04及一下会遇到版本问题,请自己查阅文档解决 安装第三方库 sudo ...

  4. kamailio/opensips snmp/cacti/zabbix监控

        kamailio/opensips是现在比较流行的sip proxy,有配置灵活.性能强大.支持各种RFC等优点,是杀人越货.谈情说爱是必备佳品.要保证这么好的东西稳定运行,监控是必不可少的, ...

  5. CSipSimple 简单分析

    简介 CSipSimple是一款可以在android手机上使用的支持sip的网络电话软件,可以在上面设置使用callda网络电话.连接使用方式最好是使用wifi,或者3g这样上网速度快,打起电话来效果 ...

  6. iOS之 kamailio-4.3.4sip服务器搭建-mac

    如要转载请注明出处http://www.cnblogs.com/chengxiaoyu/p/5006352.html 1.安装MySQL 去http://www.mysql.com/下载最新版本的My ...

  7. 加密---公钥&密钥

    一直以来对公钥和私钥都理解得不是很透彻,感觉到模棱两可.今天在网上找了半天,通过查看对这个密钥对的理解,总算弄清楚了.      公钥和私钥就是俗称的不对称加密方式,是从以前的对称加密(使用用户名与密 ...

  8. TCP Socket的通讯框架

    http://www.oschina.net/p/simple-socketshttp://www.oschina.net/p/cwsshttp://www.oschina.net/p/tcpprox ...

  9. doubango简介

    1.doubango官网:http://www.doubango.org/ doubango常用项目国内镜像(放在淘宝的svn服务器),目前有4个项目:doubango, idoubs, imsdro ...

随机推荐

  1. Python的内建比较函数cmp比较原理剖析-乾颐堂

    cmp( x, y):比较2个对象,前者小于后者返回-1,相等则返回0,大于后者返回1. Python的cmp比较函数比较原理 Python的cmp函数可以比较同类型之间,或者不同数据类型之间.然后根 ...

  2. functions函数插件的定义和使用

    创建Smarty插件:在插件目录(plugins)里新建文件 类型.插件名.php文件,然后插件方法名字书写规范: smarty_类型_插件名([...]){}在模板(tpl文件)中调用插件时格式{插 ...

  3. Python实现二叉树的遍历

    二叉树是有限个元素的集合,该集合或者为空.或者有一个称为根节点(root)的元素及两个互不相交的.分别被称为左子树和右子树的二叉树组成. 二叉树的每个结点至多只有二棵子树(不存在度大于2的结点),二叉 ...

  4. list 返回列表null替换

    function formatt(rec, val, index) { if (rec === null || rec == "null") { return "0&qu ...

  5. [GO]字符串的使用

    package main import ( "fmt" "strings" ) func main() { //判断字符串1是否包含字符串2,如果包含则返回tr ...

  6. CodeForces 342B Xenia and Spies (水题模拟,贪心)

    题意:给定 n 个间谍,m个区间,一个 s,一个f,然后从 s开始传纸条,然后传到 f,然后在每个 t 时间在区间内的不能传,问你最少的时间传过去. 析:这个题,就模拟一下就好,贪心策略,能传就传,找 ...

  7. HDU 5119 Happy Matt Friends(DP || 高斯消元)

    题目链接 题意 : 给你n个数,让你从中挑K个数(K<=n)使得这k个数异或的和小于m,问你有多少种异或方式满足这个条件. 思路 : 正解据说是高斯消元.这里用DP做的,类似于背包,枚举的是异或 ...

  8. SpringCloud教程 | 第三篇: 服务消费者(Feign)(Finchley版本)

    上一篇文章,讲述了如何通过RestTemplate+Ribbon去消费服务,这篇文章主要讲述如何通过Feign去消费服务. 一.Feign简介 Feign是一个声明式的伪Http客户端,它使得写Htt ...

  9. PreTranslateMessage()函数捕获键盘按键消息

    01. PreTranslateMessage函数,常用于屏蔽MFC对话框中默认的Enter和ESC消息 函数原型:BOOL PreTranslateMessage(MSG* pMsg) 用法举例: ...

  10. Java Integer为代表的包装类

    Java种的Integer是int的包装类型 1. Integer 是int的包装类型,数据类型是类,初值为null 2. 初始化时 int i = 1; Integer i = new Intege ...