在 Raspberry PI 上安装 "ring.cx SIP client"

Installing the "ring.cx SIP client" on a Raspberry PI

情况

我想让基于终端的(无头)SIP 呼叫在我的 Raspberry Pi 上运行,我已经使用 linphone 尝试过:

RaspberryPI: Making SIP outbound calls using linphonec or an alternative SIP soft phone

因为我目前被困在那里,所以我想尝试另一个选项,即 SFLPhone. They pointed me towards the ring 软件项目,它提供了一个守护进程 dring,它允许使用脚本接口进行 SIP 调用:

Indeed, the daemon can run standalone and be controlled using the DBus API.

Note the project have been renamed to "Ring" (version is bumped to 2.x). Experimental packages are available at http://ring.cx/en/documentation/linux-installation A major feature of Ring 2.x is the optional "DHT" account type allowing to make calls without any SIP server. There are many other enhancements such as ICE support, UPnP support, stability improvements etc. (note clients are being re-written (GTK3, Qt5) and there is a new OS X client, they are not yet feature complete and in heavy development.)

The new daemon dring source Git repo URI is : https://gerrit-ring.savoirfairelinux.com/ring . The DBus API is mostly the same as before. In the tools/dringctrl directory you will find an example python client that we use for testing (uses python3-dbus).

We are willing to fix any bugs you may find, the daemon bugtracker is here : https://projects.savoirfairelinux.com/projects/ring-daemon/issues Also look at https://projects.savoirfairelinux.com/projects/ring/wiki for build instruction etc.

Regards and good luck for your embedded project, A. B.

编译依赖项

我尝试编译项目的依赖项,如 README:

中所述
git clone https://gerrit-ring.savoirfairelinux.com/ring
cd ring

先编译依赖

cd ../contrib/
rm -fr native/ && mkdir native
cd native
../bootstrap
make

我收到这个错误:

libvpx.webm-4640a0c4804b/third_party/googletest/src/include/gtest/gtest.h
mv libvpx-4640a0c4804b49f1870d5a2d17df0c7d0a77af2f libvpx && touch libvpx
cd libvpx && CROSS= ./configure --target=armv7-linux-gcc \
    --as=yasm --disable-docs --disable-examples --disable-unit-tests --disable-install-bins --disable-install-docs --enable-realtime-only --enable-error-concealment --disable-runtime-cpu-detect --disable-webm-io --enable-pic --prefix=/home/pi/ring/contrib/arm-linux-gnueabihf
  disabling docs
  disabling examples
  disabling unit_tests
  disabling install_bins
  disabling install_docs
  enabling realtime_only
  enabling error_concealment
  disabling runtime_cpu_detect
  disabling webm_io
  enabling pic
Configuring selected codecs
  enabling vp8_encoder
  enabling vp8_decoder
  enabling vp9_encoder
  enabling vp9_decoder
Configuring for target 'armv7-linux-gcc'
  enabling armv7
  enabling neon
  enabling neon_asm
  enabling media
Unable to invoke compiler: arm-none-linux-gnueabi-gcc  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Configuration failed. This could reflect a misconfiguration of your
toolchains, improper options selected, or another problem. If you
don't see any useful error messages above, the next step is to look
at the configure error log file (config.log) to determine what
configure was trying to do when it died.
../../contrib/src/vpx/rules.mak:105: recipe for target '.vpx' failed
make: *** [.vpx] Error 1

编译环

尽管编译依赖项失败,但我确实尝试编译环:

git clone https://gerrit-ring.savoirfairelinux.com/ring
cd ring
./autogen.sh
./configure
make
make install

这导致了以下错误:

checking for PJPROJECT... no
configure: error: Missing pjproject files
pi@phone ~/ring $     make
make: *** No targets specified and no makefile found.  Stop.
pi@phone ~/ring $     make install
make: *** No rule to make target 'install'.  Stop.

所以目前我卡住了,我担心我无法超越the current state of my project ():

