-
Notifications
You must be signed in to change notification settings - Fork 2
CallWebrtcRequest
Lejla Solak edited this page Feb 10, 2025
·
4 revisions
extends
CallRequest
CallWebrtcRequest(String token, Context context, String destination, WebrtcCallEventListener webrtcCallEventListener)
WebrtcCallEventListener getWebrtcCallEventListener
Creates an instance of CallWebrtcRequest
required for making an outgoing WebRTC call
via callWebrtc
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.Context
class, which provides access to system services, resources, and application-specific data in an Android application. -
destination
:String
- WebRTC identity to call. -
webrtcCallEventListener
:WebrtcCallEventListener
- Event listener used for receiving call events.
-
CallWebrtcRequest
- Instance of theCallWebrtcRequest
.
CallWebrtcRequest callWebrtcRequest = new CallWebrtcRequest(
obtainToken(),
getApplicationContext(),
"alice",
new DefaultWebrtcCallEventListener() {
@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 webrtcCallEventListener
field.
none
-
WebrtcCallEventListener
- The value of thewebrtcCallEventListener
field, which represents interface to be implemented, provided in the request.
WebrtcCallEventListener webrtcCallEventListener = callWebrtcRequest.getWebrtcCallEventListener();