opensips.cfg

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 回来。


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值