Open multi opened 1 year ago
Also, it doesn't work with the pre-built binaries from here. Tried with universal 1.3.0
@oksakhartman
Not sure if related, but
pjproject-git 2.13.r79.gf60d1c4-1 - built with
I can paste the whole config_site.h
if needed ...
Here's the configure command
./configure \
--prefix=/usr \
--enable-epoll \
--with-external-speex \
--with-external-srtp \
--with-external-gsm \
--disable-video \
--disable-sound \
--enable-shared
@oksakhartman I've managed to test some scenarios :)
A - tg2sip (and Asterisk) B - iOS, latest tg C - iOS, linphone D - Android, latest tg E - Android, latest tg X F - macos, latest tg client G - macos, chrome web z H - macos, linphone
H -> A -> B - no audio B -> A -> H - no audio H -> A -> D - works H -> A -> E - works C -> A -> H - works C -> A -> G - can't answer, the web client says "You need to upgrade to latest version..." From there I've downloaded F (macos tg client) C -> A -> F - works (audio connects after 2-3 seconds delay) D -> A -> H - works E -> A -> H - works C -> A -> D - works C -> A -> E - works E -> B - no audio (emojis match) D -> B - works G -> B - works F -> B - works
Not sure, why few of the calls had audio (also, 7-8 in a row), between H -> A -> B ? I'm starting to suspect, that if the call gets "routed" through "udp reflector" that "accepts" version 2.4.4 - it works :/
Here are the changes that I've made to get branch feature/libtgvoip-update building without errors
using tdlib commit id b3ab664a18f8611f4dfcd3054717504271eeaa7a
(few commits after that, the lib apis changes and doesn't work anymore with the implementation here in tg2sip)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8507dbe..9d76659 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ add_subdirectory(libtgvoip)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
-find_package(Td 1.7.10 REQUIRED)
+find_package(Td 1.8.0 REQUIRED)
find_package(spdlog 0.17 REQUIRED)
pkg_check_modules(PJSIP libpjproject>=2.8 REQUIRED)
pkg_check_modules(OPUS opus REQUIRED)
@@ -57,4 +57,4 @@ target_include_directories(gen_db PRIVATE
include)
target_link_libraries(gen_db PRIVATE
- Td::TdStatic)
\ No newline at end of file
+ Td::TdStatic)
diff --git a/tg2sip/queue.h b/tg2sip/queue.h
index bfe1fa0..fb98706 100755
--- a/tg2sip/queue.h
+++ b/tg2sip/queue.h
@@ -21,6 +21,7 @@
#include <mutex>
#include <queue>
#include <condition_variable>
+#include <optional>
template<typename T>
class OptionalQueue {
diff --git a/tg2sip/sip.cpp b/tg2sip/sip.cpp
index 06672a6..8dccc9d 100755
--- a/tg2sip/sip.cpp
+++ b/tg2sip/sip.cpp
@@ -185,10 +185,10 @@ void Client::init_pj_endpoint(Settings &settings, LogWriter *sip_log_writer) {
// and TG audio port clock rate so we MUST force
// using 48kHz codecs for all SIP calls
std::string codecId = settings.raw_pcm() ? "L16/48000/1" : "opus/48000/2";
- CodecInfoVector codecVector = ep.codecEnum();
+ CodecInfoVector2 codecVector = ep.codecEnum2();
- for (auto const &value : codecVector) {
- ep.codecSetPriority(value->codecId, (pj_uint8_t) (value->codecId == codecId ? 255 : 0));
+ for (auto const value : codecVector) {
+ ep.codecSetPriority(value.codecId, (pj_uint8_t) (value.codecId == codecId ? 255 : 0));
}
TransportConfig t_cfg;
@@ -309,4 +309,4 @@ void Client::DialDtmf(pjsua_call_id call_id, const string &dtmf_digits) {
auto call = it->second;
call->dialDtmf(dtmf_digits);
-}
\ No newline at end of file
+}
diff --git a/tg2sip/utils.cpp b/tg2sip/utils.cpp
index c8da02b..60b5df9 100644
--- a/tg2sip/utils.cpp
+++ b/tg2sip/utils.cpp
@@ -15,7 +15,8 @@
* along with this program; If not, see <https://www.gnu.org/licenses/>.
*/
+#include <regex>
#include <algorithm>
#include "utils.h"
-bool is_digits(const std::string &str) { return std::all_of(str.begin(), str.end(), ::isdigit); };
\ No newline at end of file
+bool is_digits(const std::string &str) { return std::regex_search(str, std::regex( "\\d+" )); };
@oksakhartman Yup, few calls had audio. Maybe 10 out of ~200 :) Also, one time it worked for 5-6 calls made in a row, then after restarting tg2sip doesn't worked anymore (still not worked from that time) :/
Looks like a bug, yeah ... If it was a "rejection" from deprecation, it shouldn't worked at all :)
@oksakhartman
I switched to a fork on webrtc
Can you elaborate more on that? Where, how, any hints/tips/steps would be helpful! :)
I switched to a fork on webrtc
I will be grateful if you provide compiled x64 binaries for tests
Can you elaborate more on that? Where, how, any hints/tips/steps would be helpful! :)
https://github.com/TelegramMessenger/Telegram-iOS/releases/tag/build-25451
hi i see some fixes with calls here maybe ios client is fixed now
you can try test it if you want)
We tested - no voice :(
We tested - no voice :(
https://github.com/TelegramMessenger/Telegram-iOS/releases/tag/build-25780
No voice :(
No voice :(
вроде уже работает на айфонах
Что значит вроде, вы тестировали?
No voice :(
вроде уже работает на айфонах
Протестировали, голоса нету.
Hi there, i'm having troubles getting the audio rtp streams working, it doesn't "starts" 99% of the times. The SIP signalling works, I'm trying a SIP->TG call, the mobile phone (tg) rings, but on answer - there's no audio.
Asterisk - on real IP (in the logs - 192.168.1.6 is the internal address in the DMZ) tg2sip (running branch feature/libtgvoip-update) - using opus (running on the same machine)
I've saw few times
First audio packet - setting state to ESTABLISHED
and then the audio started. As far as I understand, there's no STREAM_DATA* packet for some reason?! Not sure if it's a networking/latency issue on my side or something else? Any hints are welcome :)I've tried with
1)
jitter_initial_delay_60=4
- it worked 10 times in a row, after restarting tg2sip doesn't worked anymore2) ptime 20, instead of 10 (in sip.cpp)
ep_cfg.medConfig.audioFramePtime = 20; ep_cfg.medConfig.ptime = 20;
No audio
With audio
No audio log
Audio wokring