- 浏览: 400433 次
文章分类
- 全部博客 (327)
- Android (114)
- Java (13)
- Java基础 (14)
- Glib (2)
- linux (15)
- extjs (5)
- eclipse (2)
- Asterisk (56)
- MYSQL (6)
- 数据库 (9)
- PHP (7)
- C# (18)
- 杂谈~~ (1)
- web开发前端 (3)
- 网络编程 (2)
- Opensips (2)
- voip (3)
- debian (7)
- openfire (15)
- wordpress (1)
- 版本控制 (1)
- Android 线程服务广播 (1)
- SRTP (2)
- 单片机及ARM等 (3)
- 基础知识 (5)
- asp.net (2)
- 单片机 (1)
- 设计模式及架构 (1)
- 安全 (1)
- Cubieboard 草莓树莓各类派 Android开发板 (1)
- J2EE (2)
- BootStrap (3)
- BootStrap web前端开发 (1)
- web前端开发 (4)
- object-c (1)
- openwrt (8)
- 智能家居 (4)
- Node.js (4)
最新评论
-
xiaoxiecomeon:
你这个程序一存在线程的时间片相互抢占的问题,运行时间长了很可能 ...
Runnable 和 Thread -
dotjar:
我觉得话应该这么说:引用TestThread tt = new ...
Runnable 和 Thread -
dagf113225:
调用TelephonyManager的隐藏API是先参考Fra ...
Android提高第十四篇之探秘TelephonyManager
通过使用kamailio的dispatcher.so 模块实现astersik的负载均衡
配置如下
1:dispatcher.list
# group sip addresses of your * units 1 sip:10.1.2.3:5060 1 sip:10.1.2.4:5060 1 sip:10.1.2.5:5060
这里要给sip分组
2:kamailio.cfg主要配置如下
loadmodule("dispatcher.so") if ( method=="INVITE" ) { ds_select_dst("1","4"); sl_send_reply("100","Trying"); forward();#uri:host, uri:port); exit(); }
这里载入dispatcher.so模块,设置分配规则
其中关键的是用到了ds_select_dst("1","4") 这个方法,该方法接受两个参数,第一个是组ID,也就是dispatcher.list 第一列的是设置 “1”,第二个参数是分配规则,“4”表示轮训 "round-robin (next destination).“
这样,新的INVITE就会在这3个sip之间循环分配,从而实现负载均衡
更多分配规则如下
.
-
“0” - hash over callid
-
“1” - hash over from uri.
-
“2” - hash over to uri.
-
“3” - hash over request-uri.
-
“4” - round-robin (next destination).
-
“5” - hash over authorization-username (Proxy-Authorization or "normal" authorization). If no username is found, round robin is used.
-
“6” - random (using rand()).
-
“7” - hash over the content of PVs string. Note: This works only when the parameter hash_pvar is set.
-
“8” - use first destination (good for failover).
-
“9” - use weight based load distribution. You have to set the attribute 'weight' per each address in destination set.
-
“10” - use call load distribution. You have to set the attribute 'duid' (as an unique string id) per each address in destination set. Also, you must set parameters 'dstid_avp' and 'ds_hash_size'.
The algorithm can be used even with stateless proxy mode, there is no SIP dialog tracking depending on other modules, just an internal lightweight call tracking by Call-Id, thus is fast and suitable even for embedded systems.
The first destination selected by this algorithm is the one that has the least number of calls associated. The rest of the destination list is taken in order of the entries in set - anyhow, until a re-route to next destination happens, the load on each address can change.
This algorithm can be used only for dispatching INVITE requests as it is the only SIP method creating a SIP call.
-
“X” - if the algorithm is not implemented, the first entry in set is chosen.
更多功能参看
http://www.kamailio.org/docs/modules/3.1.x/modules_k/dispatcher.html#id2805068
http://www.kamailio.org/docs/modules/3.1.x/
http://www.kamailio.org/dokuwiki/doku.php/asterisk:load-balancing-and-ha
发表评论
-
Configuring an Asterisk server
2013-06-28 09:05 860Configuring an Asterisk server ... -
asterisk ami
2013-06-28 08:56 1362Asterisk Manager Interface主要提供 ... -
Originate Using Asterisk Local Channels
2013-01-24 17:30 1286Whenever you want to place a c ... -
Asterisk 1.8 chan_sip模块代码分析
2013-01-18 16:33 1863和以前版本相比,Asterisk在架构上有了不小的变动,本文 ... -
Asterisk Kernel analysis 2 channel
2013-01-17 17:44 816从内核的角度去分析问题时,弄清楚呼叫流程是非常关键的,只有 ... -
Asterisk Kernel analysis 1
2013-01-17 17:44 822一、内核初始化。 从 main入口。Asterisk ... -
astersik bridge 支持
2013-01-17 17:27 664为支持通话过程中双方按键的接受及处理,asterisk 通过 ... -
Asterisk 之${BRIDGEPEER} 函数说明
2013-01-17 16:38 676${BRIDGEPEER} :个人理解是 获取当前通道类型 ... -
Asterisk拨号函数Dial()详解
2012-12-27 13:33 1565Asterisk的拨号函数/命令是Dial,下面就介绍一 ... -
asterisk中常用函数说明
2012-12-15 11:56 937int ast_strlen_zero(co ... -
什么是1号信令、7号信令和PRI信令?
2012-04-11 14:26 1482按照信令的信道来分类,信令可以分为:随路信令和公共信道信 ... -
FreeSWITCH 与 Asterisk 比较
2012-03-29 15:45 3460VoIP通信,与传统的电话技术相比,不仅仅在于绝对的资费 ... -
Asterisk命令MeetMe详解
2012-03-29 14:44 961MeetMe 概要 MeetMe ... -
Asterisk local channels
2012-03-12 15:09 833Asterisk local channels ... -
35个最棒的Asterisk免费应用
2012-03-12 14:51 2192Hi, I was looking round o ... -
Asterisk Originate 内部执行流程
2012-03-11 20:34 9591. originate的执行 向客户端发起呼叫,将客 ... -
模拟板卡疑难杂症(转)
2012-03-11 20:34 2199转自:http://sun4love.javaeye.c ... -
Asterisk 通话过程中执行动作(即applicationmap )的使用方法和电话转会议的实现
2012-03-11 20:34 943asterisk在正常通话过程中执行拨号计划中动作是通过 ... -
asterisk feature applicationmap 的caller和callee 的区别
2012-03-11 20:34 992经过测试,在applicationmap 中定 ... -
asterisk中关于实现会议室meetme的笔记
2012-03-09 11:07 1816一、资料: 1.http: ...
相关推荐
kamailio模块使用说明
本文档是一个pdf文档,中文的,介绍了目前kamailio的所有特征和功能。通过阅读此文档,你可以对kamailio有个整体的了解,知道它能做什么,适不适合你的项目 能很好的指导你的项目,也可以研究新的课题。
用Pacemaker实现Kamailio的HA
kamailio 安装配置过程,根据实际在UBUNTUN服务器下安装配置kamailio的过程步骤,记录在配置过程中遇到的问题及解决,直到最终测试成功。
跟踪调试Kamailio路由
IMS报文,使用kamailio搭建ims,在PCSCF、ICSCF和SCSCF上抓取报文,含SIP、RTPProxy-ng、rtp、DNS、Diameter等协议。
linux系统下sip开源服务器kamailio的源码,kamailio前身是openSER,本人编译通过可使用,安装配置稍麻烦,官方指导http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.0.x-from-git 这类资源官方都有...
该工具会自动为Kamailio构建一个dispatcher.list (使用 ),以便动态地负载平衡Asterisk主机,例如,当它们在CoreOS中的Fleet下运行时。 简而言之,您可以将一个实例作为对Kamailio的辅助操作(在“调度程序模式”...
领事DNS负载平衡和DNS故障转移 dSIPRouter集群同步 Kamailio DMQ复制 通知系统 通话限制通知 端点故障通知 通话明细记录通知 增强的DID管理 DID故障转移到运营商/端点组或DID DID硬转发到运营商/端点组或DID ...
从下载到配置,一步一步实践记录,nat,rtpproxy,媒体中继和媒体桥接等;
Kamailio是一个开源的SIP服务器,原名OpenSER Kamailio is an Open Source, GPL2, SIP Server Routing Platform. It is written in C for Linux/Unix plaforms and focuses on performance, flexibility and ...
kamilio安装及支持rtp转发配置,并且用软终端进行测试抓包,成功。
This tutorial collects the functions and parameters exported by Kamailio core to configuration file.
官方网站只提供了debian下安装kamailio的文档。
ubuntu命令安装和维护Kamailio服务器,完美成功!
kamailio-4.4.2_src.tar.gz ,通讯工具,适合linux系统
Kamailio Variables and Transformations
kamailio (OpenSIPS)是一个成熟的电信级SIP Server平台,可广泛应用于SIP应用的路由分发、负载均衡,可用于搭建SIP代理,提供SIP注册服务等。而且目前OpenSIPS自身也提供SIP Presence以及IM功能。同时,应该注意的...
docker-kamailio Dockerfile,用于获取部署在最新的fedora docker映像上的Kamailio Sip服务器的最新稳定版本! Kamailio当前版本:4.2.3 Fedora当前版本:21 ...您可以使用网上免费提供的一种: :
卡姆利 Kamailio命令行界面控制工具。 Kamailio是一个开源SIP(RFC3261)服务器,可从以下位置获得: kamcli的目标是成为...可以将用于kamcli的新命令实现为插件,每个命令都在位于kamcli / commands /中的文件中