Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# WPF "VOIP" app using WebRTC - Net Framework app #1062

Open
skullboypl opened this issue Feb 5, 2024 · 17 comments
Open

C# WPF "VOIP" app using WebRTC - Net Framework app #1062

skullboypl opened this issue Feb 5, 2024 · 17 comments

Comments

@skullboypl
Copy link

My logs below. If somebody from your team can help me with that i will pay.

Received: Text
Received: {"type":"ICE_CANDIDATE","candidate":{"IceServer":null,"candidate":"1345532226 1 udp 2113937663 192.168.100.89 58940 typ host generation 0","sdpMid":null,"sdpMLineIndex":0,"foundation":"1345532226","component":1,"priority":2113937663,"address":"192.168.100.89","protocol":0,"port":58940,"type":0,"tcpType":0,"relatedAddress":null,"relatedPort":0,"usernameFragment":"DGQV","DestinationEndPoint":null},"targetId":"46","fromId":"47"}
Received ICE candidate: {
"IceServer": null,
"candidate": "1345532226 1 udp 2113937663 192.168.100.89 58940 typ host generation 0",
"sdpMid": null,
"sdpMLineIndex": 0,
"foundation": "1345532226",
"component": 1,
"priority": 2113937663,
"address": "192.168.100.89",
"protocol": 0,
"port": 58940,
"type": 0,
"tcpType": 0,
"relatedAddress": null,
"relatedPort": 0,
"usernameFragment": "DGQV",
"DestinationEndPoint": null
}
Adding ICE candidate. 47
Received: Text
Received: {"type":"ICE_CANDIDATE","candidate":{"IceServer":{"TurnTimeToExpiry":"0001-01-01T00:00:00","Protocol":17},"candidate":"2980029153 1 udp 1677730047 MYIPADRESS 58940 typ srflx raddr 0.0.0.0 rport 0 generation 0","sdpMid":"0","sdpMLineIndex":0,"foundation":"2980029153","component":1,"priority":1677730047,"address":"MYIPADRESS","protocol":0,"port":58940,"type":2,"tcpType":0,"relatedAddress":null,"relatedPort":0,"usernameFragment":"DGQV","DestinationEndPoint":null},"targetId":"46","fromId":"47"}
Received ICE candidate: {
"IceServer": {
"TurnTimeToExpiry": "0001-01-01T00:00:00",
"Protocol": 17
},
"candidate": "2980029153 1 udp 1677730047 MYIPADRESS 58940 typ srflx raddr 0.0.0.0 rport 0 generation 0",
"sdpMid": "0",
"sdpMLineIndex": 0,
"foundation": "2980029153",
"component": 1,
"priority": 1677730047,
"address": "MYIPADRESS ",
"protocol": 0,
"port": 58940,
"type": 2,
"tcpType": 0,
"relatedAddress": null,
"relatedPort": 0,
"usernameFragment": "DGQV",
"DestinationEndPoint": null
}
Adding ICE candidate. 47
STUN BindingRequest sent to 108.177.14.127:19302.
STUN BindingSuccessResponse received from 108.177.14.127:19302.
Received: Text
Received: {"type":"ICE_CANDIDATE","candidate":{"IceServer":{"TurnTimeToExpiry":"0001-01-01T00:00:00","Protocol":17},"candidate":"2980029153 1 udp 1677730047 MYIPADRESS 58940 typ srflx raddr 0.0.0.0 rport 0 generation 0","sdpMid":"0","sdpMLineIndex":0,"foundation":"2980029153","component":1,"priority":1677730047,"address":"MYIPADRESS","protocol":0,"port":58940,"type":2,"tcpType":0,"relatedAddress":null,"relatedPort":0,"usernameFragment":"DGQV","DestinationEndPoint":null},"targetId":"46","fromId":"47"}
Received ICE candidate: {
"IceServer": {
"TurnTimeToExpiry": "0001-01-01T00:00:00",
"Protocol": 17
},
"candidate": "2980029153 1 udp 1677730047 MYIPADRESS 58940 typ srflx raddr 0.0.0.0 rport 0 generation 0",
"sdpMid": "0",
"sdpMLineIndex": 0,
"foundation": "2980029153",
"component": 1,
"priority": 1677730047,
"address": "MYIPADRESS",
"protocol": 0,
"port": 58940,
"type": 2,
"tcpType": 0,
"relatedAddress": null,
"relatedPort": 0,
"usernameFragment": "DGQV",
"DestinationEndPoint": null
}
Adding ICE candidate. 47
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
ICE connection state changed to connected.
ICE connection state changed to connected.
Current ice connection status: connected
Peer connection state changed to connecting.
Current connection status: connecting
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
Wątek 0x24b0 zakończył działanie z kodem 0 (0x0).
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
STUN BindingRequest received from 192.168.100.89:58940.
STUN BindingSuccessResponse sent to 192.168.100.89:58940.
STUN BindingRequest sent to 192.168.100.89:58940.
STUN BindingErrorResponse received from 192.168.100.89:58940.
Zgłoszony wyjątek: „System.TimeoutException” w SIPSorcery.dll
Zgłoszony wyjątek: „Org.BouncyCastle.Crypto.Tls.TlsFatalAlert” w BouncyCastle.Crypto.dll
Peer connection state changed to closed.
Current connection status: closed
Peer connection state changed to failed.
Current connection status: failed"

