-
Notifications
You must be signed in to change notification settings - Fork 2
CallPhoneRequest
Lejla Solak edited this page Feb 10, 2025
·
4 revisions
extends CallRequest
CallPhoneRequest(String token, Context context, String destination, PhoneCallEventListener phoneCallEventListener)PhoneCallEventListener getPhoneCallEventListener()
Creates an instance of CallPhoneRequest required for making an outgoing phone call
via callPhone method.
-
token:String- Authentication token generated by client's app via Infobip's HTTP /webrtc/1/token endpoint. -
context:Context- An instance of theandroid.content.Contextclass, which provides access to system services, resources, and application-specific data in an Android application. -
destination:String- Phone number to call. -
phoneCallEventListener:PhoneCallEventListener- Event listener used for receiving call events.
-
CallPhoneRequest- Instance of theCallPhoneRequest.
CallPhoneRequest callPhoneRequest = new CallPhoneRequest(
obtainToken(),
getApplicationContext(),
"41793026727",
new DefaultPhoneCallEventListener() {
@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);
}
@Override
public void onRinging(CallRingingEvent callRingingEvent) {
Toast.makeText(getApplicationContext(), "Ringing!", Toast.LENGTH_LONG);
}
}
);Getter for the phoneCallEventListener field.
none
-
PhoneCallEventListener- The value of thephoneCallEventListenerfield, which represents interface to be implemented, provided in the request.
PhoneCallEventListener phoneCallEventListener = callPhoneRequest.getPhoneCallEventListener();