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. 谈谈Spring 注入properties文件总结

    本篇谈谈Spring 注入properties文件总结,小编觉得挺不错的,现在分享给大家,也给大家做个参考.一起跟随小编过来看看吧 spring提供了多种方式来注入properties文件,本文做一个 ...

  2. 【Django】Django Debug Toolbar调试工具配置

    正在发愁怎么调试Django,就遇到了Django Debug Toolbar这个利器. 先说遇到的问题: 网上也有教程,不过五花八门的,挨个尝试了一遍,也没有成功运行.最后终于找到问题所在: 从开发 ...

  3. R Markdown 速查表

  4. [GO]多任务的资源竞争问题

    package main import ( "fmt" "time" ) func Printer(s string) { for _, data := ran ...

  5. ScreenCapturePro2 for Joomla_3.4.7-tinymce4x

    1.1. 与Joomla_3.4.7-tinymce4x整合 示例下载:Joomla_3.4.7,   1.1.1. 添加screencapture文件夹   1.1.2. 2.添加插件文件夹 路径: ...

  6. 编写高质量代码改善C#程序的157个建议——建议144:一个方法只做一件事

    建议144:一个方法只做一件事 “单一职责原则”(SRP)要求每一个类型只负责一件事情.我们将此概念扩展到方法上,就变成了:一个方法只做一件事. 回顾上一建议的代码,LocalInit和RemoteI ...

  7. mysql中四种存储引擎的区别和选择

    前言 数据库存储引擎是数据库底层软件组织,数据库管理系统(DBMS)使用数据引擎进行创建.查询.更新和删除数据.不同的存储引擎提供不同的存储机制.索引技巧.锁定水平等功能,使用不同的存储引擎,还可以 ...

  8. node后台启动

    node启动后会占用当前shell 后台启动方式: 1.用forever进行管理 npm install -g forever forever start index.js   2.使用nohub命令 ...

  9. 无线显示技术:WiDi,WLAN Display,Air Play,Miracast的摘抄

    除了标题提到的WIDI,WLAN Display,Air Play之外,还有Miracast与DLNA的概念,他们之间的区别和联系是什么呢? WIDI: WiDi是英特尔主导的无线音视频传输技术,这也 ...

  10. Spring学习(一)——环境准备

            以前做的项目都是用.net开发的,以后准备迁移到java平台上,近期正好有个新项目要上马,所以调研下java相关技术.Spring作为java平台下的一个全栈框架, 其简洁优雅的设计和 ...