编辑:现在没有视频编解码器(如建议的 aberaud),我 运行 出现以下错误:

/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I../include/opendht -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include -fPIC -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include  -g -fPIC -O3 -std=c++0x -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include  -g -fPIC -O3 -std=c++0x -c -o libopendht_la-dht.lo `test -f 'dht.cpp' || echo './'`dht.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I../include/opendht -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include -fPIC -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include -g -fPIC -O3 -std=c++0x -I/home/pi/sip-desaster/ring/contrib/arm-linux-gnueabihf/include -g -fPIC -O3 -std=c++0x -c dht.cpp  -fPIC -DPIC -o libopendht_la-dht.o
In file included from ../include/opendht/dht.h:29:0,
                 from dht.cpp:27:
../include/opendht/infohash.h:58:22: error: expected initializer before ‘:’ token
dht.cpp:3105:1: error: expected ‘}’ at end of input
Makefile:386: recipe for target 'libopendht_la-dht.lo' failed
make[2]: *** [libopendht_la-dht.lo] Error 1
make[2]: Leaving directory '/home/pi/sip-desaster/ring/contrib/native/opendht/src'
Makefile:395: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/pi/sip-desaster/ring/contrib/native/opendht'
../../contrib/src/opendht/rules.mak:28: recipe for target '.opendht' failed
make: *** [.opendht] Error 2

贡献

Ring 构建的 "contrib" 部分是关于构建目标系统上不可用的依赖项,主要用于在交叉编译时构建完整的工作包或用于没有适当依赖项管理的系统(基本上所有Linux 发行版除外的操作系统)。

contrib/native 目录中时,您可以运行 make list 查看要构建的包列表。由于您正在交叉编译,因此您几乎需要构建所有内容。

如果您以某种方式弄乱了 contrib 构建,您可以安全地删除 contrib/nativecontrib/{target_tuple}(如果有)目录并重新开始。

libvpx

libvpx 库被 libav 用于提供 vp8 和 vp9 视频编解码器。这不是一个硬依赖,因为你的项目不使用视频,你可以安全地禁用它。我们在交叉编译vpx的时候也遇到了问题

contrib/src/libav/rules.mak第70行,DEPS_libav定义了libav的依赖列表。您可以从列表中删除 vpxx264$(DEPS_vpx),因为您不使用视频。您还可以将 speex 和 opus 音频编解码器添加到列表中(它们应该在列表中但不在列表中,请参阅 this patch 作为例子)。

在如上所述清理 contrib 并再次引导后,当 运行ning make listvpxx264 不应出现在 [= 列表中时48=]。然后尝试通过 运行ning make.

构建贡献

如果在尝试此操作后您遇到其他包的相同问题,您可能会遇到某种交叉编译构建路径问题(我需要更多 logs/details)。

作为最后的手段,在 Pi 本身上编译(使用 Raspbian)非常慢,但具有 use local distro-provided dependencies 的优势并消除了交叉编译的麻烦。

祝你好运

我正在提供一个自己的答案,它应该记录我的步骤,这将有希望引导我达到期望的最终结果:

下载资源

git clone https://gerrit-ring.savoirfairelinux.com/ring
cd ring

构建 contrib 部分

根据 @aberaud's 我可以更新 contrib/src/libav/rules.mak 并删除任何与视频相关的依赖项(记住我是无头的):

所以我更改了第 70 行的形式

DEPS_libav = zlib x264 vpx $(DEPS_vpx)

DEPS_libav = zlib opus speex

现在构建 contrib 部分。

cd ../contrib/
rm -fr native/ && mkdir native
cd native
../bootstrap
make

我在尝试编译 contrib 时遇到了同样的错误。

我使用的 Raspbian 版本带有旧版本的 gcc 编译器,版本 4.6。在我升级到 4.8 后,它立即编译。好吧,就像任何东西在 Pi 上编译一样立即。