SIP、ICE、TURN 及相关协议的 C++ 实现
C++ implementation of SIP, ICE, TURN and related protocols

原始链接: https://github.com/resiprocate/resiprocate

## reSIProcate 概要 reSIProcate 是一系列用于构建基于SIP通信系统的 C++ 库和应用程序。主要组件包括 **resip**(一个全面的 SIP 协议栈)、**dum & recon**(高级 SIP UA 库,recon 提供媒体堆栈集成)以及 **rePro**(SIP 代理)、**reTurn**(STUN/TURN 服务器)和音乐保持及 B2BUA 功能服务器等应用程序。它还包括 **tfm**,一个 SIP 框架,以及一个 STUN/TURN 客户端库。 构建 reSIProcate 涉及使用 CMake。 可以进行树内或树外构建,编译后提供单元测试。 需要大量的依赖项,包括 git、make、CMake、C++ 编译器(clang 或 g++)以及各种库,如 libssl、libasio 和 libboost。 通过 Visual Studio 支持 Windows 构建,可以选择集成 sipXtapi 项目。CMake 变量控制构建选项,CPack 可用于创建可安装的软件包。 详细的构建说明和全面的 wiki 可在 [www.resiprocate.org](www.resiprocate.org) 找到。

这个Hacker News讨论围绕着C++实现的SIP、ICE和TURN协议([github.com/resiprocate](https://github.com/resiprocate))。用户称赞该库的成熟度和持续维护,并指出缺乏强大且最新的开源SIP协议栈。 一个关键点是,IPv6简化了网络连接,与IPv4相比,减少了对复杂规避方案(如ICE/TURN/打孔)的需求——尽管在两者中仍然*需要*打孔。虽然IPv6并不能完全消除这些技术的必要性,但它去除了与IPv4相关的许多额外复杂性。 对话还涉及使用SIP通过域名(handle@domain)而不是电话号码进行呼叫。多位用户建议使用SIP代理/服务器,如OpenSIPS,或完整的服务器,如Asterisk,而不是直接实现SIP库。另一个建议是XMPP/Jabber,作为此用例的一个潜在更简单的替代方案,但它也需要配置,包括STUN/TURN。
相关文章

原文

The reSIProcate repository contains the following C++ libraries and applications:

  • resip library: comprehensive (RFC3261) SIP stack
  • dum (Dialog Usage Manager) library: high level SIP library for creating SIP user agents (no media stack)
  • recon library: high level SIP UA library with media stack integration
  • rePro application: SIP Proxy server
  • reTurn application: STUN/TURN server
  • MOHParkServer appplication: a SIP based Music-on-hold server using recon
  • reConServer application: a SIP based B2BUA server with media using recon
  • reTurn library: STUN/TURN client library
  • tfm library: a SIP based SIP framework

Please see the following wiki for more information: www.resiprocate.org

To create an in-tree build: Navigate to git root folder where top level CMakeLists.txt file is

To create an out of tree build:

$ mkdir cmake_build # Or any other name
$ cd cmake_build
$ cmake ..
$ make

Once this is built, you can run the unit tests with:

or, for verbose output:

If you want to start fresh either delete the out of tree build directory or delete the CMakeCache.txt file.

  • Some linux packages can be hard to track down. If you don't need the features that enabling these packages provides you can disable them in the build. One such package is QPID Proton.
$ cmake -DBUILD_QPID_PROTON=OFF .

Required Packages For Default Enabled CMake Settings

  • git
  • make
  • cmake
  • clang or g++ (resip CI uses clang-13, lld-13, g++-10)
  • gperf
  • libssl-dev (WITH_SSL)
  • libc-ares-dev (WITH_C_ARES)
  • libasio-dev
  • libboost-all-dev
  • libdb++-dev
  • libsrtp2-dev
  • libgeoip-dev (USE_MAXMIND_GEOIP)
  • libpopt-dev (USE_POPT)
  • libcppunit-dev (BUILD_TFM)
  • libnetxx-dev (BUILD_TFM)
  • libqpid-proton-cpp12-dev (BUILD_QPID_PROTON)
  • sox (REGENERATE_MEDIA_SAMPLES)
  • xxd (REGENERATE_MEDIA_SAMPLES)
  • default-libmysqlclient-dev (USE_MYSQL)
  • libfmt-dev (USE_FMT)
  • libgloox-dev (BUILD_ICHAT_GW)
  • libgstreamermm-1.0-dev (USE_GSTREAMER)
  • postgresql-server-dev-all (USE_POSTGRESQL)
  • libradcli-dev (RESIP_HAVE_RADCLI)
  • libsipxtapi-dev (USE_SIPXTAPI)
  • libsnmp-dev (USE_NETSNMP)
  • libpq-dev (USE_SOCI_POSTGRESQL)
  • libsoci-dev (USE_SOCI_POSTGRESQL)
  • libtelepathy-qt5-dev (BUILD_TELEPATHY_CM)
  • libwebsocketpp-dev (USE_KURENTO)
  • libxerces-c-dev
  • perl
  • python3-cxx-dev (BUILD_PYTHON)
  • python3-dev (BUILD_PYTHON)

Building on Windows Systems

Navigate to git root folder where top level CMakeLists.txt file is.

Or to build recon with sipXtapi media support you need to do the following:

> cmake . -DUSE_SIPXTAPI=ON

Or if you plan on using VS GUI you might want to enable the following to get the full sipXtapi projects into the resip solution file:

> cmake . -DUSE_SIPXTAPI=ON -DSIPXTAPI_PROJS_IN_VS_GUI=ON
  • Open resiprocate.sln (from _build folder) in visual studio: Build -> Build Solution
  • Note: If you used -DSIPXTAPI_PROJS_IN_VS_GUI=ON then you must build once before the sipXtapi projects are fetched from GitHub. After this reload the resiprocate.sln and build again. This is only needed after initial setting up the build.
  • If you want to run the unit tests, then right click on the RUN_TESTS project and Build it.

Using CMake from command line

Navigate to git root folder where top level CMakeLists.txt file is.

OR to build recon with sipXtapi media support you need to do the following:

> cmake . -B _build -DUSE_SIPXTAPI=ON

To build navigate to git root folder where top level CMakeLists.txt file is.

> cmake --build _build --config Debug --parallel

For unit tests:

> cd _build
> ctest --build-config Debug --output-on-failure

Using Ninja via Visual Studio GUI

  • Open the resiprocate folder by using Visual Studio Open Folder feature
  • Use CMake GUI for changing CMake build settings and options: Project->CMake Settings for resiprocate
  • Build -> Build All

CMake "cached" variables are used to specify options such as whether c-ares should be used or not. You can get the list with:

You can set them on the command line like:

$ cmake -DWITH_C_ARES=true .

CMake supports rpm/deb?/NSIS to build installable packages using CPack. If this built-in support can not be used we could always specify internal build targets that will run external commands to package the appropriate bundle depending on the platform.

联系我们 contact @ memedata.com