forked from sysapps/telephony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
2299 lines (2277 loc) · 88.2 KB
/
index.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>
<head>
<meta charset="UTF-8">
<title>
Web Telephony API
</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' class=
'remove'>
</script>
<script class="remove">
var respecConfig = {
specStatus: "ED",
shortName: "telephony",
publishDate: "",
previousPublishDate: "",
previousMaturity: "",
edDraftURI: "http://www.w3.org/2012/sysapps/telephony/",
// lcEnd: "",
crEnd: "",
editors: [
{ name: "José M. Cantera", company: "Telefónica",
companyURL: "http://www.tid.es/" },
{ name: "Eduardo Fullea", company: "Telefónica",
companyURL: "http://www.tid.es/" },
{ name: "Zoltan Kis", company: "Intel",
companyURL: "http://www.intel.com/" }
],
inlineCSS: true,
noIDLIn: true,
extraCSS: ["../ReSpec.js/css/respec.css"],
wg: "System Applications Working Group",
wgURI: "http://",
wgPublicList: "public-sysapps",
wgPatentURI: "http://www.w3.org/2004/01/pp-impl/43696/status",
otherLinks: [{
key: "Repository",
data: [{
value: "We are on Github.",
href: "https://github.com/sysapps/telephony"
}, {
value: "File a bug.",
href: "https://github.com/sysapps/telephony/issues"
}, {
value: "Commit history.",
href: "https://github.com/sysapps/telephony/commits/gh-pages"
}
]
}]
};
</script>
</head>
<body>
<!-- - - - - - - - - - - - - - - Abstract - - - - - - - - - - - - - - - - - -->
<section id="abstract">
<p>
This specification defines an API to manage telephone calls. A typical
use case of the <cite>Web Telephony API</cite> is the implementation of
a 'Dialer' application supporting multiparty calls and multiple
telephony services. A minimal structure for call history items is also
defined.
</p>
</section>
<!-- - - - - - - - - - - Status of this document - - - - - - - - - - - - - -->
<section id="sotd">
<p>
Implementors should be aware that this specification is not stable.
<strong>Implementors who are not taking part in the discussions are
likely to find the specification changing out from under them in
incompatible ways.</strong> Vendors interested in implementing this
specification before it eventually reaches the Candidate Recommendation
stage should join the aforementioned mailing lists and take part in the
discussions.
</p>
</section>
<!-- - - - - - - - - - - - - - Introduction - - - - - - - - - - - - - - - -->
<section class="informative">
<h2>
Introduction
</h2>
<p>
The <cite>Telephony API</cite> allows applications to manage
interaction with telephony call signaling, but does not handle audio
channels management.
</p>
<p>
An example of making a telephony call is provided below:
</p>
<pre class="example highlight">
var telCall = navigator.telephony.dial('+1234567890');
telCall.onactive = function(e) {
window.console.log('Connected!');
}
telCall.ondisconnected = function(e) {
window.console.log('Disconnected!');
// update call history
}
telCall.onerror = function(e) {
window.console.error(e);
}
</pre>
<p>
The use cases for this specification are collected in the <a href=
'http://www.w3.org/wiki/System_Applications_WG:_Telephony_API'>wiki
page</a> of this API.
</p>
<p>
The following specifications have been used for designing the <cite>Web
Telephony API</cite>: for <abbr title=
"Global System for Mobile Communications">GSM</abbr> the [[!GSM-CALL]]
suite, for IMS/SIP the [[!IMS]] suite, for XMPP the [[!JINGLE]]
specification. The same API would work also for SIP and XMPP calls,
except multiparty call handling, which is modeled after the cellular
multiparty calls.
</p>
<p>
Future versions of this specification may add SIP and XMPP conference
support.
</p>
</section>
<!-- - - - - - - - - - - - - - Conformance - - - - - - - - - - - - - - - - -->
<section id="conformance">
<p>
This specification defines conformance criteria that apply to a single
product: the <dfn id="ua">user agent</dfn> that implements the
interfaces that it contains.
</p>
<p>
Implementations that use ECMAScript to implement the APIs defined in
this specification MUST implement them in a manner consistent with the
ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]],
as this specification uses that specification and terminology.
</p>
</section>
<!-- - - - - - - - - - - - - - Terminology - - - - - - - - - - - - - - - - -->
<section>
<h2>
Terminology
</h2>
<p>
The <code><a href=
"http://dev.w3.org/html5/spec/webappapis.html#eventhandler">EventHandler</a></code>
interface represents a callback used for <a href=
"http://www.w3.org/html/wg/drafts/html/master/webappapis.html#event-handlers">
event handlers</a> 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">fire
a simple event</a></dfn> are defined in [[!HTML5]].
</p>
<p>
The terms <dfn><a href=
"http://dev.w3.org/html5/spec/webappapis.html#event-handlers">event
handler</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>
An <dfn>active call</dfn> is a <a>TelephonyCall</a> in the <a href=
'#call-state-active'>active</a> state representing a connected call
which is and bound to the media input and output devices (e.g.
microphone, speaker, tone generator). Note that a call on <a>hold</a>
is also active from call signaling point of view, but not bound to
media input and output devices.
</p>
<p>
A <dfn title="telephony service">telephony service</dfn> exposes
telephony functionality associated to a subscriber identity registered
a with a telephony service provider. For example, in cellular telephony
a telephony service is associated to a SIM card (Subscriber Identity
Module). When making a call, the identity (e.g. SIM card, associated to
an Integrated Circuit Card Identifier, ICC-ID) is always provided,
either explicitly in the function call, or by using a default telephony
service in the implementation. The device can receive phone calls from
any active telephony service, even simultaneously, in which case the
user agent arbitrates the calls either by a policy, or by the user by
choosing which call to accept. A telephony service can use different
protocols for telephony signaling and media (e.g. GSM, CDMA, VoLTE,
etc.) with the same identity. Since call states can differ depending on
the protocol, the telephony call objects contain information which
identifies the service and the protocol used for making the call.
</p>
<p>
A <dfn title="default telephony service">default telephony
service</dfn> is the <a>telephony service</a> which is set as default
for telephony operations by the implementation.
</p>
<p>
A <dfn title="telephony service id">telephony service id</dfn> uniquely
identifies a <a>telephony service</a> together with a user identity in
the system. For SIM cards, this can include the ICC-ID as service
identifier. However, the MSISDN MUST NOT be used as telephony service
id.
</p>
<p>
A <dfn title="multiparty call">multiparty call</dfn> (also referred to
as <i>conference call</i>) is a telephony call with multiple remote
party participants, which is controlled as a single call, i.e. can be
put on hold, activated, disconnected with all participants. Other calls
can be joined with a multiparty call. This version supports GSM
multiparty calls and CDMA 3-way calls.
</p>
<p>
A <dfn title="conference id">conference id</dfn> uniquely identifies a
<a>multiparty call</a> in the system and in call history.
</p>
<p>
A <dfn title="remote party id">remote party id</dfn> uniquely
identifies a participant (a.k.a. remote party) in a telephony call in
the given <a>telephony service</a>, such as a phone number.
</p>
<p>
The <a href=
"http://www.whatwg.org/specs/web-apps/current-work/#task-source">task
source</a> for all <a href=
"http://www.whatwg.org/specs/web-apps/current-work/#queue-a-task">tasks
queued</a> in this specification is the <dfn>Telephony task
source</dfn>.
</p>
</section>
<!-- - - - - - - - - - - - Security and privacy - - - - - - - - - - - - - - -->
<section>
<h2>
Security and privacy considerations
</h2>
<p>
This API must be only exposed to trusted content.
</p>
</section>
<!-- - - - - - - - - - - Extended interface Navigator - - - - - - - - - - - -->
<section>
<h2>
Extensions to <code>Navigator</code> object
</h2>
<p>
The <a>TelephonyManager</a> interface is exposed on [[!HTML]]'s
<code>Navigator</code> object.
</p>
<dl title="partial interface Navigator" class="idl">
<dt>
readonly attribute TelephonyManager telephony
</dt>
<dd>
The object that exposes the telephony functionality, e.g. making and
receiving calls.
</dd>
</dl>
</section>
<!-- - - - - - - - - - - - Interface TelephonyManager - - - - - - - - - - - -->
<section>
<h2>
<a>TelephonyManager</a> Interface
</h2>
<p>
The <a>TelephonyManager</a> interface provides access to telephony
functionality, and manages the lifecycle of the <a>Call</a> objects.
</p>
<dl title="TelephonyCall implements CallHandler" class="idl"></dl>
<dl title="interface TelephonyManager : EventTarget" class="idl">
<dt>
readonly attribute Call? activeCall
</dt>
<dd>
When getting, the user agent MUST return a <a>Call</a> object
representing the <a>active call</a>. If there is no active
<a>Call</a> return <code>null</code>.
</dd>
<dt>
readonly attribute Call[] calls
</dt>
<dd>
When getting, the user agent MUST return an array, which can be
empty, of <a>Call</a> objects managed by this objects. Note that
<code>TelephonyCall</code> objects belonging to a multiparty call are
managed by the corresponding <a><code>ConferenceCall</code></a>
object and MUST NOT be also present in this array.
</dd>
<dt>
readonly attribute DOMString[] emergencyNumbers
</dt>
<dd>
When getting, the user agent MUST return an array, which can be
empty, of telephone numbers for the emergency services in the current
geographical area.
</dd>
<dt>
readonly attribute DOMString[] serviceIds
</dt>
<dd>
When getting, the user agent MUST return an array, which can be
empty, of <a>telephony service id</a>'s.
</dd>
<dt>
attribute readonly DOMString defaultServiceId
</dt>
<dd>
When getting, the user agent MUST return the <a>DOMString</a> that
represents the id of the <a>default telephony service</a>.
</dd>
<dt>
Future changeDefaultService(DOMString serviceID)
</dt>
<dd>
Provides a means to change the <a>default telephony service</a> used
by the user agent. When invoked, the user agent runs the <a>steps to
change the default service</a>.
<dl class='parameters'>
<dt>
DOMString serviceID
</dt>
<dd>
A <a>service id</a> for a <a>telephony service</a> known to the
user agent.
</dd>
</dl>
</dd>
<dt>
TelephonyCall dial ()
</dt>
<dd>
Initiates a new telephony call. Returns a <a>TelephonyCall</a>
object, which will manage the asynchronous call signaling events.
<dl class='parameters'>
<dt>
DOMString remoteParty
</dt>
<dd>
Indicates the destination number of the call
</dd>
<dt>
optional DialParams params
</dt>
<dd>
If set, indicates the optional parameters of the call, including
the telephony service to be used, and whether caller ID is hidden
</dd>
</dl>
</dd>
<dt>
void sendTones()
</dt>
<dd>
This method asynchronously emits a [[!DTMF]] tone sequence with the
platform default or specified duration and delay, in the platform
default or the specified telephony service.
<dl class='parameters'>
<dt>
DOMString tones
</dt>
<dd>
Indicates the sequence of [[!DTMF]] tones to be emitted. Its
value can be any sequence of the following characters (0-9; A-D;
*; #).
</dd>
<dt>
optional ToneParams params
</dt>
<dd>
If set, indicates the <a>telephony service id</a> to be used, the
tone duration (mark) and delay before a tone (space). If not set,
implementations MUST use default values for these.
</dd>
</dl>
</dd>
<dt>
void startTone()
</dt>
<dd>
This method starts emitting a [[!DTMF]] tone with the platform
default or specified delay, in the platform default or the specified
telephony service.
<dl class='parameters'>
<dt>
DOMString tone
</dt>
<dd>
Indicates the [[!DTMF]] tone. Its value can be any sequence of
the following characters (0-9; A-D; *; #).
</dd>
<dt>
optional ToneParams params
</dt>
<dd>
If set, indicates the <a>telephony service id</a> to be used, and
the delay before a tone. The <code>duration</code> parameter is
ignored. If not set, implementations MUST use default values for
telephony service and delay.
</dd>
</dl>
</dd>
<dt>
void stopTone(optional DOMString serviceId)
</dt>
<dd>
This method stops emitting a [[!DTMF]] tone in the default or the
specified telephony service.
</dd>
<dt class="no-docs">
attribute EventHandler onincoming
</dt>
<dd>
Whenever there is a new call in <a href=
'#call-state-incoming'><code>incoming</code></a> or <a href=
'#call-state-waiting'><code>waiting</code></a> state, the <a>user
agent</a> MUST <a>queue a task</a> to fire an event named
<code>incoming</code> of type <a>TelephonyEvent</a>. The
<code>call</code> property of the event MUST be set to the
<a>TelephonyCall</a> object controlling the incoming call.
</dd>
<dt class="no-docs">
attribute EventHandler oncallschanged
</dt>
<dd>
Whenever a call is added to or removed from the <code>calls</code>
array, the <a>user agent</a> MUST <a>queue a task</a> to <a>fire a
simple event</a> named <code>callschanged</code>.
</dd>
<dt class="no-docs">
attribute EventHandler onserviceadded
</dt>
<dd>
The <code>serviceadded</code> event of type
<a>TelephonyServiceEvent</a> MUST be fired whenever a new
<a>telephony service</a> is enabled in the system. The
<code>serviceId</code> property of the event MUST contain the
<a>telephony service id</a> of the new service.
</dd>
<dt class="no-docs">
attribute EventHandler onserviceremoved
</dt>
<dd>
The <code>serviceremoved</code> event of type
<a>TelephonyServiceEvent</a> MUST be fired when an existing
<a>telephony service</a> is disabled in the system. The
<code>serviceId</code> property of the event MUST contain the
<a>telephony service id</a> of the disabled service.
</dd>
<dt>
attribute <span class="no-docs">EventHandler</span> onservicechanged
</dt>
<dd>
Handles a change of <a>default telephony service</a> from one to
another.
</dd>
</dl>
<section id="telephonymanager-steps">
<h3>
Steps
</h3>
<p>
The <a>TelephonyManager</a> object MUST <a>queue a task</a>
<dfn title="TCallControl"><i>TCallControl</i></dfn> for each
<a>TelephonyCall</a> or <a><code>ConferenceCall</code></a> object it
manages, which MUST listen to any event that results in changing the
call, and upon such events, follow the steps described in this
specification.
</p>
<p>
The <dfn>steps to request to update the default service</dfn> are as
follows:
</p>
<ol>
<li>Let <var>potential service</var> be the first argument passed to
this operation.
</li>
<li>Let <var>future</var> be a new <a href=
"http://web-alarms.sysapps.org/#future">Future</a> object and
<var>resolver</var> its associated resolver.
</li>
<li>Return <em>future</em> and continue the following steps
asynchronously.
</li>
<li>If <var>potential service</var> does not exactly match the
identifier of any <a>telephony service</a> known to the user agent,
run the following sub-steps and terminate this algorithm:
<ol>
<li>Let <em>error</em> be a new <a href=
"http://dom.spec.whatwg.org/#domerror">DOMError</a> object whose
name is "<a href=
"http://dom.spec.whatwg.org/#notfounderror">NotFoundError</a>".
</li>
<li>Invoke <em>resolver</em>'s reject(value) method with
<em>error</em> as the value argument.
</li>
</ol>
</li>
<li>If <var>potential service</var> exactly matches the service id of
the current default telephony service, run the following sub-steps
and terminate this algorithm:
<ol>
<li>Invoke <em>resolver</em>'s accept(value) method with
<var>potential service</var> as the value argument.
</li>
</ol>
</li>
<li>Otherwise, run the <a>steps to change the default service</a>,
with <var>potential service</var> as the <a>telephony service id</a>,
and <var>future</var> as the <a href=
"http://web-alarms.sysapps.org/#future">Future</a>.
</li>
</ol>
<p>
The <dfn>steps to change the default service</dfn> are given by the
following algorithm. This abstract operation takes as an argument a
<a>telephony service id</a> and an optional <a href=
"http://web-alarms.sysapps.org/#future">Future</a>.
</p>
<ol>
<li>Make a platform/system specific request to the underlying system
to change from the current default telephony service to the one
identified by <var>service id</var>.
</li>
<li>Possibly wait indefinately.
</li>
<li>If it's not possible (for whatever reason: timeout, security,
etc.) to change the default telephony service, and if
<var>future</var> was passed, run the following sub steps and
terminate this algorithm:
<ol>
<li>Let <em>error</em> be a new DOMError object whose name is
"NoModificationAllowedError".
</li>
<li>Call <em>resolver</em>'s reject(value) method with
<em>error</em> as the value argument.
</li>
</ol>
</li>
<li>Otherwise, if queue a task to:
<ol>
<li>Change the <a>defaultServiceId</a> attribute to the
<a>telephony service id</a> of the new default telephony service.
</li>
<li>If <a href="http://web-alarms.sysapps.org/#future">Future</a>
was passed, invoke <em>resolver</em>'s accept(value) method with
the id of the new default service as as value argument.
</li>
<li>Fire a simple event named <code>servicechange</code> at the
<a>telephony</a> attribute of the navigator object.
</li>
</ol>
</li>
</ol>
<p>
The <code>dial</code> method when invoked MUST run the following
steps:
</p>
<ol id="steps-dial">
<li>Create a new <code>TelephonyCall</code> object, referred as <var>
telCall</var> in these steps
</li>
<li>Set the <code>remoteParty</code> property of <var>telCall</var>
to the remote party identifier specified in the
<code>remoteParty</code> parameter
</li>
<li>If <code>calls</code> array already contains a
<a>TelephonyCall</a> object with identical <code>remoteParty</code>
property, then an <code>InvalidModificationError</code> MUST be
thrown.
</li>
<li>Otherwise, make a request to the telephony system to dial in the
remote party identifier passed in the <var>remoteParty</var>
parameter. Note that the value can be also an emergency number.
According to the value of the <code>hideCallerId</code> in the <code>
params</code> parameter, the own number is requested to be either
displayed, hidden or otherwise the default system configuration to
this regard is requested to be followed. The call MUST be made
using the <a>telephony service</a> specified in the
<code>service</code> property of the <code>params</code> parameter.
If not specified, then the implementation MUST use the <a>default
telephony service</a>. Even if there is no SIM card and no other
telephony services are available, but emergency calls are known to
be possible (e.g. because a cellular modem is present), it is
considered as a default service with only emergency call
capability, and the implementation MUST define a <a>telephony
service id</a> for it. When not even emergency calls are possible
(e.g. it is a purely IP based implementation and there is no
cellular modem), the implementation MAY use empty string for
default <a>telephony service id</a>, but it is encouraged that a
default service is created, with the methods raising an
<code>NotSupported</code> error.
</li>
<li>If the request is successful, then
<ol>
<li>Set the <code>state</code> of <var>telCall</var> to
<code>"dialing"</code> value
</li>
<li>Add <var>telCall</var> to the <code>calls</code> array
</li>
<li>
<a>Queue a task</a> to <a>fire a simple event</a> named
<code><a>statechange</a></code> at the <var>telCall</var>
object
</li>
<li>
<a>Queue a task</a> to <a>fire a simple event</a> named
<code><a>dialing</a></code> at the <var>telCall</var> object
</li>
<li>and finally return to the caller and <a>queue a task</a> <a>
<i>TCallControl</i></a> to monitor call flow progress
</li>
</ol>
</li>
<li>If during further steps for call connection there is an error,
execute the <a href="#error-steps">error steps</a> for
<var>telCall</var>.
</li>
</ol>
<p>
The <code>sendTones</code> method when invoked MUST run the following
steps:
</p>
<ol id="steps-sendtone">
<li>Request from the telephony system to send the specified tones.
</li>
</ol>
<p>
The <code>startTone</code> method when invoked MUST run the following
steps:
</p>
<ol id="steps-starttone">
<li>If the platform does not support long press [[!DTMF]] tones,
throw a <code>NotSupported</code> error. In this case applications
may then use the <code>sendTones</code> method for sending [[!DTMF]].
</li>
<li>Otherwise, request from the telephony system to start sending the
specified tone. The tone SHOULD play until the <code>stopTone</code>
method is called.
</li>
</ol>
<p>
The <code>stopTone</code> method when invoked MUST run the following
steps:
</p>
<ol id="steps-stoptone">
<li>If the platform does not support long press [[!DTMF]] tones,
throw a <code>NotSupported</code> error
</li>
<li>If the provided parameters are invalid, or there is no tone
playing on the specified telephony service, throw an
<code>InvalidStateError</code> error
</li>
<li>Otherwise, request from the telephony system to stop sending the
specified tone. <!--If there is an error, throw an
<code>InvalidModificationError</code> error.-->
</li>
</ol>
<p>
Upon a new incoming or waiting call, the <a>user agent</a> MUST
execute the following steps:
</p>
<ol id="steps-incoming">
<li>Let <var>incomingCall</var> be a new instance of
<code>TelephonyCall</code>.
</li>
<li>Set the <code>state</code> of <var>incomingCall</var> to
<code>"incoming"</code> in case there is no other call in <a href=
"#call-state-active"><code>active</code></a> state, or otherwise set
it to <code>"waiting"</code>
</li>
<li>Add <var>incomingCall</var> to the <code>calls</code> array
</li>
<li>
<a>Queue a task</a> to <a>fire a simple event</a> named
<code><a>statechange</a></code> at the <var>incomingCall</var>
object
</li>
<li>
<a>Queue a task</a> to <a>fire a simple event</a> named
<code><a>incoming</a></code> at the <a>TelephonyManager</a> object
managing the call
</li>
<li>
<a>Queue a task</a> to <a>fire a simple event</a> named
<code><a>callschanged</a></code> at the <a>TelephonyManager</a>
object managing the call
</li>
<li>
<a>Queue a task</a> <a><i>TCallControl</i></a> to monitor call flow
progress.
</li>
</ol>
<p class="issue">
The <code>incoming</code>, <code>serviceadded</code> and
<code>serviceremoved</code> events have to be defined according to
DOM4.
</p>The task <a><i>TCallControl</i></a> MUST listen to any event that
results in a call disconnection, and upon such events, follow the steps
described for <a href='#steps-disconnect-system'>handling disconnected
calls</a>.
<p>
The <code>sendTones()</code> method when invoked MUST make a request
to the telephony system to start sending the tones passed in the
<code>tones</code> parameter to the telephony service used by the
active TelephonyCall object, using the default tone duration and
delay, unless a different <a>telephony service</a>, tone duration,
and/or delay is specified via the parameter. If the request is
acknowledged, then return to the caller. If there is an error,
<a>queue a task</a> to <a>fire a simple event</a> named
<a><code>error</code></a> at the <a>TelephonyManager</a> object
managing the call.
</p>
</section><!-- telephonymanager-steps -->
<!-- - - - - - - - - - - - Dictionary DialParams - - - - - - - - - - - - - -->
<section>
<h3>
<a>DialParams</a> Dictionary
</h3>
<dl title="dictionary DialParams" class="idl">
<dt>
boolean hideCallerId
</dt>
<dd>
Indicates whether the own number is to be hidden or displayed to
the remote party being called. If missing, the user agent uses the
default configuration for the <a>telephony service</a> that
initiated the call.
</dd>
<dt>
DOMString serviceId
</dt>
<dd>
Indicates the <a>telephony service id</a> of the <a>telephony
service</a> to be used when dialing.
</dd>
</dl>
</section>
<!-- - - - - - - - - - - - Dictionary ToneParams - - - - - - - - - - - - - -->
<section>
<h3>
<a>ToneParams</a> Dictionary
</h3>
<dl title="dictionary ToneParams" class="idl">
<dt>
unsigned long duration
</dt>
<dd>
Indicates the duration (mark) in milliseconds of the [[!DTMF]]
tones to be sent. If not specified, the implementation MUST provide
a default value.
</dd>
<dt>
unsigned long gap
</dt>
<dd>
Indicates the duration in milliseconds of the time gap (space)
before a [[!DTMF]] tone. If not specified, the implementation MUST
provide a default value.
</dd>
<dt>
DOMString serviceId
</dt>
<dd>
Indicates the <a>telephony service id</a> of the <a>telephony
service</a> to be used when dialing.
</dd>
</dl>
</section>
</section><!-- TelephonyManager -->
<!-- - - - - - - - - - - - Interface TelephonyErrorEvent - - - - - - - - - -->
<section>
<h2>
<a>TelephonyErrorEvent</a> Interface
</h2>
<p>
Represents an error that occured during the lifecycle of a telephony
call.
</p>
<dl title="interface TelephonyEvent : Event" class="idl">
<dt>
readonly attribute TelephonyCall call
</dt>
<dd>
When getting, the user agent MUST return the <a>TelephonyCall</a>
object which caused the event to be fired.
</dd>
<dt>
readonly attribute DOMError error
</dt>
<dd>
When getting, the user agent MUST return the <a>DOMError</a> object
that describes the error that occured.
</dd>
</dl>
</section><!-- interface TelephonyEvent -->
<!-- - - - - - - - - - - - Interface TelephonyEvent - - - - - - - - - - - - -->
<section>
<h2>
<a>TelephonyEvent</a> Interface
</h2>
<p>
Defines a telephony events for <a>TelephonyCall</a> state changes,
including handling incoming and waiting calls.
</p>
<dl title="interface TelephonyEvent : Event" class="idl">
<dt>
readonly attribute TelephonyCall call
</dt>
<dd>
When getting, the user agent MUST return the <a>TelephonyCall</a>
that triggered the event.
</dd>
</dl>
</section><!-- interface TelephonyEvent -->
<!-- - - - - - - - - - Interface TelephonyServiceEvent - - - - - - - - - - -->
<section>
<h2>
<a>TelephonyServiceEvent</a> Interface
</h2>
<p>
Defines a telephony event for notifying a changed <a>telephony
service</a>.
</p>
<dl title="interface TelephonyServiceEvent : Event" class="idl">
<dt>
readonly attribute DOMString serviceId
</dt>
<dd>
When getting, the user agent MUST return the <a>telephony service
id</a> of the <a>telephony service</a> that triggered the event.
</dd>
</dl>
</section><!-- interface TelephonyServiceEvent -->
<!-- - - - - - - - - - - - Interface CallHandler - - - - - - - - - - - - -->
<section>
<h2>
<a>CallHandler</a> interface
</h2>
<p>
The <code>CallHandler</code> interface provides common properties and
event handling infrastructure that is <a href=
"http://www.w3.org/TR/WebIDL/#idl-implements-statements">implemented</a>
by other interfaces in this specifcation (i.e., it serves as an
editorial aid in this specification, and has no functional utility on
its own).
</p>
<dl title="[NoInterfaceObject] interface CallHandler" class="idl">
<dt>
void resume()
</dt>
<dd>
Initiates resuming a held <a>Call</a>.
</dd>
<dt>
void hold()
</dt>
<dd>
Initiates putting the <a>Call</a> on hold.
</dd>
<dt>
void disconnect()
</dt>
<dd>
If invoked on a <a>TelephonyCall</a>, it initiates releasing of the
telephony call. If invoked on a <a>ConferenceCall</a>, Initiates
releasing the multiparty call, and each participating
<a>TelephonyCall</a> object.
</dd>
<dt>
readonly attribute DOMString callId
</dt>
<dd>
When getting, the user agent MUST return the <a>call id</a> of the
<a>Call</a> object, unique in the system and call history.
</dd>
<dt>
readonly attribute DOMString serviceId
</dt>
<dd>
When getting, the user agent MUST return the <a>telephony service
id</a> of the <a>telephony service</a> associated with this call.
</dd>
<dt>
readonly attribute CallState state
</dt>
<dd>
Whe getting, the user agent MUST return the <a>CallState</a> value
that represents the state of for the <a>Call</a>.
</dd>
<dt>
attribute EventHandler onerror
</dt>
<dd>
Event handler dispatched when there is an error during the life cycle
of a call.
</dd>
<dt>
attribute EventHandler onstatechange
</dt>
<dd>
Event handler dispatched when the <a>state</a> changes.
</dd>
</dl>
</section><!-- CallHandler Interface -->
<!-- - - - - - - - - - - - Interface TelephonyCall - - - - - - - - - - - - -->
<section>
<h2>
<a>TelephonyCall</a> Interface
</h2>
<p>
Defines the object structure for controlling calls.
</p>
<dl title="TelephonyCall implements CallHandler" class="idl"></dl>
<dl title="interface TelephonyCall : EventHandler" class="idl">
<dt>
readonly attribute boolean inCconference
</dt>
<dd>
When getting, the user agent MUST return <code>true</code> if the
<a>Call</a> is participating in a <a>ConferenceCall</a> (i.e., is
present in the <a>calls</a> attribute of a <a>ConferenceCall</a>
object), <code>false</code> otherwise.
</dd>
<dt>
readonly attribute DOMString? remoteParty
</dt>
<dd>
When getting, the user agent MUST return the remote party identifier
(e.g. telephone number) of the call participant. If not available
(e.g. callerId has been hidden), return <code>null</code>.
</dd>
<dt>
readonly attribute DOMString? conferenceId
</dt>
<dd>
When getting, if this call is managed as a part of a multiparty call
then the user agent MUST return the value of the
<code>conferenceId</code> property of the
<a><code>ConferenceCall</code></a> multiparty call to which this call
is part of. Otherwise, return null.
</dd>
<dt>
void accept()
</dt>
<dd>
Accepts the incoming or waiting telephony call.
</dd>
<dt>
void redirect(in DOMString remoteParty)
</dt>
<dd>
Initiates deflecting an incoming or waiting telephone call to another
remote party.
<dl class='parameters'>
<dt>
DOMString remoteParty
</dt>
<dd>
Indicates the remote party to which the call is redirected.
</dd>
</dl>
</dd>
<dt>
void transfer(in DOMString thirdParty)
</dt>
<dd>
Initiates transferring the call to a new call between the remote
party of this call and another remote party, then disconnects the
call.
<dl class='parameters'>
<dt>
DOMString thirdParty
</dt>
<dd>
Indicates the remote party to which the call is transferred.
</dd>
</dl>
</dd>
<dt>
ConferenceCall join(<!--optional DOMString remoteParty-->)
</dt>
<dd>
Initiates merging the active and held calls into a multiparty call.
<!--When called with the <a>remote party id</a> of the new
call participant, puts the current call on hold, dials a new call to the
participant, then creates a conference call by merging the current call and
the new call.--> Using this method MUST be the only way to create a <code>
ConferenceCall</code> object.
</dd>
<dt>
attribute EventHandler ondialing
</dt>
<dd>
Event handler called when the call state changes to
<code>"dialing"</code> and the <code>dialing</code> event is
dispatched.
</dd>
<dt>
attribute EventHandler onalerting
</dt>
<dd>
Event handler called when the call state changes to
<code>"alerting"</code> and the <code>alerting</code> event is
dispatched.