@skullboypl skullboypl changed the title C# WPF "VOIP" app using WebRTP C# WPF "VOIP" app using WebRTC Feb 5, 2024
@skullboypl skullboypl changed the title C# WPF "VOIP" app using WebRTC C# WPF "VOIP" app using WebRTC - Net Framework app Feb 5, 2024
@sipsorcery
Copy link
Member

There is no "team" or anyone to pay. This library is an open source project without any support options other than what interested volunteers contribute.

Your logs are showing that STUN messages are able to get through to the remote peer, and the ICE connection is established. The DTLS connection attempt then timesout. It can be very tricky to track down these types of issues unless there is some telltale log message, which in this case there does not appear to be. The next best option is to use WireShark on the remote peer to determine what's going on with the DTLS connection attempt.

@skullboypl
Copy link
Author

Did you ever try to make "VOIP" using C# WPF (.NET or .NET Framework) on WebRTC? And have time to help? i will check that WireShark but i never use it

@sipsorcery
Copy link
Member

Did you ever try to make "VOIP" using C# WPF (.NET or .NET Framework) on WebRTC?

No. The softphone app is WPF but it's SIP rather than WebRTC,

@skullboypl
Copy link
Author

1

Here is ss of filtred by ip of my friend that i try to connect to.

Any possibity to make a meet and you will help me with config for my project?

@skullboypl
Copy link
Author

i even change project to .NET 8 and still same

@sipsorcery
Copy link
Member

Looks like a NAT issue. The remote connection is not getting any of your connection's STUN responses which suggests they are being blocked.

You could try a TURN server if you can find a public one or are able to run your own on a public IP address. Coturn is one I have installed in the past.

@skullboypl
Copy link
Author

How I can connect TRUN in SIPSorcery?

@skullboypl
Copy link
Author

i have my own Coturn on dedicated server

@sipsorcery
Copy link
Member

When creating the RTCPeerConnection you can specify TURN servers. Search the code for RTCIceServer:

 var iceServers = new List<RTCIceServer> {
 new RTCIceServer
     {
         urls = $"turn:{mockTurnServer.ListeningEndPoint}",
     }
 };

@skullboypl
Copy link
Author

i have tested this like that"
private const string STUN_URL = "stun:stun.sipsorcery.com"; private const string TURN_URL = "turn:m.vxh.pl:3478";

and then RTCConfiguration config = new RTCConfiguration { iceServers = new List<RTCIceServer> { new RTCIceServer { urls = STUN_URL }, new RTCIceServer // TURN server { urls = TURN_URL, // Adres serwera TURN credential = "MYPASSWORDHERE", // Hasło/sekret dla serwera TURN } } };

and still same problem

@sipsorcery
Copy link
Member

Unusual for your TURN server not to have a username. Either way you should be getting a response from it even if it's unauthorised.

Can you post the logs with the TURN server attempt?

@skullboypl
Copy link
Author

i create an user now and set iceServers = new List<RTCIceServer> { new RTCIceServer { urls = STUN_URL }, new RTCIceServer // TURN server { urls = TURN_URL, // Adres serwera TURN username = TURN_USERNAME, // Nazwa użytkownika credential = TURN_PASSWORD // Hasło } }

i will check it now

@skullboypl
Copy link
Author

Still same issue: Zgłoszony wyjątek: „System.TimeoutException” w SIPSorcery.dll
Zgłoszony wyjątek: „Org.BouncyCastle.Crypto.Tls.TlsFatalAlert” w BouncyCastle.Crypto.dll
Peer connection state changed to closed.
Zgłoszony wyjątek: „System.Net.Sockets.SocketException” w System.Net.Sockets.dll
Current connection status: closed
Peer connection state changed to failed.
Current connection status: failed
Connection failed. failed

@skullboypl
Copy link
Author

in coturn status: "
Feb 08 23:08:58 m turnserver[3883098]: 422: : session 003000000000000008: realm <m.vxh.pl> user <>: incoming packet BINDING processed, success
"

@skullboypl
Copy link
Author

I tested TURN server here: "https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/" and works fine

@skullboypl
Copy link
Author

I will leave turn server with:
private const string TURN_URL = "turn:m.vxh.pl:3478"; private const string TURN_USERNAME = "skullboypl"; private const string TURN_PASSWORD = "asvdasvw12431v51";

so you can help me. Later i will change data

@GeorgeS2019
Copy link

@sipsorcery

Do we have integration tests that help us to understand what are needed to tests to get a working VOIP basic app based on WebRTC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants