Callee
Accepting Calls
Use SDK's default parameters unless otherwise required.
- Camera: Default settings (usually front-facing camera).
- Video parameters: Default 480 x 640 resolution at 30 FPS.
You may also specify camera and video parameters before each call. See setVideoConfig.
When rejecting or ending a call, the SDK handles internal processes automatically and notifies the peer about the rejection/termination reason.
Default Acceptance Method
Upon receiving an incoming call request via onReceiveCall, use the accept method of RCCallEngine to answer.
Note
This method activates the default camera device (typically front-facing by default).
-
Sample code:
engine?.onReceiveCall = (RCCallSession session) {
engine?.accept();
};
Answer with Specified Camera
After receiving an incoming call request in the listener, use the following code to answer while activating a specific camera.
-
Sample code:
engine?.onReceiveCall = (RCCallSession session) {
RCCallVideoConfig videoConfig = RCCallVideoConfig.create(
/// Activates rear camera
defaultCamera: RCCallCamera.back,
);
/// Configures video parameters
engine?.setVideoConfig(videoConfig);
engine?.accept();
};
Rejecting/Ending Calls
Call RCCallEngine.hangup to terminate a call. Rejection and call termination share the same method—the SDK automatically informs the peer about the reason.
-
Sample code:
engine?.hangup();