I am developing a voip app utilizing PJSIP for the calling. I manage to send DTMF strings through SIP without needing to play the actual tone over RTP, which in my case seems more reliable. However, this doesnt produce any sound after the button press, so the user doesnt get any audio feedback. I am looking for a way to play the sound to the user inside the connection.
I tried calling:
Connection.onPlayDtmfTone(digit.charAt(0));
But that doesnt really seem to do anything. I am looking for something similar like the ability to play the remote hold sound in the connection, which works perfectly using:
Connection.sendConnectionEvent(Connection.EVENT_ON_HOLD_TONE_START, null);
Figured it out. Using ToneGenerator for generating the tones:
public static void playDtmfTone(String digit) {
ToneGenerator toneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, 100);
toneGenerator.startTone(Integer.parseInt(digit),250);
}