如何使用 Linphone 核心 API 在两个 IP 地址之间建立 VOIP 呼叫

问题描述 投票:0回答:1

我在协议方面没有任何经验(例如 SIP/SDP/TCP/RTP),但我需要帮助才能在 Linux 计算机中使用 Linphone Lib 或 Linphone 核心 API 来进行 VOIP 呼叫。

我的要求:我想创建自定义应用程序,可以使用 linphone 核心 API 对 Linux 环境的 IP 地址(但不是 SIP 地址或 SIP URI)进行 VoIP 呼叫。

#1。 linphone 端需要设置的主要配置参数是什么? #2.设置配置参数需要调用哪些API

我在 linphone-sdk/liblinphone/coreapi/help/examples/C/* 中看到了一些示例 但这些示例使用 SIP uri 作为输入。

以下是示例中的 API:

   linphone_core_new(); 
   Linphone_core_invite();
   linphone_core_accept_call();
   linphone_core_terminate_call();

等等,

我想利用 Linphone 核心 API 或 Linphone 库,从一端(Linux)拨打电话,然后从另一端(Linux)接收来电。

实际上我不想使用整个Linphone-sdk。

如果有人能在这方面提供帮助,这对我来说将非常有用。 预先感谢。

我尝试在 Linux 中构建 linphone-sdk,然后将所有 .so 文件复制到 Custom 目录中。 我也在自定义目录中添加了 linphone 的 .h 文件。 然后我开始使用 Linphone 的 .so 文件和 .h 文件编译我的代码。 成功构建后执行应用程序,但出现以下错误:

2022-11-17 07:25:56:210 liblinphone-error-Could not find a suitable soundcard with capabilities : 2
2022-11-17 07:25:56:210 liblinphone-error-Could not find a suitable soundcard with capabilities : 2
2022-11-17 07:25:56:210 liblinphone-error-Could not find a suitable soundcard with capabilities : 1
2022-11-17 07:25:56:210 liblinphone-error-Could not find a suitable soundcard with capabilities : 2
2022-11-17 07:25:56:212 bctbx-error-Error in connect: Cannot assign requested address
2022-11-17 07:25:56:212 bctbx-error-Error in connect: Cannot assign requested address
2022-11-17 07:25:56:212 liblinphone-warning-Lime X3DH support is not available
2022-11-17 07:25:59:536 bctbx-error-Error in connect: Cannot assign requested address
2022-11-17 07:25:59:536 liblinphone-error-Unable to determine IP version from signaling operation, no via header found
2022-11-17 07:25:59:537 mediastreamer-warning-Could not apply gain on sent RTP packets: gain control wasn't activated. Use audio_stream_enable_gain_control() before starting the stream.
2022-11-17 07:25:59:537 liblinphone-error-Unable to use audio device [0] as recording device
2022-11-17 07:25:59:537 liblinphone-error-Unable to use audio device [0] as playback device
c++ c voip
1个回答
0
投票

首先,您需要配置您的声卡。不知道你的系统,你可以使用PulseAudio或ALSA。 然后,你可以测试aplay -L和arecord -L

最后,您的 linphone 可以指向声卡 pcm 或使用默认值,该值位于 linphone 配置文件中(可能是 .linphonerc)

如果完成上述所有操作,现在您可以设置到另一个 sip 客户端的 sip 呼叫。您可以拨打两次 sip 呼叫,并将第一个输入读取到第二个输出,并将第二个输入读取到第一个输出。然后你就会得到双向语音。

© www.soinside.com 2019 - 2024. All rights reserved.