Skip to content

CallApplicationRequest

Lejla Solak edited this page Feb 10, 2025 · 7 revisions



CallApplicationRequest(token, context, callsConfigurationId, applicationCallEventListener)

Description

Creates an instance of CallApplicationRequest required for making an outgoing application call via callApplication method.

Arguments

  • token: String - Authentication token generated by client's app via Infobip's HTTP /webrtc/1/token endpoint.
  • context: Context - An instance of the android.content.Context class, which provides access to system services, resources, and application-specific data in an Android application.
  • callsConfigurationId: String - Represents a unique Calls Configuration ID which is configured using the Calls Configuration API.
  • applicationCallEventListener: ApplicationCallEventListener - Interface containing event methods that must be implemented, one for each application call event to be handled.

Returns

Example

CallApplicationRequest callApplicationRequest = new CallApplicationRequest(
        obtainToken(),
        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);
            }
        }
);



getToken()

Description

Getter for the token field.

Arguments

  • none

Returns

  • String - The value of the token field, which represents the authentication token provided in the request.

Example

String token = callApplicationRequest.getToken();



getContext()

Description

Getter for the context field.

Arguments

  • none

Returns

  • Context - The value of the context field, which represents the Android context provided in the request.

Example

Context context = callApplicationRequest.getContext();



getCallsConfigurationId()

Description

Getter for the callsConfigurationId field.

Arguments

  • none

Returns

  • String - The value of the callsConfigurationId field, which represents a unique Calls Configuration identifier provided in the request.

Example

String callsConfigurationId = callApplicationRequest.getCallsConfigurationId();



getApplicationCallEventListener()

Description

Getter for the applicationCallEventListener field.

Arguments

  • none

Returns

  • ApplicationCallEventListener - The value of the applicationCallEventListener field, which represents interface to be implemented, provided in the request.

Example

ApplicationCallEventListener applicationCallEventListener = callApplicationRequest.getApplicationCallEventListener();

Tutorials

Migration guides

Reference documentation

Clone this wiki locally