WebRTC peerconnection stuck in "connecting" state

869 views
Skip to first unread message

Sean McCann

unread,
Aug 2, 2021, 8:16:44 AM8/2/21
to SIP.js
Hi all,

Every now and then (somewhat sporadic) the WebRTC connection gets stuck in the "connecting" state. Because of this, there is no audio on either side of the call. It only seems to happen when a call is made to the SIP.js client, calls made from the client do not seem to get stuck.

We have tried using smaller self signed certificates (we thought it may have been a DTLS issue) but that hasn't worked. Anyone have any ideas? The phone system is Asterisk.

Thank you.

Slavik Bialik

unread,
Aug 2, 2021, 8:27:55 AM8/2/21
to SIP.js
Hi,
Start by opening a Wireshark on the client and watch for STUN messages (filter with 'stun').
I assume that in cases it's not working you'll see that the PC client will send a STUN request to some IP and will not get a response.
If that's the case, try to follow this lead. Maybe it is not sending it to the correct IP, maybe different transport or maybe some port ranges are blocked towards that target.

Message has been deleted

Sean

unread,
Aug 2, 2021, 4:31:59 PM8/2/21
to SIP.js
Hi, thanks for replying!

We checked out the traces in Wireshark. It looks like STUN is working properly (I've attached a screenshot to show).

STUN.jpg

We noticed sporadic DTLS issues though. When the peer connection is successful the client requests a 208 Client Key Exchange, the server then responds with 308 New Session Ticket, completing the encrypted handshake. However, on failed peer connections the server doesn't seem to respond back with the 308 New Session Ticket, the client then continuously sends requests for the 208 Client Key Exchange which we believe is causing the peer connection to stay in the "connecting" state. I've attached the successful and failed traces below.

DTLS Failure.jpg

DTLS Success.jpg

Any ideas what might be causing the server to not respond to the DTLS request?

Thank you for any help.

On Monday, 2 August 2021 at 18:04:35 UTC+1 Sean wrote:
Hi, I clicked reply to author but my message has not appeared in this thread, did you receive my reply?
Reply all
Reply to author
Forward
0 new messages