如何学习opensips/kamailio/openser

为什么把这三者放一起,不知道的朋友必然有疑问,先简单解释下这三者之间的关系。openser是其他两位的父亲;opensips算是二儿子,长大了就出去单干了;而kamailio继承了正统,直接是openser的延续,所以现在从openser延续下来的就是kamailio和opensips,但他们两个都是同一个父亲,所以他们流着同样的血液,对程序而言就是相同的内核、接口、配置方式。
他们能做什么?以下是他们各自的宣传:
OpenSIPS is a multi-functional, multi-purpose signaling SIP server - it can act as SIP Router/Switch, SIP Registrar, Application Server, Redirect Server, Load Balancer / Dispatcher, Back-to-Back User Agent, Presence Server, IM Server, Session Border Controller, SIP Front-End, NAT traversal Server, IP Gateway (SMS, XMPP) and others - see the full Set of Features.
Kamailio™ (former OpenSER) is an Open Source SIP Server released under GPL, able to handle thousands of call setups per second. Among features: asynchronous TCP, UDP and SCTP, secure communication via TLS for VoIP (voice, video); WebSocket support for WebRTC; IPv4 and IPv6; SIMPLE instant messaging and presence with embedded XCAP server and MSRP relay; IMS extensions; ENUM; DID and least cost routing; load balancing; routing fail-over; accounting, authentication and authorization; support for many backend systems such as MySQL, Postgres, Oracle, Radius, LDAP, Redis, Cassandra; XMLRPC control interface, SNMP monitoring. It can be used to build large VoIP servicing platforms or to scale up SIP-to-PSTN gateways, PBX systems or media servers like Asterisk™, FreeSWITCH™ or SEMS. Kamailio and the SIP Express Router (SER) teamed up for the integration of the two applications and new development.
重点就是:高性能sip proxy、支持众多扩展协议、配置灵活。
进行以下内容需要对Linux操作系统有基本的认识,熟悉基本管理命令。
使用SIPP实际测试,SIP/UDP协议会话外消息转发可达到1.6W CPS, TCP可以达到6K;单台SIP/TCP连接可以支持到20-25W。但正是因为他们配置灵活,所以比较复杂难懂,刚一接触不知如何下手。他们的文档是非常丰富的,主要是他们官网上的英文文档,所以想要学好英文这关必须要过。

1.先学习SIP协议
why:他们的配置主要都是对SIP协议进行操作,如果对SIP协议不清楚,就不知道如何改,更不知道改了会产生哪些后果。
what:包括但不限于呼叫流程、事务、会话、无状态、有状态、Via、Route、Record-Route等概念,清楚这些概念跟哪些header有关以及与sip proxy的关系。
how:这个只有网上搜了,也有讲SIP的书。

2.基本安装和基本命令

opensipskamailio备注
安装教程http://www.opensips.org/Documentation/Install-CompileAndInstall-1-9http://www.kamailio.org/wiki/install/4.0.x/git
主程序opensipskamailio都可能过-h参数查看可支持的所有启动参数
动态管理配置opensipsctlkamctl可直接进行配置,比如账号,domain等等信息
管理控制台忘记了kamcmd进入CLI,输入问号显示帮助列表
在这部分内容里面,具体要熟悉通过修改Makefile进行编译内容的调整,还需要熟悉几个常用的MAKE 参数:http://sip-router.org/wiki/tutorials/makefile-system

3.opensips/kamailio系统参数、模块参数、脚本、伪变量等

kamailioopensips
系统参数以及系统内置函数、脚本流程等http://www.kamailio.org/wiki/cookbooks/4.0.x/corehttp://www.opensips.org/Documentation/Script-CoreParameters-1-10
http://www.opensips.org/Documentation/Script-CoreFunctions-1-10
http://www.opensips.org/Documentation/Script-Routes-1-10
伪变量:分系统内置的和脚本及模块输出的
这些伪变量可直接在配置文件中使用,非常方便
http://www.kamailio.org/wiki/cookbooks/4.0.x/pseudovariableshttp://www.opensips.org/Documentation/Script-CoreVar-1-10
变量操作及转换http://www.kamailio.org/wiki/cookbooks/4.0.x/transformationshttp://www.opensips.org/Documentation/Script-Tran-1-10
模块列表及每个模块输出函数、参数、avp、mi等http://kamailio.org/docs/modules/4.0.x/http://www.opensips.org/Documentation/Modules-1-10
开发文档 kamailio提供的是文档教程
opensips提供的是视频录像及代码。
http://www.asipto.com/pub/kamailio-devel-guide/http://www.opensips.org/Documentation/Development-Tutorials




用他们来配合asterisk/freeswitch能够构建超大容量的VOIP平台,下次再分享架构。
推荐网友老黑翻译的《使用OpenSER构建电话通信系统》http://blog.chinaunix.net/uid-2555411-id-68025.html,适合入门阅读。


新浪微博:@安静的发狂者
QQ:229675152 欢迎交流
本文为原创,转载请联系作者
kamailio/opensips 技术交流QQ群:118791050


  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值