-
Notifications
You must be signed in to change notification settings - Fork 4
/
msortc-rs5.html
5506 lines (5000 loc) · 252 KB
/
msortc-rs5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Microsoft Object RTC (ORTC) Implementation</title>
<meta charset='utf-8'>
<script src="respec-w3c-common.js" async class="remove"></script>
<script src="respec-config.js" class="remove"></script>
</head>
<body>
<section id="abstract">
<p>This document describes enhancements to the Microsoft Edge ORTC API under consideration for future
releases of Windows 10. Since these enhancements have not been approved for implementation, they
are by nature speculative, and may not be implemented in present or future
Windows Insider Preview builds.</p>
<p>The Microsoft Edge ORTC API implementation differs from the most recent version of the
<a href="http://draft.ortc.org/">ORTC API</a> since ORTC has continued to evolve since the development of
Microsoft Edge got underway. In addition, Microsoft Edge does not implement every object or method
within the ORTC API, and includes some extensions not currently incorporated within the specification.
Since both Microsoft Edge and this document represent works-in-progress, the behavior of Microsoft Edge can
change substantially from build-to-build. Please bring questions, errors and omissions to the attention of the
Edge RTC team (Bernard Aboba, bernarda@microsoft and Shijun Sun, shijuns@microsoft.com).
</p>
</section>
<section id='sotd'>
</section>
<section id="overview*">
<h2><span class="secno"> </span>Overview</h2>
<p>Microsoft's Object Real-Time Communications (ORTC) API implementation enables the development of realtime communications applications.
Within Microsoft's implementation,
the relationship between the application and the objects, as well
as between the objects themselves is shown below.
Horizontal or slanted arrows denote the flow of media or data,
whereas vertical arrows denote interactions via methods and events.
</p>
<img alt="The non-normative ORTC Big Picture Diagram" src="images/msortc-big-picture-revised.svg" style="width:100%" />
<p>In the figure above, the <code><a>RTCRtpSender</a></code> (<a href="#rtcrtpsender*">Section 6</a>) encodes the
track provided as input, which is transported over a <code><a>RTCDtlsTransport</a></code>
(<a href="#rtcdtlstransport*">Section 4</a>) or an <code><a>RTCSrtpSdesTransport</a></code>
(<a href="#rtcsrtpsdestransport*">Section 5</a>).</p>
<p>The <code><a>RTCDtlsTransport</a></code> and <code><a>RTCSrtpSdesTransport</a></code> utilize an <code><a>RTCIceTransport</a></code>
(<a href="#rtcicetransport*">Section 3</a>) to select a communication path to reach the
receiving peer's <code><a>RTCIceTransport</a></code>, which is in turn associated with
an <code><a>RTCDtlsTransport</a></code> or <code><a>RTCSrtpSdesTransport</a></code> which de-multiplexes
media to the <code><a>RTCRtpReceiver</a></code> (<a href="#rtcrtpreceiver*">Section 7</a>).
The <code><a>RTCRtpReceiver</a></code> then decodes media, producing a track which is rendered
by an audio or video tag.</p>
<p>Several other objects also play a role.
The <code><a>RTCIceGatherer</a></code> (<a href="#rtcicegatherer*">Section 2</a>)
gathers local ICE candidates for use by a single
<code><a>RTCIceTransport</a></code> object. The <code><a>MSRTCConfConfig</a></code>
(<a href="#msrtcconfconfig*">Section 8</a>) configures <code><a>RTCIceGatherer</a></code> objects.
Sending of Dual Tone Multi Frequency (DTMF) tones is supported via the
<code><a>RTCDtmfSender</a></code> (<a href="#rtcdtmfsender*">Section 10</a>).</p>
<p>Remaining sections of the specification fill in details relating to RTP capabilities and parameters,
operational statistics and compatibility with the
WebRTC 1.0 API.
RTP dictionaries are described in <a href="#rtcrtpdictionaries*">Section 9</a>,
the Statistics API is described in <a href="#statistics-api">Section 11</a>,
Microsoft extensions related to the H.264UC codec [[MS-H264PF]] and statistics are described in
<a href="#msextensions*">Section 12</a>,
an event summary is provided in <a href="#event-summary">Section 13</a>,
a list of error codes is provided in <a href="#error-codes*">Section 14</a>
and WebRTC 1.0 compatibility issues are discussed in <a href="#webrtc-compat*">Section 15</a>.</p>
<p>Complete examples are provided in <a href="#examples*">Section 16</a>.</p>
<div class="note">
<p>Edge Interop Note: Since Microsoft Edge does not implement the data channel,
the <code>RTCDataChannel</code> and <code>RTCSctpTransport</code> objects are not supported.</p>
</div>
<section>
<h3>Terminology</h3>
<p>The <code><a href=
"http://dev.w3.org/html5/spec/webappapis.html#eventhandler">EventHandler</a></code>
interface represents a callback used for event handlers as defined in
[[!HTML5]].</p>
<p>The concepts <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">queue a
task</a></dfn> and <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#fire-a-simple-event">fires a
simple event</a></dfn> are defined in [[!HTML5]].</p>
<p>The terms <dfn>event</dfn>, <dfn><a href=
"http://dev.w2.org/html5/spec/webappapis.html#event-handlers">event
handlers</a></dfn> and <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#event-handler-event-type">event
handler event types</a></dfn> are defined in [[!HTML5]].</p>
<p>The terms <dfn>MediaStream</dfn> and <dfn>MediaStreamTrack</dfn>
are defined in
[[!GETUSERMEDIA]].</p>
<p>For Scalable Video Coding (SVC), the terms single-session transmission (<dfn>SST</dfn>) and multi-session transmission (<dfn>MST</dfn>)
are defined in [[RFC6190]]. This specification only supports <a>SST</a> but not <a>MST</a>.
The term Single Real-time transport protocol stream Single Transport (<dfn>SRST</dfn>),
defined in [[RFC7656]] Section 3.7, refers to an SVC implementation that transmits all layers within a
single transport, using a single Real-time Transport Protocol (RTP) stream and synchronization source (SSRC).
The term Multiple RTP stream Single Transport (<dfn>MRST</dfn>), also defined in [[RFC7656]] Section 3.7, refers
to an implementation that transmits all layers within a single transport, using multiple RTP streams with
a distinct SSRC for each layer.</p>
</section>
</section>
<section id="rtcicegatherer*">
<h2><dfn>RTCIceGatherer</dfn> Interface</h2>
<p>
The <code>RTCIceGatherer</code> gathers local host, server reflexive and relay candidates, as
well as enabling the retrieval of local Interactive Connectivity Establishment (ICE) parameters which can be exchanged in signaling.
</p>
<section id="rtcicegatherer-overview*">
<h3>Overview</h3>
<p>The Microsoft Edge implementation of the <code><a>RTCIceGatherer</a></code> does not support
the <var>component</var> or <var>state</var> attributes, nor does it support the
<code>close()</code> method or the <code>ongatherstatechange</code> event handler.
</p>
<div class="note">
<p>Edge Interop Note: In the Microsoft Edge implementation, an <code><a>RTCIceGatherer</a></code> instance can only
be associated to a single <code><a>RTCIceTransport</a></code>
object. As a result, forking scenarios are not supported.
The <code><a>RTCIceGatherer</a></code> prunes local candidates when its
associated <code><a>RTCIceTransport</a></code> object enters the "completed" state.
</p>
</div>
<p>As noted in [[!RFC5245]] Section 7.1.2.2, an incoming connectivity check contains an <code>ICE-CONTROLLING</code>
or <code>ICE-CONTROLLED</code> attribute, depending on the role of the ICE agent initiating the check.
Since an <code><a>RTCIceGatherer</a></code> object does not have a role, it cannot determine whether
to respond to an incoming connectivity check with a 487 (Role Conflict) error; however, it can validate
that an incoming connectivity check utilizes the correct local username fragment and password,
and if not, can respond with an
401 (Unauthorized) error, as described in [[!RFC5389]] Section 10.1.2.</p>
<p>For incoming connectivity checks that pass validation, the <code><a>RTCIceGatherer</a></code>
<em class="rfc2119" title="MUST">MUST</em>
buffer incoming connectivity checks so as to be able to provide them to associated
<code><a>RTCIceTransport</a></code> objects so that they can respond.</p>
</section>
<section id="rtcicegatherer-operation*">
<h3>Operation</h3>
<p>An <code><a>RTCIceGatherer</a></code> instance is constructed from an
<code><a>RTCIceGatherOptions</a></code> object and an optional <code><a>MSRTCConfConfig</a></code> object.
. If <code><a>RTCIceGatherOptions</a>.portRange</code>
is invalid (e.g. <code>portRange.max</code> < <code>portRange.min</code>),
throw an <code>InvalidParameters</code> exception.</p>
</section>
<section id="rtcicegatherer-interface-definition*">
<h3>Interface Definition</h3>
<dl class="idl" title="[Constructor(RTCIceGatherOptions options, optional MSRTCConfConfig config)] interface RTCIceGatherer : RTCStatsProvider">
<dt>readonly attribute RTCIceComponent component</dt>
<dd><p>The component-id of the <code><a>RTCIceGatherer</a></code>.</p></dd>
<dt>RTCIceParameters getLocalParameters()</dt>
<dd><p>Obtain the ICE parameters of the <code><a>RTCIceGatherer</a></code>.</p></dd>
<dt>sequence<RTCIceCandidate> getLocalCandidates()</dt>
<dd><p>Retrieve the sequence of valid local candidates associated with the
<code><a>RTCIceGatherer</a></code>.
This retrieves all unpruned local candidates currently known (except for peer reflexive candidates),
even if an <code><a>onlocalcandidate</a></code>
event hasn't been processed yet. In Microsoft Edge, if <code>getLocalCandidates()</code> is called prior to emitting of the
first candidate, an exception is thrown.
</p></dd>
<dt>RTCIceGatherer createAssociatedGatherer()</dt>
<dd><p>Create an associated <code><a>RTCIceGatherer</a></code> for RTCP, with the same
<code><a>RTCIceParameters</a></code> and <code><a>RTCIceGatherOptions</a></code>.
If an <code><a>RTCIceGatherer</a></code> calls the method more than once,
or if <var>component</var> is "RTCP", throw
an <code>InvalidStateError</code> exception.
</p></dd>
<dt>attribute EventHandler? onerror</dt>
<dd><p>This event handler, of event handler type <code>error</code>,
<em class="rfc2119" title="MUST">MUST</em> be supported by all objects
implementing the <code><a>RTCIceGatherer</a></code> interface.
If TURN credentials are invalid, or a port cannot be allocated for a local ICE candidate, then this event <em class="rfc2119" title="MUST">MUST</em>
be fired.
</p></dd>
<dt>attribute EventHandler? onlocalcandidate</dt>
<dd><p>This event handler, of event handler event type <code>icecandidate</code>, uses
the <code><a>RTCIceGathererEvent</a></code> interface.
It <em class="rfc2119" title="MUST">MUST</em> be supported by all objects implementing the
<code><a>RTCIceGatherer</a></code> interface.
It receives events when a new local ICE candidate is available. Since ICE candidate gathering begins once
an <code><a>RTCIceGatherer</a></code> object is created,
<code>candidate</code> events are queued until an <code>onlocalcandidate</code> event handler is assigned.
When the final candidate is gathered, a <code>candidate</code> event occurs with an <code>RTCIceCandidateComplete</code> emitted.
</p></dd>
</dl>
</section>
<section id="rtciceparameters*">
<h3><dfn>RTCIceParameters</dfn> Dictionary</h3>
<p>
The <code>RTCIceParameters</code> dictionary includes the ICE username fragment and password, as well as an indication of whether ICE lite is supported.
</p>
<dl class="idl" title="dictionary RTCIceParameters">
<dt>DOMString usernameFragment</dt>
<dd><p>ICE username.</p></dd>
<dt>DOMString password</dt>
<dd><p>ICE password.</p></dd>
<dt>boolean? iceLite</dt>
<dd>Whether ICE lite is supported (true) or not (false). If unset, ICE lite is not supported.
Since browsers support full ICE, <code>getLocalParameters().iceLite</code> MUST NOT be set. This
attribute is only set in remote parameters signaled by a remote peer (such as a gateway) that only supports ICE lite.</dd>
</dl>
</section>
<section id="rtcicecandidate*">
<h3><dfn>RTCIceCandidate</dfn> Dictionary</h3>
<p>
The <code>RTCIceCandidate</code> dictiontary includes information relating to an ICE candidate.
</p>
<pre xml:space="preserve" class='example highlight'>
foundation: "abcd1234",
priority: 1694498815,
ip: "192.0.2.33",
protocol: "udp",
port: 10000,
type: "host"
};
</pre>
<dl class="idl" title="typedef (RTCIceCandidate or RTCIceCandidateComplete) RTCIceGatherCandidate">
</dl>
<dl class="idl" title="dictionary RTCIceCandidate">
<dt>DOMString foundation</dt>
<dd>
<p>A unique identifier that allows ICE to correlate candidates that appear on multiple <code><a>RTCIceTransport</a></code>s.</p>
</dd>
<dt>unsigned long priority</dt>
<dd><p>The assigned priority of the candidate. This is automatically populated by the browser.</p></dd>
<dt>DOMString ip</dt>
<dd><p>The IP address of the candidate.</p></dd>
<dt>RTCIceProtocol protocol</dt>
<dd><p>The protocol of the candidate (UDP/TCP).</p></dd>
<dt>unsigned short port</dt>
<dd><p>The port for the candidate.</p></dd>
<dt>DOMString interfaceType</dt>
<dd><p>The interface type for the candidate. Types include "lan", "wlan", "wwan" and "vpn".
Not supported in Microsoft Edge.</p></dd>
<dt>RTCIceCandidateType type</dt>
<dd><p>The type of candidate.</p></dd>
<dt>RTCIceTcpCandidateType tcpType=null</dt>
<dd><p>The type of TCP candidate.</p></dd>
<dt>DOMString relatedAddress=""</dt>
<dd>
<p>For candidates that are derived from others, such as relay or reflexive candidates, the <dfn>relatedAddress</dfn>
refers to the candidate that these are derived from. For host candidates, the <var>relatedAddress</var>
is set to the empty string.</p>
</dd>
<dt>unsigned short relatedPort=null</dt>
<dd>
<p>For candidates that are derived from others, such as relay or reflexive candidates, the <dfn>relatedPort</dfn>
refers to the host candidate that these are derived from. For host candidates, the <var>relatedPort</var>
is null.</p>
</dd>
<dt>DOMString msMTurnSessionId</dt>
<dd><p>The assigned MTURN session identifier of the candidate. This is only set when an MSTURN URI is provided in the <code><a>RTCIceServer</a></code> object.</p></dd>
</dl>
<section>
<h4><dfn>RTCIceProtocol</dfn> Enum</h4>
<p>
The <code>RTCIceProtocol</code> provides the protocol of the ICE candidate.
</p>
<dl class="idl" title="enum RTCIceProtocol">
<dt>udp</dt>
<dd><p>A UDP candidate, as described in [[!RFC5245]].</p></dd>
<dt>tcp</dt>
<dd><p>A TCP candidate, as described in [[!RFC6544]].</p></dd>
</dl>
</section>
<section>
<h4><dfn>RTCIceTcpCandidateType</dfn> Enum</h4>
<p>
The <code>RTCIceTcpCandidateType</code> provides the type of the ICE TCP candidate, as described in [[!RFC6544]].
Browsers MUST gather active TCP candidates and only active TCP candidates.
Servers and other endpoints MAY gather active, passive or so candidates.
</p>
<dl class="idl" title="enum RTCIceTcpCandidateType">
<dt>active</dt>
<dd><p>An active TCP candidate is one for which the transport will
attempt to open an outbound connection but will not receive incoming
connection requests.</p></dd>
<dt>passive</dt>
<dd><p>A passive TCP candidate is one for which the transport
will receive incoming connection attempts but not attempt a
connection.</p></dd>
<dt>so</dt>
<dd><p>An so candidate is one for which the transport will attempt
to open a connection simultaneously with its peer.</p></dd>
</dl>
</section>
<section>
<h4><dfn>RTCIceCandidateType</dfn> Enum</h4>
<p>
The <code>RTCIceCandidateType</code> provides the type of the ICE candidate.
</p>
<dl class="idl" title="enum RTCIceCandidateType">
<dt>host</dt>
<dd><p>A host candidate.</p></dd>
<dt>srflx</dt>
<dd><p>A server reflexive candidate.</p></dd>
<dt>prflx</dt>
<dd><p>A peer reflexive candidate.</p></dd>
<dt>relay</dt>
<dd><p>A relay candidate.</p></dd>
</dl>
</section>
</section>
<section id="rtcicecandidatecomplete*">
<h3><dfn>RTCIceCandidateComplete</dfn> Dictionary</h3>
<p>
The <code>RTCIceCandidateComplete</code> dictionary signifies that all <code>RTCIceCandidate</code>s are gathered.
<p>
<dl class="idl" title="dictionary RTCIceCandidateComplete">
</dl>
</section>
<section>
<h4>RTCIceGathererEvent</h4>
<p>The <code>icecandidate</code> event of the <code><a>RTCIceGatherer</a></code> object uses
the <code><a>RTCIceGathererEvent</a></code> interface.</p>
<p>Firing an
<code><a>RTCIceGathererEvent</a></code> event named
<var>e</var> with an <code><a>RTCIceGatherCandidate</a></code>
<var>candidate</var> means that an event with the name <var>e</var>,
which does not bubble (except where otherwise stated) and is not
cancelable (except where otherwise stated), and which uses the
<code><a>RTCIceGathererEvent</a></code> interface with the
<var>candidate</var> attribute set to the new ICE candidate,
<em class="rfc2119" title="MUST">MUST</em> be
created and dispatched at the given target.</p>
<dl class="idl" data-merge="RTCIceGathererEventInit" title=
"[Constructor(DOMString type, RTCIceGathererEventInit eventInitDict)] interface RTCIceGathererEvent : Event">
<dt>readonly attribute RTCIceGatherCandidate candidate</dt>
<dd>
<p>The <var>candidate</var> attribute is the
<code><a>RTCIceGatherCandidate</a></code> object with the new ICE
candidate that caused the event.
If <var>candidate</var> is of type <code>RTCIceCandidateComplete</code>,
there are no additional candidates.
</p>
</dd>
</dl>
<dl class="idl" title=
"dictionary RTCIceGathererEventInit : EventInit">
<dt>RTCIceGatherCandidate candidate</dt>
<dd>
<p>The ICE candidate that caused the event.</p>
</dd>
</dl>
</section>
<section id="rtcicegatheroptions*">
<h3><dfn>RTCIceGatherOptions</dfn> Dictionary</h3>
<p><code>RTCIceGatherOptions</code> provides options relating to the gathering of ICE candidates.</p>
<dl class="idl" title=
"dictionary RTCIceGatherOptions">
<dt>RTCIceGatherPolicy gatherPolicy</dt>
<dd><p>The ICE gather policy.</p></dd>
<dt>sequence<RTCIceServer> iceservers</dt>
<dd><p>The ICE servers to be configured.</p></dd>
<dt>MSPortRange portRange</dt>
<dd><p>The port range to use for local candidates</p></dd>
</dl>
</section>
<section id="msportrange*">
<h3><dfn>MSPortRange</dfn> Dictionary</h3>
<dl title='dictionary MSPortRange' class='idl'>
<dt>unsigned short min</dt>
<dd><p>Beginning of the port range.</p></dd>
<dt>unsigned short max</dt>
<dd><p>End of the port range.</p></dd>
</dl>
</section>
<section id="rtcicegatherpolicy*">
<h3><dfn>RTCIceGatherPolicy</dfn> Enum</h3>
<p>The <code>RTCIceGatherPolicy</code> dictoinary provides the policy relating to the gathering of ICE candidates.</p>
<dl class="idl" title="enum RTCIceGatherPolicy">
<dt>all</dt>
<dd><p>The ICE gatherer gathers all types of candidates when this value is specified.</p></dd>
<dt>nohost</dt>
<dd><p>The ICE gatherer gathers all ICE candidate types except for host candidates.</p></dd>
<dt>relay</dt>
<dd><p>The ICE gatherer <em class="rfc2119" title="MUST">MUST</em> only gather media relay
candidates such as candidates passing through a TURN server. This can be used to reduce
leakage of IP addresses in certain use cases.</p></dd>
</dl>
</section>
<section id="rtciceserver*">
<h3><dfn>RTCIceServer</dfn> Dictionary</h3>
<p>
The <code>RTCIceServer</code> dictionary provides STUN or TURN server configuration.
In network topologies with multiple layers of NATs, it is desirable to have a STUN server
between every layer of NATs in addition to the TURN servers to minimize the peer to peer network latency.
<p>
</p>
An example of an array of <code<<a>RTCIceServer</a></code> objects supporting the STUN and TURN standards:
</p>
<pre xml:space="preserve" class='example highlight'>
[ { urls: "stun:stun1.example.net" } ,
{ urls:"turn:turn.example.org", username: "user", credential:"myPassword"}
]
</pre>
</p>
An example of an array of <code<<a>RTCIceServer</a></code> objects supporting [[MS-TURN]]:
</p>
<pre xml:space="preserve" class='example highlight'>
[ { urls: "stun:stun1.example.net" } ,
{ urls:"msturn:turn.example.org", username: "user", credential:"myPassword"},
{ urls:"msturn-v2:turn2.example.org", username: "user", credential:"myPassword"}
]
</pre>
<div class="note">
<p>Edge Interop Note: Inclusion of the MSTURN or MSTURN-V2 URI triggers use of a proprietary TURN variant described in [[MS-TURN]], as well as proprietary ICE behavior
described in [[MS-ICE]] and [[MS-ICE2]].
The MSTURN or MSTURN-V2 URI should therefore not be used in scenarios requiring interoperability with other browsers.
The STUN URI is not currently supported.
</p>
</div>
<dl class="idl" title="dictionary RTCIceServer">
<dt>(DOMString or sequence<DOMString>) urls</dt>
<dd><p>STUN or TURN URI(s) as defined in [[!RFC7064]] and [[!RFC7065]] or other URI types (such as the MSTURN URI, described in [[MS-TURN]]).</p></dd>
<dt>DOMString username</dt>
<dd><p>If this <code><a>RTCIceServer</a></code> object represents a TURN server, then this attribute specifies
the username to use with that TURN server.</p></dd>
<dt>DOMString credential</dt>
<dd><p>If this <code><a>RTCIceServer</a></code> represents a TURN server, then this attribute specifies the credential to use with that TURN server.</p></dd>
</dl>
</section>
<section id="rtcicegatherer-initial-example*">
<h3>Example</h3>
<pre xml:space="preserve" class='example highlight'>
// Include some helper functions
import "helper.js";
// Create ICE gather options
var gatherOptions = new RTCIceGatherOptions();
gatherOptions.gatherPolicy = RTCIceGatherPolicy.relay;
gatherOptions.iceservers = [ { urls: "stun:stun1.example.net" } ,
{ urls:"turn:turn.example.org", username: "user", credential:"myPassword"} ];
// Create ICE gatherer objects
var iceGatherer = new RTCIceGatherer(gatherOptions);
// Prepare to signal local candidates as well as "end of candidates"
iceGatherer.onlocalcandidate = function (event) {
mySendLocalCandidate(event.candidate);
};
// Set up response function
mySignaller.onResponse = function(responseSignaller,response) {
// The Microsoft Edge ORTC implementation only supports a single response.
};
mySignaller.send({
"ice": iceGatherer.getLocalParameters()
});
</pre>
<pre xml:space="preserve" class='example highlight'>
// Helper functions used in all the examples (helper.js)
function trace(text) {
// This function is used for logging.
if (text[text.length - 1] === '\n') {
text = text.substring(0, text.length - 1);
}
if (window.performance) {
var now = (window.performance.now() / 1000).toFixed(3);
console.log(now + ': ' + text);
} else {
console.log(text);
}
}
function errorHandler (error) {
trace('Error encountered: ' + error.name);
}
function mySendLocalCandidate(candidate, component, kind){
// Set default values
kind = kind || "all";
component = component || RTCIceComponent.RTP;
parameters = parameters || null;
// Signal the local candidate
mySignaller.mySendLocalCandidate({
"candidate": candidate,
"component": component,
"kind": kind
});
}
function myIceTransportStateChange(name, state){
switch(state){
case RTCIceTransportState.new:
trace('IceTransport: ' + name + ' Has been created');
break;
case RTCIceTransportState.checking:
trace('IceTransport: ' + name + ' Is checking');
break;
case RTCIceTransportState.connected:
trace('IceTransport: ' + name + ' Is connected');
break;
case RTCIceTransportState.disconnected:
trace('IceTransport: ' + name + ' Is disconnected');
break;
case RTCIceTransportState.completed:
trace('IceTransport: ' + name + ' Has finished checking (for now)');
break;
case RTCIceTransportState.closed:
trace('IceTransport: ' + name + ' Is closed');
break;
default:
trace('IceTransport: ' + name + ' Invalid state');
}
}
function myDtlsTransportStateChange(name, state){
switch(state){
case RTCDtlsTransportState.new:
trace('DtlsTransport: ' + name + ' Has been created');
break;
case RTCDtlsTransportState.connecting:
trace('DtlsTransport: ' + name + ' Is connecting');
break;
case RTCDtlsTransportState.connected:
trace('DtlsTransport: ' + name + ' Is connected');
break;
case RTCDtlsTransportState.closed:
trace('DtlsTransport: ' + name + ' Is closed');
break;
default:
trace('DtlsTransport: ' + name + ' Invalid state');
}
}
</pre>
</section>
</section>
<section id="rtcicetransport*">
<h2><dfn>RTCIceTransport</dfn> Interface</h2>
<p>
The <code>RTCIceTransport</code> includes information relating to Interactive Connectivity Establishment (ICE).
</p>
<section id="rtcicetransport-overview*">
<h3>Overview</h3>
<p>An <code><a>RTCIceTransport</a></code> instance is associated to a transport object (such as <code><a>RTCDtlsTransport</a></code>),
and provides RTC related methods to it. The Microsoft Edge implementation does not support the <code>oncandidatepairchange</code>
event handler.</p>
<div class="note">
<p>Edge Interop Note: The Microsoft Edge ICE implementation only supports regular nomination. In connectivity checks that it sends, Edge will
only set the USE-CANDIDATE flag for the selected pair. Also, Edge will only respond to the first connectivity check setting the
USE-CANDIDATE flag, and will ignore all subsequent connectivity checks with the USE-CANDIDATE flag set.</p>
</div>
</section>
<section id="rtcicetransport-operation*">
<h3>Operation</h3>
<p>An <code><a>RTCIceTransport</a></code> instance is constructed from an optional <code><a>RTCIceGatherer</a></code> object.</p>
</section>
<section id="rtcicetransport-interface-definition*">
<h3>Interface Definition</h3>
<dl class="idl" title="[Constructor(optional RTCIceGatherer gatherer)] interface RTCIceTransport : RTCStatsProvider">
<dt>readonly attribute RTCIceGatherer? iceGatherer</dt>
<dd><p>
The <var>iceGatherer</var> attribute is set to the value of <var>gatherer</var> passed in the constructor or the
latest call to <code>start()</code>.
</p></dd>
<dt>readonly attribute RTCIceRole role</dt>
<dd><p>The current role of the ICE transport.</p></dd>
<dt>readonly attribute RTCIceComponent component</dt>
<dd><p>The component-id of the <code><a>RTCIceTransport</a></code>.</p></dd>
<dt>readonly attribute RTCIceTransportState state</dt>
<dd><p>The current state of the ICE transport.</p></dd>
<dt>sequence<RTCIceCandidate> getRemoteCandidates()</dt>
<dd><p>Retrieve the sequence of candidates associated with the remote
<code><a>RTCIceTransport</a></code>. Only returns the candidates previously
added using <code>setRemoteCandidates()</code> or <code>addRemoteCandidate()</code>.</p></dd>
<dt>RTCIceCandidatePair? getNominatedCandidatePair()</dt>
<dd><p>Retrieves the selected candidate pair on which media is flowing. If there is no selected pair yet,
or consent is lost on the selected pair, NULL is returned.
</p></dd>
<dt>void start(RTCIceGatherer gatherer, RTCIceParameters remoteParameters, optional RTCIceRole role)</dt>
<dd><p>The first time <code>start()</code> is called, candidate connectivity checks are started and the
ICE transport attempts to connect to the remote <code><a>RTCIceTransport</a></code>.
If <code>remoteParameters.iceLite</code> is "true" then the remote peer supports ICE lite; if it is "false" or unset
then the remote peer supports full ICE.
If <code>start()</code> is called with invalid parameters, throw an <code>InvalidParameters</code> exception.
For example, if <var>gatherer.component</var>
has a value different from <var>iceTransport.component</var>, throw an <code>InvalidParameters</code> exception.
If <var>state</var> is "closed",
throw an <code>InvalidStateError</code> exception.
When <code>start()</code> is called again, <code><a>RTCIceTransportState</a></code> transitions to the "connected" state,
all remote candidates are flushed, and <code>addRemoteCandidate()</code> or
<code>setRemoteCandidates()</code> must be called to add the remote candidates back or replace them.</p><p>
If <code>start()</code>
is called again, an <code>InvalidStateError</code> exception is thrown.
</p>
<p>As noted in [[!RFC5245]] Section 7.1.2.3, an incoming connectivity check utilizes the local/remote username fragment
and the local password, whereas an outgoing connectivity check utilizes the local/remote username fragment and the
remote password. Since <code>start()</code> provides role information, as well as the remote username fragment and password,
once <code>start()</code> is called an <code><a>RTCIceTransport</a></code> object
can respond to incoming connectivity checks based on its configured role, as well as initiating connectivity checks.</p>
</dd>
<dt>void stop()</dt>
<dd><p>Stops and closes the current object.
Calling <code>stop()</code> when <var>state</var> is "closed" has no effect.
</p></dd>
<dt>RTCIceParameters? getRemoteParameters()</dt>
<dd><p>Obtain the current ICE parameters of the remote <code><a>RTCIceTransport</a></code>.</p></dd>
<dt>RTCIceTransport createAssociatedTransport ()</dt>
<dd><p>Create an associated <code><a>RTCIceTransport</a></code> for RTCP.
If called more than once for the same component, or if <var>state</var> is "closed",
throw an <code>InvalidStateError</code> exception. If called when
<var>component</var> is "RTCP",
throw an <code>InvalidStateError</code> exception.
</p></dd>
<dt>void addRemoteCandidate(RTCIceGatherCandidate remoteCandidate)</dt>
<dd><p>Add a remote candidate associated with the remote <code><a>RTCIceTransport</a></code>.
If <var>state</var> is "closed", throw an <code>InvalidStateError</code> exception.
Since Microsoft Edge only supports "half-trickle", Edge will not begin candidate pair checks until <code>RTCIceComplete</code>
has been passed as an argument to <code>addRemoteCandidate()</code>.
</p></dd>
<dt>void setRemoteCandidates(sequence<RTCIceCandidate> remoteCandidates)</dt>
<dd><p>Set the sequence of candidates associated with the remote <code><a>RTCIceTransport</a></code>.
If <var>state</var> is "closed", throw an <code>InvalidStateError</code> exception.
</p></dd>
<dt>attribute EventHandler? onicestatechange</dt>
<dd><p>This event handler, of event handler type <code>icestatechange</code>,
uses the <code>RTCIceTransportStateChangedEvent</code> interface.
It <em class="rfc2119" title="MUST">MUST</em> be supported by
all objects implementing the <code><a>RTCIceTransport</a></code> interface.
It is called any time the <code><a>RTCIceTransportState</a></code> changes.
<p></dd>
</dl>
</section>
<section id="rtcicecomponent*">
<h3><dfn>RTCIceComponent</dfn> Enum</h3>
<p><code>RTCIceComponent</code> provides the component-id of the <code><a>RTCIceTransport</a></code>, which will be "RTP" unless RTP and RTCP are not multiplexed and
the <code><a>RTCIceTransport</a></code> object was returned by <code>createAssociatedTransport()</code>.</p>
<dl class="idl" title="enum RTCIceComponent">
<dt>RTP</dt>
<dd><p>The RTP component ID, defined (as '1') in [[!RFC5245]] Section 4.1.1.1.
</p></dd>
<dt>RTCP</dt>
<dd><p>The RTCP component ID, defined (as '2') in [[!RFC5245]] Section 4.1.1.1.</p></dd>
</dl>
</section>
<section id="rtcicerole*">
<h3><dfn>RTCIceRole</dfn> Enum</h3>
<p><code>RTCIceRole</code> contains the current role of the ICE transport.</p>
<dl class="idl" title="enum RTCIceRole">
<dt>controlling</dt>
<dd><p>controlling state</p></dd>
<dt>controlled</dt>
<dd><p>controlled state</p></dd>
</dl>
</section>
<section id="rtcicetransportstate*">
<h3><dfn>RTCIceTransportState</dfn> Enum</h3>
<p><code>RTCIceTransportState</code> represents the current state of the ICE transport.</p>
<dl class="idl" title="enum RTCIceTransportState">
<dt>new</dt>
<dd><p>The <code><a>RTCIceTransport</a></code> object is waiting for remote candidates to be supplied.
In this state the object can respond to incoming connectivity checks.
</p></dd>
<dt>checking</dt>
<dd><p>
The <code><a>RTCIceTransport</a></code> has received at least one remote candidate,
and a local and remote <code><a>RTCIceCandidateComplete</a></code> dictionary was not added as the last candidate.
In this state the <code><a>RTCIceTransport</a></code> is checking candidate pairs but has not yet found a
successful candidate pair, or liveness checks have failed (such as those in [[!RFC7675]]) on
a previously successful candidate pair.
</p></dd>
<dt>connected</dt>
<dd><p>The <code><a>RTCIceTransport</a></code> has received a response to an outgoing connectivity check, or has received incoming DTLS/media after
a successful response to an incoming connectivity check,
but is still checking other candidate pairs to see if there is a better connection.
In this state outgoing media is permitted.</p></dd>
<dt>completed</dt>
<dd><p>
A local and remote <code><a>RTCIceCandidateComplete</a></code> dictionary was added as the
last candidate to the <code><a>RTCIceTransport</a></code> and all appropriate candidate
pairs have been tested and at least one functioning candidate pair has been found.
</p></dd>
<dt>disconnected</dt>
<dd><p>
The <code><a>RTCIceTransport</a></code> has received at least one local and remote candidate,
and a local and remote <code><a>RTCIceCandidateComplete</a></code> dictionary was not added as the last
candidate, but all appropriate candidate pairs thus far have been tested and failed (or consent checks [[!RFC7675]],
once successful, have now failed). Other candidate pairs may become available for testing as new candidates
are trickled, and therefore the "failed" state has not been reached.
</p></dd>
<dt>closed</dt>
<dd><p>The <code><a>RTCIceTransport</a></code> has shut down and is no longer responding to STUN requests.
</p></dd>
</dl>
<div class="note">
<p>Edge Interop Note: The Microsoft Edge ORTC API implementation does not support the "failed" state, which is included in
both the WebRTC 1.0 API as well as recent drafts of the ORTC API.
One implication of this is that <code><a>RTCIceTransport</a></code> objects transition to the "closed" state under the
conditions that would normally result in a transition to "failed".
</p>
</div>
<p>The non-normative ICE state transitions are:</p>
<img alt="The non-normative ICE State Transition Diagram" src="images/msortc-corrected.png" style="width:100%" />
</section>
<section id="rtcicetransportstatechangedevent-interface-definition*">
<h3>RTCIceTransportStateChangedEvent</h3>
<p>The <code>icestatechange</code> event of the <code><a>RTCIceTransport</a></code> object uses
the <code><a>RTCIceTransportStateChangedEvent</a></code> interface.</p>
<p>Firing an
<code><a>RTCIceTransportStateChangedEvent</a></code> event named
<var>e</var> with an <code><a>RTCIceTransportState</a></code>
<var>state</var> means that an event with the name <var>e</var>,
which does not bubble (except where otherwise stated) and is not
cancelable (except where otherwise stated), and which uses the
<code>RTCIceTransportStateChangedEvent</code> interface with the
<var>state</var> attribute set to the new <code><a>RTCIceTransportState</a></code>,
<em class="rfc2119" title="MUST">MUST</em> be
created and dispatched at the given target.</p>
<dl class="idl" data-merge="RTCIceTransportStateChangedEventInit" title=
"[Constructor(DOMString type, RTCIceTransportStateChangedEventInit eventInitDict)] interface RTCIceTransportStateChangedEvent : Event">
<dt>readonly attribute RTCIceTransportState state</dt>
<dd>
<p>The <var>state</var> attribute is the new
<code><a>RTCIceTransportState</a></code>
that caused the event.
</p>
</dd>
</dl>
<dl class="idl" title=
"dictionary RTCIceTransportStateChangedEventInit : EventInit">
<dt>RTCIceTransportState? state</dt>
<dd>
<p>The <var>state</var> attribute is the new
<code><a>RTCIceTransportState</a></code>
that caused the event.
</p>
</dd>
</dl>
</section>
<section id="rtcicecandidatepair*">
<h3><dfn>RTCIceCandidatePair</dfn> Dictionary</h3>
<p>
The <code>RTCIceCandidatePair</code> contains the currently selected ICE candidate pair.
</p>
<dl class="idl" title="dictionary RTCIceCandidatePair">
<dt>RTCIceCandidate local</dt>
<dd><p>The local ICE candidate.</p></dd>
<dt>RTCIceCandidate remote</dt>
<dd><p>The remote ICE candidate.</p></dd>
</dl>
</section>
</section>
<section id="rtcdtlstransport*">
<h2><dfn>RTCDtlsTransport</dfn> Interface</h2>
<p>
The <code>RTCDtlsTransport</code> Interface includes information relating to Datagram Transport Layer Security (DTLS) transport.
</p>
<section id="rtcdtlstransport-overview*">
<h3>Overview</h3>
<p>Microsoft Edge does not support the <code>getRemoteCertificates()</code> method, or a <var>state</var> value of "failed".
Since Microsoft Edge requires support for RTP/RTCP mux with DTLS, an <code><a>RTCDtlsTransport</a></code> object can only be
constructed from an RTP <code><a>RTCIceTransport</a></code> object.
</p>
</section>
<section id="rtcdtlstransport-operation*">
<h3>Operation</h3>
<p>A <code><a>RTCDtlsTransport</a></code> instance is constructed using an <code><a>RTCIceTransport</a></code> object.
<p>A newly constructed <code><a>RTCDtlsTransport</a></code>
<em class="rfc2119" title="MUST">MUST</em> listen and respond to incoming DTLS packets before <code>start()</code> is called.
However, to complete the negotiation it is necessary to verify the remote fingerprint,
which is dependent on <var>remoteParameters</var>, passed to <code>start()</code>.
After the DTLS handshake exchange completes (but before the remote fingerprint is verified)
incoming media packets may be received. A modest buffer <em class="rfc2119" title="MUST">MUST</em> be provided to avoid loss of
media prior to remote fingerprint validation (which can begin after <code>start()</code> is called).
</p>
<p>If an attempt is made to construct a <code><a>RTCDtlsTransport</a></code> instance from an <code><a>RTCIceTransport</a></code> in the "closed" state,
an <code>InvalidStateError</code> exception is thrown.
Since the Datagram Transport Layer Security (DTLS) negotiation occurs between transport endpoints determined via ICE, implementations of this specification
<em class="rfc2119" title="MUST">MUST</em> support multiplexing of STUN, TURN, DTLS and RTP and RTCP.
This multiplexing, originally described in [[!RFC5764]] Section 5.1.2, is being revised in [[RFC7983]].
</p>
</section>
<section id="rtcdtlstransport-interface-definition*">
<h3>Interface Definition</h3>
<dl class="idl" title="[Constructor(RTCIceTransport transport)] interface RTCDtlsTransport : RTCStatsProvider">
<dt>readonly attribute RTCIceTransport transport</dt>
<dd><p>The associated <code><a>RTCIceTransport</a></code> instance.
</p></dd>
<dt>readonly attribute RTCDtlsTransportState state</dt>
<dd><p>The current state of the DTLS transport.</p></dd>
<dt>RTCDtlsParameters getLocalParameters()</dt>
<dd><p>Obtain the DTLS parameters of the local <code><a>RTCDtlsTransport</a></code>.
</p></dd>
<dt>RTCDtlsParameters? getRemoteParameters()</dt>
<dd><p>Obtain the current DTLS parameters of the remote <code><a>RTCDtlsTransport</a></code>.
</p></dd>
<dt>void start(RTCDtlsParameters remoteParameters)</dt>
<dd><p>Start DTLS transport negotiation with the parameters of the remote DTLS transport, including verification
of the remote fingerprint,
then once the DTLS transport session is established, negotiate a <dfn>DTLS-SRTP</dfn> [[!RFC5764]] session to
establish keys so as protect media using SRTP [[!RFC3711]].
Since symmetric RTP [[!RFC4961]] is utilized, the <a>DTLS-SRTP</a> session is bi-directional.
</p><p>If <var>remoteParameters</var> is invalid, throw
an <code>InvalidParameters</code> exception. If <code>start()</code> is called
after a previous <code>start()</code> call, or if <var>state</var> is "closed",
throw an <code>InvalidStateError</code> exception.
Only a single DTLS transport can be multiplexed over an ICE transport.
Therefore if a <code><a>RTCDtlsTransport</a></code> object <var>dtlsTransportB</var> is constructed with an <code><a>RTCIceTransport</a></code>
object <var>iceTransport</var> previously used to construct another <code><a>RTCDtlsTransport</a></code> object
<var>dtlsTransportA</var>, then if <code>dtlsTransportB.start()</code> is called prior to having called <code>dtlsTransportA.stop()</code>,
then throw an <code>InvalidStateError</code> exception.
</p>
</dd>
<dt>void stop()</dt>
<dd><p>Stops and closes the DTLS transport object.
Calling <code>stop()</code> when <var>state</var> is "closed" has no effect.
</p>
</dd>
<dt>attribute EventHandler? ondtlsstatechange</dt>
<dd><p>This event handler, of event handler type <code><a>dtlsstatechange</a></code>,
uses the <code><a>RTCDtlsTransportStateChangedEvent</a></code> interface.
It <em class="rfc2119" title="MUST">MUST</em> be supported by
all objects implementing the <code><a>RTCDtlsTransport</a></code> interface.
It is called any time the <code>RTCDtlsTransportState</code> changes.
</p>
</dd>
<dt>attribute EventHandler? onerror</dt>
<dd><p>This event handler, of event handler type <code>error</code>,
<em class="rfc2119" title="MUST">MUST</em> be supported by all objects implementing the <code><a>RTCDtlsTransport</a></code> interface.
This event <em class="rfc2119" title="MUST">MUST</em> be fired on reception of a DTLS alert.
</p>
</dd>
</dl>
</section>
<section id="rtcdtlsparameters*">
<h3><dfn>RTCDtlsParameters</dfn> Dictionary</h3>
<p>
The <code>RTCDtlsParameters</code> object includes information relating to DTLS configuration.
</p>
<dl class="idl" title="dictionary RTCDtlsParameters">
<dt>RTCDtlsRole role="auto"</dt>
<dd><p>The DTLS role, with a default of auto.</p></dd>
<dt>sequence<RTCDtlsFingerprint> fingerprints</dt>
<dd><p>Sequence of fingerprints.</p></dd>
</dl>
</section>
<section id="rtcdtlsfingerprint*">
<h3><dfn>RTCDtlsFingerprint</dfn> Dictionary</h3>
<p>
The <code>RTCDtlsFingerprint</code> object includes the hash function algorithm and certificate fingerprint as described in [[!RFC4572]].
</p>
<dl class="idl" title="dictionary RTCDtlsFingerprint">
<dt>DOMString algorithm</dt>
<dd><p>One of the the hash function algorithms defined in the 'Hash function Textual Names' registry, initially specified in [[!RFC4572]] Section 8.</p></dd>
<dt>DOMString value</dt>
<dd><p>The value of the certificate fingerprint in lowercase hex string as expressed utilizing the syntax of 'fingerprint' in [[!RFC4572]] Section 5.</p></dd>
</dl>
</section>
<section id="rtcdtlsrole*">
<h3><dfn>RTCDtlsRole</dfn> Enum</h3>
<p><code>RTCDtlsRole</code> indicates the role of the DTLS transport.
</p>
<dl class="idl" title="enum RTCDtlsRole">
<dt>auto</dt>
<dd><p><code><a>RTCDtlsRole</a></code> is determined based on the resolved ICE role: the
"controlled" role acts as the DTLS client and
the "controlling" role acts as the DTLS server. Since <code><a>RTCDtlsRole</a></code>
is initialized to "auto" on construction of an <code><a>RTCDtlsTransport</a></code> object,
<code>getLocalParameters().role</code> will always return "auto".
</p></dd>
<dt>client</dt>
<dd><p>The DTLS client role.</p></dd>
<dt>server</dt>
<dd><p>The DTLS server role.</p></dd>
</dl>
</section>
<section id="rtcdtlsinfo">
<h3>DTLS role determination</h3>
<p>To diagnose DTLS role issues, an application may wish to determine
the desired and actual DTLS role of an <code><a>RTCDtlsTransport</a></code>.
In Edge ORTC, a <code><a>RTCDtlsTransport</a></code>
object assumes a DTLS role of <code>auto</code> upon construction.
This implies that the DTLS role is determined by the ICE role. Since
<code>getLocalParameters().role</code> always returns the role assigned
to an <code><a>RTCDtlsTransport</a></code> object upon construction
(<code>auto</code> for Edge), the <code>getLocalParameters</code>
method cannot be used to determine the desired or actual role of an
<code><a>RTCDtlsTransport</a></code>.</p>
<p>An application can determine the
desired role of an <code><a>RTCDtlsTransport</a></code> from the value of
<code><var>remoteParameters</var>.role</code> passed to
<code><a>RTCDtlsTransport</a>.start(<var>remoteParameters</var>)</code>.
If <code><var>remoteParameters</var>.role</code> is <code>server</code>