Skip to content

IncomingApplicationCall

Ajša Terko edited this page Apr 26, 2023 · 2 revisions

extends ApplicationCall



from()

Description

Returns the identifier of the caller that made the call.

Arguments

  • none

Returns

  • String - Represents the identifier of the caller.

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingApplicationCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingApplicationCall();
        Log.d("WebRTC", "Incoming application call from: " + incomingApplicationCall.from());
    }
};



fromDisplayName()

Description

Returns the display identifier of the caller that made the call.

Arguments

  • none

Returns

  • String - Represents the display identifier of the caller.

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingApplicationCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingApplicationCall();
        Log.d("WebRTC", "Incoming application call from display name: " + incomingApplicationCall.fromDisplayName());
    }
};



accept()

Description

Accepts incoming application call, which ends up in the call being connected to your application.

Arguments

  • none

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingCall();
        Log.d("WebRTC", "Received incoming application call from:  " + incomingApplicationCall.from());
        incomingApplicationCall.setEventListener(new DefaultApplicationCallEventListener());
        incomingApplicationCall.accept();
    }
};



accept(applicationCallOptions)

Description

Accepts incoming application call, which ends up in the call being connected to your application. This method overrides call options and lets you accept call with different ones.

Arguments

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingApplicationCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingCall();
        Log.d("WebRTC", "Received incoming application call from: " + incomingApplicationCall.from());
        incomingApplicationCall.setEventListener(new DefaultApplicationCallEventListener());

        VideoOptions videoOptions = VideoOptions.builder()
                                    .cameraOrientation(VideoOptions.CameraOrientation.FRONT)
                                    .build();
        
        ApplicationCallOptions options = ApplicationCallOptions.builder()
                                                        .video(true)
                                                        .videoOptions(videoOptions)
                                                        .build();

        incomingApplicationCall.accept(options);
    }
};



decline()

Description

Declines incoming call.

Arguments

  • none

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingApplicationCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingApplicationCall();
        Log.d("WebRTC", "Received incoming application call from: " + incomingApplicationCall.from());
        incomingApplicationCall.setEventListener(new DefaultApplicationCallEventListener());
        incomingApplicationCall.decline();
    }
};



decline(declineOptions)

Description

Declines an incoming call, with an option to decline it on all devices.

Arguments

  • declineOptions: DeclineOptions - Optional additional option to decline an incoming call on all devices.

Returns

  • N/A

Example

IncomingCallEventListener incomingCallEventListener = new IncomingCallEventListener() {
    @Override
    public void onIncomingApplicationCall(IncomingApplicationCallEvent incomingApplicationCallEvent) {
        IncomingApplicationCall incomingApplicationCall = incomingApplicationCallEvent.getIncomingApplicationCall();
        Log.d("WebRTC", "Received incoming application call from: " + incomingApplicationCall.from());
        incomingApplicationCall.setEventListener(new DefaultApplicationCallEventListener());
        incomingApplicationCall.decline(DeclineOptions.builder().setDeclineOnAllDevices(true).build());
    }
};

Tutorials

Migration guides

Reference documentation

Clone this wiki locally