Call class reference for the Telnyx Flutter Voice SDK. Represents an active audio or video call and exposes accept, decline, hold, mute, and DTMF methods.
Call
The Call class is used to manage the call state and call actions. It is used to accept, decline, end, mute, hold, and send DTMF tones during a call.
Accept Call
In order to accept a call, we simply retrieve the instance of the call and use the .acceptCall(callID) method:
In order to end a call, we can get a stored instance of Call and call the .endCall(callID) method. To decline an incoming call we first create the call with the .createCall() method and then call the .endCall(callID) method:
if (_ongoingCall) { _telnyxClient.call.endCall(_telnyxClient.call.callId); } else { _telnyxClient.createCall().endCall(_incomingInvite?.callID); }
DTMF (Dual Tone Multi Frequency)
In order to send a DTMF message while on a call you can call the .dtmf(callID, tone), method where tone is a String value of the character you would like pressed: