Skip to content

Commit

Permalink
Fix DTMF causes track to become disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
singpolyma authored and horazont committed Mar 27, 2023
1 parent 906d5b1 commit 3e03f11
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,10 @@ public DtmfSender getDtmfSender() {
}

public boolean applyDtmfTone(String tone) {
if (toneManager == null || peerConnection == null || peerConnection.getSenders().isEmpty()) {
if (toneManager == null || peerConnection == null || localAudioTrack == null) {
return false;
}
peerConnection.getSenders().get(0).dtmf().insertDtmf(tone, TONE_DURATION, 100);
localAudioTrack.rtpSender.dtmf().insertDtmf(tone, TONE_DURATION, 100);
toneManager.startTone(TONE_CODES.get(tone), TONE_DURATION);
return true;
}
Expand Down

0 comments on commit 3e03f11

Please sign in to comment.