为什么把这三者放一起,不知道的朋友必然有疑问,先简单解释下这三者之间的关系。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.基本安装和基本命令
opensips | kamailio | 备注 | |
安装教程 | http://www.opensips.org/Documentation/Install-CompileAndInstall-1-9 | http://www.kamailio.org/wiki/install/4.0.x/git | |
主程序 | opensips | kamailio | 都可能过-h参数查看可支持的所有启动参数 |
动态管理配置 | opensipsctl | kamctl | 可直接进行配置,比如账号,domain等等信息 |
管理控制台 | 忘记了 | kamcmd | 进入CLI,输入问号显示帮助列表 |
在这部分内容里面,具体要熟悉通过修改Makefile进行编译内容的调整,还需要熟悉几个常用的MAKE 参数:http://sip-router.org/wiki/tutorials/makefile-system
3.opensips/kamailio系统参数、模块参数、脚本、伪变量等
用他们来配合asterisk/freeswitch能够构建超大容量的VOIP平台,下次再分享架构。
推荐网友老黑翻译的《使用OpenSER构建电话通信系统》http://blog.chinaunix.net/uid-2555411-id-68025.html,适合入门阅读。
新浪微博:@安静的发狂者
QQ:229675152 欢迎交流
本文为原创,转载请联系作者
kamailio/opensips 技术交流QQ群:118791050