diff --git a/deps/libjuice b/deps/libjuice index ac7d25205..2fb91a3c9 160000 --- a/deps/libjuice +++ b/deps/libjuice @@ -1 +1 @@ -Subproject commit ac7d2520527e8d4e74386a0e400da927aaf865c6 +Subproject commit 2fb91a3c90b9e5bde2f3cb0ecb4f53b9af027eca diff --git a/include/rtc/global.hpp b/include/rtc/global.hpp index b76bdc91f..2c5a73fe6 100644 --- a/include/rtc/global.hpp +++ b/include/rtc/global.hpp @@ -35,9 +35,8 @@ RTC_CPP_EXPORT void Preload(); RTC_CPP_EXPORT std::shared_future Cleanup(); RTC_CPP_EXPORT struct UnhandledStunRequest { - optional ufrag; - optional pwd; - uint8_t family; + optional localUfrag; + optional remoteUfrag; std::string address; uint16_t port; }; diff --git a/src/global.cpp b/src/global.cpp index b6dd33aec..cda4646ca 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -95,14 +95,13 @@ void SetSctpSettings(SctpSettings s) { impl::Init::Instance().setSctpSettings(st UnhandledStunRequestCallback unboundStunCallback; -void InvokeUnhandledStunRequestCallback (const juice_stun_binding_t *info, void *user_ptr) { +void InvokeUnhandledStunRequestCallback (const juice_mux_binding_request *info, void *user_ptr) { PLOG_DEBUG << "Invoking Unbind STUN listener"; auto callback = static_cast(user_ptr); (*callback)({ - .ufrag = std::string(info->ufrag), - .pwd = std::string(info->pwd), - .family = info->family, + .localUfrag = std::string(info->local_ufrag), + .remoteUfrag = std::string(info->remote_ufrag), .address = std::string(info->address), .port = info->port }); @@ -115,7 +114,8 @@ void OnUnhandledStunRequest ([[maybe_unused]] std::string host, [[maybe_unused]] if (callback == NULL) { PLOG_DEBUG << "Removing unhandled STUN request listener"; - if (juice_unbind_stun() < 0) { + // call with NULL callback to unbind + if (juice_mux_listen(host.c_str(), port, NULL, NULL) < 0) { throw std::runtime_error("Could not unbind STUN listener"); } unboundStunCallback = NULL; @@ -131,7 +131,7 @@ void OnUnhandledStunRequest ([[maybe_unused]] std::string host, [[maybe_unused]] unboundStunCallback = std::move(callback); - if (juice_bind_stun(host.c_str(), port, &InvokeUnhandledStunRequestCallback, &unboundStunCallback) < 0) { + if (juice_mux_listen(host.c_str(), port, &InvokeUnhandledStunRequestCallback, &unboundStunCallback) < 0) { throw std::invalid_argument("Could add listener for unhandled STUN requests"); } #endif