从收到的 RT 数据包中解析 RTP 标头和负载
我正在开发一款软件电话,为此我正在实现我自己的模块。我能够成功地将 RTP 数据包发送到我的 SIP 服务器,另一方面我收到 RTP 数据包,我需要从中解析标头和有效负载。
我知道 RTP 标头的长度是 12,之后是有效负载。现在有人可以阐明如何解析标头和有效负载。我正在使用 C 作为编程语言。
问候
I am working on developing a soft-phone, for this I am implementing my own module. I am able to successfully send the RTP packets to my SIP Server and on the other hand I am getting RTP packets, from which I need to parse the header and payload.
I know that the length of the RTP header is 12 and after that follows the payload. Now can somebody shed some light of how to parse header and payload. I am working with C as programming language.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的办法是遵循 RFC3550 然后查看相应的 RFC对于有效负载类型。您可以查看的另一个链接是 http://www.networksorcery.com/enp/protocol /rtp.htm。它还包含各种 RFC 的链接。
或者,如果您想要一些示例代码作为起点,您可以查看大量 C 和 C++ 语言的开源 RTP 库。 LiveMedia,jRtpLib, RtpLib 是您可以使用的一些,但还有更多。
The best thing to do is to follow the RFC3550 and then to look at the corresponding RFC for the payload type. Another link you could look at is http://www.networksorcery.com/enp/protocol/rtp.htm. It also contains links to the various RFCs.
Alternatively if you want some example code as a starting point, there are loads of open source RTP libraries in both c and c++ that you could have a look at. LiveMedia, jRtpLib, RtpLib are some you could use but there were tons more.