-
Notifications
You must be signed in to change notification settings - Fork 2
PhoneCall
Lejla Solak edited this page Jun 7, 2023
·
2 revisions
extends
Call
PhoneCallOptions options()
void setEventListener(PhoneCallEventListener phoneCallEventListener)
PhoneCallEventListener getEventListener()
Returns the call options with which the call was started.
Configures event handler for phone call events.
-
phoneCallEventListener
:PhoneCallEventListener
- Interface with event methods that should be implemented, method per phone call event to be handled.
N/A
InfobipRTC infobipRTC = InfobipRTC.getInstance();
PhoneCall phoneCall = (PhoneCall) infobipRTC.getActiveCall();
phoneCall.setEventListener(new DefaultPhoneCallEventListener() {
@Override
public void onRinging(CallRingingEvent callRingingEvent) {
Toast.makeText(getApplicationContext(), "Ringing!", Toast.LENGTH_LONG);
}
@Override
public void onEstablished(CallEstablishedEvent callEstablishedEvent) {
Toast.makeText(getApplicationContext(), "Established!", Toast.LENGTH_LONG);
}
@Override
public void onHangup(CallHangupEvent callHangupEvent) {
Toast.makeText(getApplicationContext(), "Hangup!", Toast.LENGTH_LONG);
}
@Override
public void onError(ErrorEvent errorEvent) {
Toast.makeText(getApplicationContext(), "Error!", Toast.LENGTH_LONG);
}
});
Returns event handler for phone call events.
none
-
PhoneCallEventListener
- Interface that should be implemented in order to handle phone call events properly.
InfobipRTC infobipRTC = InfobipRTC.getInstance();
PhoneCall phoneCall = (PhoneCall) infobipRTC.getActiveCall();
PhoneCallEventListener phoneCallEventListener = phoneCall.getEventListener();