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:
- Let sender be the
RTCRtpSender
associated with dtmfSender. - Let transceiver be the
RTCRtpTransceiver
associated with sender. - Let connection be the
RTCPeerConnection
associated with transceiver. - If connection’s
RTCPeerConnectionState
is not “connected
“ returnfalse
. - If sender.[[SenderTrack]] is
null
returnfalse
. - If transceiver.[[CurrentDirection]] is neither “
sendrecv
“ nor “sendonly
“ returnfalse
. - If sender.[[SendEncodings]]
[0]
.active
isfalse
returnfalse
. - If no codec with mimetype
"audio/telephone-event"
has been negotiated for sending with this sender, returnfalse
. - Otherwise, return
true
.