-
Notifications
You must be signed in to change notification settings - Fork 2
Call
String id()CallStatus status()int duration()Date startTime()Date establishTime()Date endTime()Endpoint source()Endpoint destination()Endpoint counterpart()void mute(boolean shouldMute) throws ActionFailedExceptionboolean muted()void speakerphone(boolean enabled)boolean speakerphone()void sendDTMF(String dtmf) throws ActionFailedExceptionvoid setNetworkQualityEventListener(NetworkQualityEventListener networkQualityEventListener)NetworkQualityEventListener getNetworkQualityEventListener()AudioDeviceManager audioDeviceManager()void audioQualityMode(AudioOptions.AudioQualityMode audioQualityMode)AudioOptions.AudioQualityMode audioQualityMode()void hangup()
Returns a unique call identifier.
none
-
String- Call ID.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
String callId = webrtcCall.id();Returns current call status.
none
-
CallStatus- Call status.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
CallStatus callStatus = webrtcCall.status();Returns call duration in seconds calculated from the time call was established. 0 if the call has not been established
yet.
none
-
int- Call duration in seconds
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
int callDuration = webrtcCall.duration();Returns the time when the call started (but was not yet established). Initially, startTime is null.
none
-
Date- Time when the call was initiated
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Date startTime = webrtcCall.startTime();Returns the time when the call was established. Initially, establishTime is null.
none
-
Date- Time when the call was established
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Date establishTime = webrtcCall.establishTime();Returns the time when the call finished. Initially, endTime is null.
none
-
Date- Time when the call finished
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Date endTime = webrtcCall.endTime();Returns the endpoint from which the call originated.
none
-
Endpoint- Endpoint which initiated the call
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Endpoint source = webrtcCall.source();Returns the endpoint which received the call.
none
-
Endpoint- Endpoint which received the call
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Endpoint destination = webrtcCall.destination();Returns the remote endpoint which is participating in the call.
none
-
Endpoint- Remote endpoint which is participating in the call.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
Endpoint counterpart = webrtcCall.counterpart();Controls whether the user's audio in the call should be muted after this action. Disabled by default.
-
shouldMute:boolean-trueif the audio should be muted, otherwisefalse.
N/A
-
ActionFailedException- if muting fails for any reason.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
try {
webrtcCall.mute(true);
} catch (ActionFailedException e) {
Log.w("WebRTC", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}Returns the information whether the user's audio is muted or not.
none
-
boolean-trueif the audio is muted, otherwisefalse.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
boolean muted = webrtcCall.muted();Controls whether the audio should be played on the speakerphone. Disabled by default. If disabled, the audio will be played through the next available audio device based on the priority order.
-
enabled:boolean-trueif the audio should be played on the speakerphone, otherwisefalse.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
webrtcCall.speakerphone(true);
}Returns information whether speakerphone is enabled.
none
-
boolean-trueif the speakerphone is enabled, otherwisefalse.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
boolean speakerphone = webrtcCall.speakerphone();Simulates key-press by sending DTMF (Dual-Tone Multi-Frequency) entry.
-
dtmf:String- One of the allowed DTMF characters:- digits:
0to9 - letters:
AtoD - symbols:
*and#
- digits:
N/A
-
ActionFailedException- if sending DTMF fails for any reason.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
try {
webrtcCall.sendDTMF("7");
} catch (ActionFailedException e) {
Log.w("WebRTC", String.format("Failed to execute action. Error: %s", e.getErrorCode().getDescription()));
}
}Configures event handler for network quality events.
-
networkQualityEventListener:NetworkQualityEventListener- Interface that should be implemented in order to handle network quality events properly.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
webrtcCall.setNetworkQualityEventListener(networkQualityChangedEvent -> {
NetworkQuality networkQuality = networkQualityChangedEvent.getNetworkQuality();
Log.d("WebRTC", String.format("Local network quality is: %s (score: %s)", networkQuality, networkQuality.getScore()));
});
}Returns event handler for network quality events.
none
-
NetworkQualityEventListener- Interface that should be implemented in order to handle network quality events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
NetworkQualityEventListner networkQualityEventListner = webrtcCall.getNetworkQualityEventListener();Returns the instance of AudioDeviceManager that should be used to manage the audio devices in
the current call.
none
-
AudioDeviceManager- An instance ofAudioDeviceManagerspecifically designed for handling audio devices.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
AudioDeviceManager audioDeviceManager = webrtcCall.audioDeviceManager();Sets the audio quality mode to a given enum value.
-
audioQualityMode:AudioOptions.AudioQualityMode- Enum value that corresponds to the audio quality mode.
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
webrtcCall.audioQualityMode(AudioOptions.AudioQualityMode.LOW_DATA);
}Returns the audio quality mode that is used during the call.
none
-
AudioQualityMode- Enum value that corresponds to the audio quality mode.
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
AudioOptions.AudioQualityMode audioQualityMode = webrtcCall.audioQualityMode();
}Hangs up the call, which ends up in both parties receiving the CallHangupEvent, after
the hangup is processed by Infobip WebRTC platform.
none
N/A
private void example() {
InfobipRTC infobipRTC = InfobipRTC.getInstance();
WebrtcCall webrtcCall = (WebrtcCall) infobipRTC.getActiveCall();
webrtcCall.hangup();
}