使用P2P的C++和voIP

Joh*_*sen 5 c++ windows qt voip p2p

我目前正在筹划我的最后一年项目,我希望创建一个支持IP语音和基于文本的聊天的应用程序(虽然不是"下一个Skype").我真的想要一个易于使用的轻量级方式来完成voip部分,它不需要扩展的功能,至少不需要开始.

我想要的一个功能是它不是由服务器提供的,但这是因为我不希望在应用程序发布后维护服务器.因此,如果可以将您的IP提供给某人并且他们加入使用它将是更可取的.

我打算将Qt框架用于GUI,虽然它可以改变,语言也是如此(C++),所以没有什么是一成不变的.该软件将在Windows上运行.

我看过H.323,sip和其他一些开源软件,但它似乎很难进入,我无法弄清楚它们是否做了我需要他们做的事情.

我应该研究哪些开源库,这部分是我想要的东西?我错过了哪些来源?我对voIP世界完全陌生,可以朝着正确的方向发展.再次,如果有一种语言以简单的方式执行此操作,我可以切换,因为我目前正处于计划阶段.谢谢你的帮助.

Ani*_*nge 3

首先,几个月前我为我的公司实施了类似的措施。

得到教训:

1. you can't just pass IPs around and expect the users to like that over skype.
   Solution:
      a. You will need your own server with the necessary ports forwarded. You will have to use some sort of firewall hole punching algorithm(take a look at UDP hole punching).

2. Using existing VoIP library is always better. Downside? You can't write proprietary code using opensource library. Hence you will need to learn H.323 and RTCP/RTP protocol.

3. You will need to write echo reduction algorithms for voice.

4. COMPRESS your audio data before sending it to another computer. PCM data can and will clog your network, delaying sound and fuzzing up everything in the process.
Use aLaw and uLaw compression schemes.

5. Make sure you take care of all the error conditions. Multimedia over network can be tricky if not really hard to implement. 

6. DONT USE QT. Use a platform specific framework like .NET and libraries that deal with sound (NAudio). 
Run Code Online (Sandbox Code Playgroud)

我认为这将总结您在深入研究 VoIP 编程艺术之前首先需要解决的问题。

对于你的问题,你的问题要小得多。

1. You don't need echo reduction algorithms IF you use headsets.
2. You don't need to write hole punching algorithms if you're OK with passing IPs around. Take a look at NAT traversal(UPnP?) if the data is suppose to go on a network and to a computer that isn't on your LAN.

FLOW:
COMPUTER1->DATABUFFER->COMPRESSuLaw/aLaw->NETWORK->DECOMPRESSuLaw/aLaw->OTHERCOMPUTER
and vice versa.
Run Code Online (Sandbox Code Playgroud)

祝你好运 :)