-
Notifications
You must be signed in to change notification settings - Fork 2
CallApplicationRequest
Lejla Solak edited this page Aug 5, 2024
·
6 revisions
CallApplicationRequest(String token, Context context, String callsConfigurationId, ApplicationCallEventListener applicationCallEventListener)
String getToken()
Context getContext()
String getCallsConfigurationId()
ApplicationCallEventListener getApplicationCallEventListener()
Creates a new instance of CallApplicationRequest
.
-
token
:String
- Authentication token generated by client's app via Infobip's HTTP /webrtc/1/token endpoint. -
context
:Context
- Instance of theandroid.content.Context
class. -
callsConfigurationId
:String
- Represents theCalls Configuration ID
which is configured using theCalls Configuration API
. -
applicationCallEventListener
:ApplicationCallEventListener
- Interface with event methods that should be implemented, method per application call event to be handled.
N/A
String token = obtainToken();
CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
token,
getApplicationContext(),
"45g2gql9ay4a2blu55uk1628",
new DefaultApplicationCallEventListener() {
@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 token
field.
none
-
String
- Value oftoken
field.
String token = obtainToken();
CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
token,
getApplicationContext(),
"45g2gql9ay4a2blu55uk1628",
new DefaultApplicationCallEventListener() {
@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);
}
}
);
Log.d("WebRTC", "Token: " + callApplicationRequest.getToken());
Getter for context
field.
none
-
Context
- Value ofcontext
field.
String token = obtainToken();
CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
token,
getApplicationContext(),
"45g2gql9ay4a2blu55uk1628",
new DefaultApplicationCallEventListener() {
@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);
}
}
);
Log.d("WebRTC", "Context: " + callApplicationRequest.getContext());
Getter for callsConfigurationId
field.
none
-
String
- Value ofcallsConfigurationId
field.
String token = obtainToken();
CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
token,
getApplicationContext(),
"45g2gql9ay4a2blu55uk1628",
new DefaultApplicationCallEventListener() {
@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);
}
}
);
Log.d("WebRTC", "Destination: " + callApplicationRequest.getCallsConfigurationId());
Getter for applicationCallEventListener
field.
none
-
ApplicationCallEventListener
- Value ofapplicationCallEventListener
field.
String token = obtainToken();
CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
token,
getApplicationContext(),
"45g2gql9ay4a2blu55uk1628",
new DefaultApplicationCallEventListener() {
@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);
}
}
);
ApplicationCallEventListener applicationCallEvenListener = callApplicationRequest.getApplicationCallEventListener();