<?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>18485</bug_id>
          
          <creation_ts>2012-08-03 23:57:56 +0000</creation_ts>
          <short_desc>Change DTMF API to be on PeerConnection</short_desc>
          <delta_ts>2013-06-13 07:39:26 +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>Linux</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="Harald Alvestrand">harald</reporter>
          <assigned_to name="Web RTC Working Group">public-webrtc</assigned_to>
          <cc>fluffy</cc>
    
    <cc>public-webrtc</cc>
    
    <cc>stefan.lk.hakansson</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71837</commentid>
    <comment_count>0</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-08-03 23:57:56 +0000</bug_when>
    <thetext>Implementing the proposed DTMF API has turned out to be surprisingly complex compared to the importance of the feature; the typing requirements for MediaStream seem to be heavily complicated by it.

Tommy Widenflycht has suggested instead that we define calls to make available:

pc.canSendDTMF(MediaStreamTrack)
pc.sendDTMF(MediaStreamTrack, tones, duration)

This has no impact on the definition of MediaStream and allows implementation of sendDTMF without touching anything but PeerConnection.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71927</commentid>
    <comment_count>1</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-08-08 09:50:21 +0000</bug_when>
    <thetext>based on discussion on the list, there seems to be 3 alternate descriptions of what sendDTMF actually does.

I outline them below as text that can be inserted into the description.

A) 
1) If the track argument to sendDTMF is not an audio track connected to this PeerConnection on an outgoing SSRC where use of RFC 4733 DTMF has been negotiated, throw a &lt;IllegalParameter&gt; exception.
2) Send the tones using RFC 4733 signalling.

B)
1) If the track argument to sendDTMF is not an audio track connected to this PeerConnection, throw an &lt;illegalParameter&gt; exception.
2) If sendDTMF is connected to an outgoing SSRC where use of RFC 4377 is negotiated, send the tones using RFC 4377 and return.
3) Insert the corresponding tones into the media stream as if they were coming from the media source.

C)
1) If sendDTMF is connected to an outgoing SSRC on this PeerConnection where use of RFC 4377 is negotiated, send the tones using RFC 4377 and return.
2) Insert the corresponding tones into the media stream as if they were coming from the media source.

The difference between B) and C) is that B) insists on using the right PC to generate tones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71928</commentid>
    <comment_count>2</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2012-08-08 10:23:07 +0000</bug_when>
    <thetext>(In reply to comment #1)

As for alternatives B and C, I think that the tones should not be inserted in the same MediaStream as the outgoing DTMF. The tones are to be used for local feedback, and you would not like to play the other outgoing audio locally.

I think we should go for alternative A initially.



&gt; based on discussion on the list, there seems to be 3 alternate descriptions of
&gt; what sendDTMF actually does.
&gt; 
&gt; I outline them below as text that can be inserted into the description.
&gt; 
&gt; A) 
&gt; 1) If the track argument to sendDTMF is not an audio track connected to this
&gt; PeerConnection on an outgoing SSRC where use of RFC 4733 DTMF has been
&gt; negotiated, throw a &lt;IllegalParameter&gt; exception.
&gt; 2) Send the tones using RFC 4733 signalling.
&gt; 
&gt; B)
&gt; 1) If the track argument to sendDTMF is not an audio track connected to this
&gt; PeerConnection, throw an &lt;illegalParameter&gt; exception.
&gt; 2) If sendDTMF is connected to an outgoing SSRC where use of RFC 4377 is
&gt; negotiated, send the tones using RFC 4377 and return.
&gt; 3) Insert the corresponding tones into the media stream as if they were coming
&gt; from the media source.
&gt; 
&gt; C)
&gt; 1) If sendDTMF is connected to an outgoing SSRC on this PeerConnection where
&gt; use of RFC 4377 is negotiated, send the tones using RFC 4377 and return.
&gt; 2) Insert the corresponding tones into the media stream as if they were coming
&gt; from the media source.
&gt; 
&gt; The difference between B) and C) is that B) insists on using the right PC to
&gt; generate tones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71937</commentid>
    <comment_count>3</comment_count>
    <who name="Stefan Hakansson LK">stefan.lk.hakansson</who>
    <bug_when>2012-08-08 15:16:10 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; based on discussion on the list, there seems to be 3 alternate descriptions of
