免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4312 | 回复: 0
打印 上一主题 下一主题

opensips.cfg 分析 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-15 21:12 |只看该作者 |倒序浏览
###########2008.04.13#################
opensips.cfg 配置文件
debug=3  #debug level (cmd line: -ddddddddd)
设置日志级别,数值-3到4,默认2 数越大,就会有更多的信息被写到日志。设置为4
系统的性能会下降的(sluggish)
fork=yes
设置了yes进程会在在后台运行,有时候在前台运行也很重要,可以来找到脚本中的错误
如果fork disabled openser只能监听一个网卡,tpc/tls也会自动disabled。 在单进程模式,只有udp
接口允许。
log_stderror=no (cmd line :-E)
set yes  服务器会打印调试信息到标准错误输出
set no syslog 会被使用。
children=4
每个网卡创建的子进程数,不过对于tcp进程没有影响。
port=5060
监听端口,一般不用改(tcp还是udp呢?)
mpath="/usr/local/opensips/lib/opensips/modules/"
模块搜索路径
modparam("mi_fifo","fifo_name","/tmp/openser_fifo")
命名管道被创建用来监听和读外来命令。
modparam("usrloc","db_mode",0)
usrloc 模块负责用户定位服务,当用户注册的时候它保存定位信息,在这儿的0代表内存,关掉服务器
信息会丢失。
modparam("rr","enable_full_lr",1)
设置rr模块的enable_full_lr为1~~~~~
route{
sip 请求路由逻辑的开始
record_route() 函数添加路由记录头
loose_route() 函数测试请求是否用record-route 头
if(loose_route()){
            #mark routing  logic in request
            append_hf("P-hint:rr-enforced\r\n");
            route(1);
};
function append_hf will add a header field with a hint(暗示) that the request was
processed according to the record-route 头(rr-enforced)。
if(!uri==myself)
如果请求域名不是本机情况的处理。
lookup("aliases");
简单的查找canonical(经典的符合规范的) URI在request中的
lookup("location") 试着恢复R-URI的(AOR),如果用户已经注册即AOR可以被定位,它会改变R-URI的用户UA ip地址
if the AOR is not found we will simply send back an error message("404 not found").
t_relay() function forwards the request statefully based on the request URI.
The domain part is resolved using DNS helpers such as NAPTR,SRV,and A records. This function is
exposed by the TRANSACTION module(tm.so).如果请求不能成功的发送的目的地,r_relay()函数会自动
产生一个错误message。sl_reply_error()会把failure发送到UA。
Transactions and dialogs
一个Transaction通常像对话协商。(一个会话的建立过程就是一个transaction,结束的时候也是)而整个这个过程是一个对话。
dialog is identified by the combination of the from ,to and call-id heard fields.
不是所有的方法都产生一个对话,象register和message就不会。
Inital and Sequential Requests
区分它们很重要:initial request 用via header记录路由信息,如果打开了record-routing enabled,route header也会用到。
在transaction中 数据包会根据via头回到传输它的proxy。
subsequent requests 通过contact header 来路由的,即使设置了record-routing,它会通过set diescovered route 回来。
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26883/showart_1901127.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP