7.3 canInsertDTMF algorithm

To determine if DTMF can be sent for an RTCDTMFSender instance dtmfSender, the user agent MUST queue a task that runs the following steps:

  1. Let sender be the RTCRtpSender associated with dtmfSender.
  2. Let transceiver be the RTCRtpTransceiver associated with sender.
  3. Let connection be the RTCPeerConnection associated with transceiver.
  4. If connection’s RTCPeerConnectionState is not “connected“ return false.
  5. If sender.[[SenderTrack]] is null return false.
  6. If transceiver.[[CurrentDirection]] is neither “sendrecv“ nor “sendonly“ return false.
  7. If sender.[[SendEncodings]][0].active is false return false.
  8. If no codec with mimetype "audio/telephone-event" has been negotiated for sending with this sender, return false.
  9. Otherwise, return true.