question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

STUN / STUNS uris with a "transport" parameter are rejected

See original GitHub issue

For a stun ICE server such as stun:global.stun.twilio.com:3478?transport=udp The regex in rtcicetransport.py is not relaxed enough…

[2019-03-20 13:06:35,713] [relay.eventing] [ERROR] Event Listener Exception [message]:
Traceback (most recent call last)
10. File "/home/mayfield/project/librelay-python/relay/eventing.py", line 45, in dispatchEvent
      await r
9.  File "/home/mayfield/project/relay-calling-sfu/relay_calling_sfu/main.py", line 115, in onMessage
      await self.controlHandlers[control](exchange)
8.  File "/home/mayfield/project/relay-calling-sfu/relay_calling_sfu/main.py", line 154, in onCallOffer
      await call.addPeerOffer(exchange)
7.  File "/home/mayfield/project/relay-calling-sfu/relay_calling_sfu/call.py", line 191, in addPeerOffer
      await pc.setRemoteDescription(offer)
6.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcpeerconnection.py", line 660, in setRemoteDescription
      transceiver = self.__createTransceiver(direction='recvonly', kind=media.kind)
5.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcpeerconnection.py", line 834, in __createTransceiver
      dtlsTransport = self.__createDtlsTransport()
4.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcpeerconnection.py", line 812, in __createDtlsTransport
      iceGatherer = RTCIceGatherer(iceServers=self.__configuration.iceServers)
3.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcicetransport.py", line 147, in __init__
      ice_kwargs = connection_kwargs(iceServers)
2.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcicetransport.py", line 73, in connection_kwargs
      parsed = parse_stun_turn_uri(uri)
1.  File "/usr/local/lib64/python3.6/site-packages/aiortc/rtcicetransport.py", line 115, in parse_stun_turn_uri
      raise ValueError('malformed uri')
ValueError: malformed uri

The regex for TURN servers includes support for the transport query arg, but stun does not.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lgrahlcommented, Mar 24, 2019

That way of thinking is a bit twisted. aiortc doesn’t suffer from following standards. Twilio does from not following them. There’s absolutely no guarantee that Firefox, or the whole swath of webrtc.org based implementations, keep support for this proprietary extension. To be precise, webrtc.org just ignores the transport parameter - it doesn’t comply with it. I wouldn’t even count on a PSA for a fix for that, so it could break for them any day.

0reactions
mayfieldcommented, Mar 24, 2019

I already added a workaround and I understand the position being taken. But keep in mind you’re on a short list of webrtc implementations that don’t tolerate this; iOS, Android, Safari, Firefox and Chromium accept/ignore the extrainious query args.

It’s unlikely twilio will change, so aiortc is the one that suffers.

On Sun, Mar 24, 2019 at 1:05 PM Jeremy Lainé notifications@github.com wrote:

We’re not the only ones who have come to the conclusion that Twilio’s URL are not RFC-conformant:

onsip/SIP.js#117 https://github.com/onsip/SIP.js/issues/117

I don’t plan to add hacks for such URLs in aiortc so your best option is to drop the query string from the STUN/STUNS uris you receive from Twilio. If you’re a Twilio customer I also suggest you open an issue with them so they can fix it.

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/aiortc/aiortc/issues/157#issuecomment-475989511, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIgNPpmIF70i55QwSORAKEjYv8CtOg3ks5vZ8yOgaJpZM4cAD5p .

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 7350 - Datagram Transport Layer Security (DTLS) as ...
A STUN URI containing an IP address MUST be rejected, unless the domain name is ... The usage of "udp" as a transport...
Read more >
RFC 8489: Session Traversal Utilities for NAT (STUN)
The STUN server copies that source transport address into an XOR-MAPPED- ADDRESS attribute in ... A "stuns" URI containing an IP address MUST...
Read more >
UA Configuration Parameters
Mandatory parameters. uri. SIP URI associated to the User Agent ( String ). ... stun:example.org stuns:example.org stun:example.org:8000 ...
Read more >
Session Traversal Utilities for NAT (STUN) Parameters
STUN Error Codes ; 441, Wrong Credentials, [RFC8656] ; 442, Unsupported Transport Protocol, [RFC8656] ; 443, Peer Address Family Mismatch, [RFC8656].
Read more >
webrtc/api/peerconnection.cc - src - Git at Google
Number of tokens must be preset when TURN uri has transport param. ... STUNS, // Indicates a STUN server used with a TLS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found