<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17109</bug_id>
          
          <creation_ts>2012-05-18 17:49:29 +0000</creation_ts>
          <short_desc>TURN server API changes</short_desc>
          <delta_ts>2014-04-22 07:02:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>WebRTC API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Prakash">prakashr.ietf</reporter>
          <assigned_to name="Web RTC Working Group">public-webrtc</assigned_to>
          <cc>fluffy</cc>
    
    <cc>public-webrtc</cc>
    
    <cc>rolly</cc>
    
    <cc>stefan.lk.hakansson</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67904</commentid>
    <comment_count>0</comment_count>
    <who name="Prakash">prakashr.ietf</who>
    <bug_when>2012-05-18 17:49:29 +0000</bug_when>
    <thetext>These are some of the questions for TURN server based on read the spec here. http://dev.w3.org/2011/webrtc/editor/webrtc.html

1. The PeerConnection constructor takes in a configuration to specify TURN/STURN server configuration. Currently it states &quot;The configuration string gives the address of a STUN or TURN server to use to establish the connection.&quot;

Shouldn&apos;t we allow to pass two different IPs for STUN and TURN and not restrict either or?

2. The configuration parameter is taken in as a string. Isn&apos;t it easier to make this an object, like we did for &quot;audio video&quot; in getUserMedia?

3. There should be some way for PeerConnection to get a feedback back to Javascript layer in case of an error. A relay/stun server can throw different types of errors, like unauthorized, insufficient capacity. Also username/password have a life time and can expire in a relay server. When this happens, the app will have to refresh the relay server info in some way. So we need a callback/update mechanism for these things. This does not seem to exist currently?

4. How do we pass in a specific username/password for TURN or update it incase a username/password expires?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68022</commentid>
    <comment_count>1</comment_count>
    <who name="Prakash">prakashr.ietf</who>
    <bug_when>2012-05-22 17:56:19 +0000</bug_when>
    <thetext>Here are some suggestions on the API.
--


1. Configuration :

The PeerConnection should take in a array of configuration object instead of a string. 
[NoInterfaceObject]
interface IceConfiguration {
 readonly attribute DOMString type;
 readonly attribute DOMString host;
 readonly attribute short port;
 readonly attribute DOMString username;
 readonly attribute DOMString password;
};

type - one of TURN/TURNS/STUN/STUNS
host -  &lt;hostname/ip&gt;
port - port for STUN/TURN
username - optional username for STUN/TURN
password - optional password for STUN/TURN

The reason for the array is that if STUN/TURN fails, the code may have fall back to STUNS/TURNS. 

Open question: Can users include a separate STUN and TURN server, in which case the provided STUN is used and the TURN server is used for relay purpose only?

Note that startIce() takes in a parameter to say no_relay or only_relay. So the implementation has to use that to decide what to connect and not just based on the values provided in the configuration.

2. Error callbacks.

STUN and TURN can return a number of errors which has to be bubbled up to JS. A summary of error codes are available here. http://www.iana.org/assignments/stun-parameters/stun-parameters.xml#stun-parameters-6 

The options for JS in case of errors are: to either throw it to the user and stop peerconnection if unrecoverable (like relay quota exceeded) or create a new peerconnection (say with a new TURN/STUN configuration - incase of server error or stale credentials) and retry. 

An error callback is passed on to the PeerConnection along with the iceCallback.

[Constructor (DOMString configuration, IceCallback iceCallback, IceErrorCallback iceErrorCallback)]
interface PeerConnection {
 ...
}

The IceErrorCallback takes in an IceError object

[NoInterfaceObject]
interface IceError {
    const unsigned short UNAUTHORIZED = 401;
    ...

    readonly attribute unsigned short code; 
};

code - A subset of http://www.iana.org/assignments/stun-parameters/stun-parameters.xml#stun-parameters-6. To be documented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72121</commentid>
    <comment_count>2</comment_count>
    <who name="Cullen Jennings">fluffy</who>
    <bug_when>2012-08-13 14:42:21 +0000</bug_when>
    <thetext>I think this needs some list discussion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103815</commentid>
    <comment_count>3</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2014-04-14 12:39:20 +0000</bug_when>
    <thetext>A lot has happened in the draft compared to when this bug was filed. I will close it unless someone objects in the next couple of days.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104145</commentid>
    <comment_count>4</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2014-04-22 07:02:31 +0000</bug_when>
    <thetext>There was no comment, so I conclude that this is now fixed (with all updates that has come since the bug was filed).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>