修改SIP消息的SDP主体有多大错误?
我为公司创建的 SIP PBX 的一个要求是记录通过它的所有呼叫。我通过强制所有 SIP 消息通过 PBX 并修改 SDP 正文来解决这个问题,以便流通过它并被记录。效果很好。
我最近发现这是不允许的。
还有其他方法可以实现通话录音吗?这对于协议来说有多“错误”?
A requirement for the SIP PBX I created for my company was to record all calls passing through it. I solved it by forcing all SIP message to pass through the PBX and to modify the SDP body so the stream passes through it and gets recorded. It works well.
I recently found out that this is not allowed.
Is there any other way to implement call recording and how "wrong" is this in regard to the protocol?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您正在描述一个 SIP 代理,或多或少是一个会话边界控制器 (SBC)。代理可以修改 SDP,但这样做时应该小心。通常,SBC 会将媒体目标设置为自己,并将数据代理到目标。因此,这在规范方面是完全合法的(假设设备已经到达您的服务器)。
然而,“不允许”也可能意味着“法律上不允许录音”,这在不同州之间存在很大差异。
It sounds like you're describing a SIP proxy, more or less a Session Border Controller (SBC). A proxy can modify SDP, though it should be careful in doing so. Typically SBCs will set the media destination to themselves, and proxy the data to the destination. So this is perfectly legal spec-wise (assuming the devices are already coming to your server).
However, "Not allowed" could also mean "recording calls is legally not allowed", which varies a lot state-to-state.
实现通话录音的更传统方法是捕获线路上的 RTP 数据包并将它们组合在一起以创建音频文件。有很多工具可以做到这一点,甚至内置于 Wireshark 中。
就 SDP 的调整而言,这绝对不是“不允许”的事情,至少在技术层面上是这样。当用户代理将私有 IP 地址放入 SDP 中时,许多 SIP 代理被迫破坏 SDP 中的 IP 地址。您会发现大多数 SIP 服务器在这方面都具有某种功能,通常称为 NAT 破坏或类似功能。
A more conventional way to implement call recording would be to capture the RTP packets on the wire and put them together to create an audio file. There are quite a few tools around to do exactly that and it's even inbuilt into Wireshark.
As far as tweaking with the SDP goes it's definitely not something that is "not allowed" at least not on a technical level. A lot of SIP Proxy's are forced to mangle the IP addresses in SDP when user agents put private IP addresses in them. You'll find most SIP servers out there have some sort of capability in this regard and it's often call NAT mangling or similar.