&gt; what sendDTMF actually does.
&gt; 
&gt; I outline them below as text that can be inserted into the description.
&gt; 
&gt; A) 
&gt; 1) If the track argument to sendDTMF is not an audio track connected to this
&gt; PeerConnection on an outgoing SSRC where use of RFC 4733 DTMF has been
&gt; negotiated, throw a &lt;IllegalParameter&gt; exception.

Minor note: should not an &lt;NotSupported&gt; exception be thrown? At least if RFC4733 has not been negotiated. Not sure &lt;IllegalParameter&gt; is an allowed exception, at least it is not listed here: http://www.w3.org/TR/domcore/#domexception

&gt; 2) Send the tones using RFC 4733 signalling.
&gt; 
&gt; B)
&gt; 1) If the track argument to sendDTMF is not an audio track connected to this
&gt; PeerConnection, throw an &lt;illegalParameter&gt; exception.
&gt; 2) If sendDTMF is connected to an outgoing SSRC where use of RFC 4377 is
&gt; negotiated, send the tones using RFC 4377 and return.
&gt; 3) Insert the corresponding tones into the media stream as if they were coming
&gt; from the media source.
&gt; 
&gt; C)
&gt; 1) If sendDTMF is connected to an outgoing SSRC on this PeerConnection where
&gt; use of RFC 4377 is negotiated, send the tones using RFC 4377 and return.
&gt; 2) Insert the corresponding tones into the media stream as if they were coming
&gt; from the media source.
&gt; 
&gt; The difference between B) and C) is that B) insists on using the right PC to
&gt; generate tones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72125</commentid>
    <comment_count>4</comment_count>
    <who name="Cullen Jennings">fluffy</who>
    <bug_when>2012-08-13 14:52:28 +0000</bug_when>
    <thetext>There is active list discussion on this. I think everyone agrees the current spec is not good and needs a change but not clear yet exactly how to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72188</commentid>
    <comment_count>5</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-08-15 08:38:15 +0000</bug_when>
    <thetext>Based on further discussion, a need has been identified to play back tones in synchronity with the DTMF signals going out. This functionality removes the need for the ability to play out tones on local streams only, since it solves the use case that was intended for. The interface should then become:

pc.canSendDTMF(MediaStreamTrack)
pc.sendDTMF(MediaStreamTrack outTrack, tones, duration, optional MediaStreamTrack localTrack)

with the handling rule being:

1) If the outTrack argument to sendDTMF is not an audio track connected to this
PeerConnection on an outgoing SSRC where use of RFC 4733 DTMF has been
negotiated, throw a &lt;ArgumentError?&gt; exception.
2) Simultaneously do the following:
- Send the tones using RFC 4733 signalling on the outTrack
- If the localTrack is specified, play out an appropriate audio feedback signal using this track, making sure that sound from localTrack does not feed back into outTrack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76477</commentid>
    <comment_count>6</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-10-17 08:38:30 +0000</bug_when>
    <thetext>The previous suggestion, with a track on which feedback would be given, gave some pushback - what the feedback should be, whether a track is the appropriate form of feedback, and so on.

New suggestion (still not valid IDL):

pc.canSendDTMF(MediaStreamTrack)
pc.sendDTMF(MediaStreamTrack outTrack, tones, duration, optional callback)

with the handling rule being

1) If the outTrack argument to sendDTMF is not an audio track connected to this
PeerConnection on an outgoing SSRC where use of RFC 4733 DTMF has been
negotiated, throw a &lt;ArgumentError?&gt; exception.
2) Simultaneously do the following:
- Send the tones using RFC 4733 signalling on the outTrack
- Every time a tone starts and stops, call the callback with either the character of the tone being played or an empty string argument.

Then people can do whatever they like with the feedback tone.

Is this simple enough to let us close this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76485</commentid>
    <comment_count>7</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2012-10-17 09:44:49 +0000</bug_when>
    <thetext>On review of previous comments ... the error thrown should be &lt;NotSupported&gt;, according to Stefan&apos;s comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89235</commentid>
    <comment_count>8</comment_count>
    <who name="Harald Alvestrand">harald</who>
    <bug_when>2013-06-13 07:39:26 +0000</bug_when>
    <thetext>Closed as fixed. API is in the spec, and is implemented in Chrome.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>