webrtcbin Issue in turn-server property
The turn-server credentials is not being parsed properly in webrtcbin. The issue is happening in the following cases mainly:
-
Username: By default username will be in the form "timestamp:id". The colon in the username is not supported by TURN property. The library is parsing 'timestamp' as username and 'id' as password. The issue is because of the function
_parse_userinfo
in gstwebrtcice.c, where it is expecting ':' as separator between username and password. Eg: If we register a new user with COTURN, say foo, it returns the username as 1543467204:foo -
Password: If the TURN password has slash ('/') character in it, then "Could not parse turn server" error is being thrown by the library. The problem is because of
gst_uri_from_string()
usage in_validate_turn_server()
gstwebrtcice.c which is considering slash to find the end of authority.eoa = uri + strcspn (uri, "/?#");
. Also I tried using base64_encode format, somehow library is not accepting this as well. Eg: The password autogenerated by COTURN could be something like adrJU6svd/M4aAt2hAzCy8qJPXg= , and in base64 encode format it is 69dac953ab2f77f338680b76840cc2cbca893d78
I checked the same credentials with trickle-ice and it is able to resolve the credentials correctly, and gather the TURN server in ICE candidates list, but webrtcbin seems to have problem.
This issue is blocking the usage of turn-server property in webrtcbin. Could anyone recommend a better way to clearly pass credentials to turn-server property? Something like how we pass in webrtc javascript:
var rtc_configuration = {iceServers: [{urls: "turn:<url>:<port>?transport=udp",
credential: "adrJU6svd/M4aAt2hAzCy8qJPXg=",
username: "1543467204:foo"}]