@@ -95,14 +95,13 @@ void SetSctpSettings(SctpSettings s) { impl::Init::Instance().setSctpSettings(st
95
95
96
96
UnhandledStunRequestCallback unboundStunCallback;
97
97
98
- void InvokeUnhandledStunRequestCallback (const juice_stun_binding_t *info, void *user_ptr) {
98
+ void InvokeUnhandledStunRequestCallback (const juice_mux_binding_request *info, void *user_ptr) {
99
99
PLOG_DEBUG << " Invoking Unbind STUN listener" ;
100
100
auto callback = static_cast <UnhandledStunRequestCallback *>(user_ptr);
101
101
102
102
(*callback)({
103
- .ufrag = std::string (info->ufrag ),
104
- .pwd = std::string (info->pwd ),
105
- .family = info->family ,
103
+ .localUfrag = std::string (info->local_ufrag ),
104
+ .remoteUfrag = std::string (info->remote_ufrag ),
106
105
.address = std::string (info->address ),
107
106
.port = info->port
108
107
});
@@ -115,7 +114,8 @@ void OnUnhandledStunRequest ([[maybe_unused]] std::string host, [[maybe_unused]]
115
114
if (callback == NULL ) {
116
115
PLOG_DEBUG << " Removing unhandled STUN request listener" ;
117
116
118
- if (juice_unbind_stun () < 0 ) {
117
+ // call with NULL callback to unbind
118
+ if (juice_mux_listen (host.c_str (), port, NULL , NULL ) < 0 ) {
119
119
throw std::runtime_error (" Could not unbind STUN listener" );
120
120
}
121
121
unboundStunCallback = NULL ;
@@ -131,7 +131,7 @@ void OnUnhandledStunRequest ([[maybe_unused]] std::string host, [[maybe_unused]]
131
131
132
132
unboundStunCallback = std::move (callback);
133
133
134
- if (juice_bind_stun (host.c_str (), port, &InvokeUnhandledStunRequestCallback, &unboundStunCallback) < 0 ) {
134
+ if (juice_mux_listen (host.c_str (), port, &InvokeUnhandledStunRequestCallback, &unboundStunCallback) < 0 ) {
135
135
throw std::invalid_argument (" Could add listener for unhandled STUN requests" );
136
136
}
137
137
#endif
0 commit comments