嗨,我正在将 Asterisk 与 OpenSIPS 集成为媒体服务,我正在使用 Asterisk 会议和语音邮件进行测试,但是当我打电话时,电话会议在 30 秒后掉线时出现问题。
Opensips 和星号在同一个盒子里
Opensips 5060 星号 5080
在日志中看起来像 NAT 问题,但两者都在同一个框中,我所有的本地客户 UA 都不是远程的
我的配置 opensips.cfg
http://www.netsoluciones.com/opensip.txt
任何帮助表示赞赏!
嗨,我正在将 Asterisk 与 OpenSIPS 集成为媒体服务,我正在使用 Asterisk 会议和语音邮件进行测试,但是当我打电话时,电话会议在 30 秒后掉线时出现问题。
Opensips 和星号在同一个盒子里
Opensips 5060 星号 5080
在日志中看起来像 NAT 问题,但两者都在同一个框中,我所有的本地客户 UA 都不是远程的
我的配置 opensips.cfg
http://www.netsoluciones.com/opensip.txt
任何帮助表示赞赏!
有几件事可能会挂断电话。
我将列出 3 个,以便您查看:
1)未收到Callee的ACK,将使其连续生成200 OK然后退出并发送BYE。
2) RTP 超时
3)Opensips的SIP ping机制
既然你有一个重传超时,我会选择 1 号,威廉的回答是一个很好的起点。
过去在本地 IP 地址上运行 Opensips 时遇到了几个问题……可能有点棘手。另外,不要忘记在 Opensips 的主路由上使用 record_routing(),这样你就可以确保它停留在对话的中间。
我看不到它在抱怨哪个数据包,但我假设服务器没有ACK从客户端看到 - 如果它是呼叫者将发送的会议服务INVITE,Asterisk 将回答200/OK并且呼叫者应该发送ACK。200/OK将是日志中提到的“关键数据包”。
尝试分别跟踪所有连接。确保 OpenSips 正确传输 ACK(实现起来可能很棘手,确保处理严格和松散的路由变体)。如果是本地网络场景,请确保 OpenSips 不会尝试重写联系人字段。
这实际上是一个普遍的问题。
问题在于您的 RTP 传输 - 与端口 5060 或 5080 上的信号无关。虽然我看不到数据包本身,但您正在收到 RTP 超时 - 星号默认 RTP 超时为 30 秒。
几件事要检查。
正如前面的评论者所说,检查 NAT 并确保外部 IP 在 SIP 数据包中正确。如果您愿意,请在星号 CLI 中键入以下内容:
sip 设置调试
然后粘贴调试的内容以回复此问题,我可以进一步提供帮助。
如果我是一个打赌的人——有时我是:-)——我会向甜甜圈打赌,RTP(媒体)流在该服务器和与之通信的端点之间没有正确传递。SIP 跟踪将向您显示问题 IP 地址,并且我敢打赌,允许您打开防火墙以允许所述端点和/或通过打开上面引用的 UDP 端口说服您打开到该服务器的 RTP。如果 IPTABLES 已打开,请尝试禁用它并进行测试。同样,SIP 跟踪将告诉我们我们需要知道的所有信息,以便为您提供准确的答案。
看到你的日志后更新----
在我看来,您的路由脚本没有以您想要的方式绑定星号所需的钩子......
看看这个脚本——我过去用过这个。它需要您进行一些修改,但它应该让您继续......
显然,这不是一个完整的路由脚本——它会被放置在你的路由定义之前,靠近你的脚本底部......
另外-您确实发现了星号无法验证用户3012的事实,对吗?我假设您这样做了,并且与您的问题无关,但我想我应该问...
# ASTERISK HOOK - BEGIN
# media service number? (digits starting with *)
if ($rU=~"^\*[1-9]+") {
# we do provide access to media services only to our
# subscribers, who were previously authenticated
if (!is_from_local()) {
send_reply("403","Forbidden access to media service");
exit;
}
#identify the services and translate to Asterisk extensions
if ($rU=="*1111") {
# access to own voicemail IVR
seturi("sip:VM_pickup@ASTERISK_IP:ASTERISK_PORT");
} else
if ($rU=="*2111") {
# access to the "say time" announcement
seturi("sip:AN_time@ASTERISK_IP:ASTERISK_PORT");
} else
if ($rU=="*2112") {
# access to the "say date" announcement
seturi("sip:AN_date@ASTERISK_IP:ASTERISK_PORT");
} else
if ($rU=="*2113") {
# access to the "echo" service
seturi("sip:AN_echo@ASTERISK_IP:ASTERISK_PORT");
} else
if ($rU=~"\*3[0-9]{3}") {
# access to the conference service
# remove the "*3" prefix and place the "CR_" prefix
strip(2);
prefix("CR_");
rewritehostport("ASTERISK_IP:ASTERISK_PORT");
} else {
# unknown service
seturi("sip:AN_notavailable@ASTERISK_IP:ASTERISK_PORT");
}
# after setting the proper RURI (to point to corresponding ASTERISK extension),
# simply forward the call
t_relay();
exit;
}
# ASTERISK HOOK - END
# do lookup
if (!lookup("location")) {
# ASTERISK HOOK - BEGIN
# callee is not registered, so different to Voicemail
# First add the VM recording prefix to the RURI
prefix("VMR_");
# forward to the call to Asterisk (replace below with real IP and port)
rewritehostport("ASTERISK_IP:ASTERISK_PORT");
route(1);
# ASTERISK HOOK - END
exit;
}
# when routing via usrloc, log the missed calls also
setflag(2);
# arm a failure route in order to catch failed calls
# targeting local subscribers; if we fail to deliver
# the call to the user, we send the call to voicemail
t_on_failure("1");
route(1);
}
route[1] {
if (!t_relay()) {
sl_reply_error();
};
exit;
}
failure_route[1] {
if (t_was_cancelled()) {
exit;
}
# if the failure code is "408 - timeout" or "486 - busy",
# forward the calls to voicemail recording
if (t_check_status("486|408")) {
# ASTERISK HOOK - BEGIN
# First revert the RURI to get the original user in RURI
# Then add the VM recording prefix to the RURI
revert_uri();
prefix("VMR_");
# forward to the call to Asterisk (replace below with real IP and port)
rewritehostport("ASTERISK_IP:ASTERISK_PORT");
t_relay();
# ASTERISK HOOK - END
exit;
}