Mesibo Video and Voice Calls
MesiboCall Class Reference
MesiboCall is the main class to access all the mesibo call API functionalities and access the following classes:
For a detailed review of the Call API, see Mesibo Voice and Video Call API .
MesiboCall is a singleton class. You can access the instance of MesiboCall using the getInstance() method.
For example, in Android,
MesiboCall.getInstance()Once you obtain the instance, you can then call the following methods.
MesiboCall methods
init
Initialize the mesibo call.
It does not take any parameters.
For example, in Android,
MesiboCall.getInstance.init()createCallProperties
Creates a CallProperties object.
It takes the following parameter:
- video, Pass true if initializing properties for a video call, false for an audio call
Returns:
CallProperties object.
For example, in Android, to create call properties for a video call,
MesiboCall.CallProperties cp = MesiboCall.getInstance().createCallProperties(true);call
Create an outgoing call object.
It takes the following parameter:
- properties, CallProperties object.
For example, in Android,
MesiboCall.CallProperties cp = new MesiboCall.CallProperties(false);
MesiboCall.Call mCall = MesiboCall.getInstance.init(cp);
if(mCall == null){
//Call failed
}Returns:
A Call object. If the call fails, it returns null.
isCallInProgress
Returns true if the call is in progress, false otherwise. It does not take any parameters.
For example, in Android,
MesiboCall.getInstance().isCallInProgress();getActiveCall
Returns a Call object if there is an active call, null otherwise.
For example, in Android,
MesiboCall.getInstance().init();callUi
Launch default Call screen by passing a CallProperties object.
It takes the following parameter:
- properties,
CallPropertiesobject
Returns: true if call UI was initialized, false otherwise.
setDefaultUiProperties
Sets default UI properties for the default Call user-interface
It takes the following parameter:
- ui, UIProperties object
For example, in Android
MesiboCall.init(context);
MesiboCall.getInstance().setDefaultUiProperties(ui);MesiboCall constants
MesiboCall has the following constants.
AudioDevice
MesiboCall.AudioDevice indicates the audio device being used for the call. Can be one of the following:
AudioDevice.BLUETOOTHAudioDevice.EARPIECEAudioDevice.HEADSETAudioDevice.SPEAKERAudioDevice.NONE
To change the active audio device use setAudioDevice To get the active audio device, use getActiveAudioDevice
When the active audio device changes, the callback function MesiboCall_OnAudioDeviceChanged will be called.
VideoScalingType
MesiboCall.VideoScalingType can be one of the following:
VideoScalingType.AUTO, Scale the video automatically for the best fitVideoScalingType.FILL, to fill the available area to display the video in the given aspect ratio. May scale to zoom-in to the video.VideoScalingType.FIT, snap to fit the video with the given aspect ratio in the available area.
Video Codecs
MesiboCall.MESIBOCALL_CODEC_VP8MesiboCall.MESIBOCALL_CODEC_VP9MesiboCall.MESIBOCALL_CODEC_H264MesiboCall.MESIBOCALL_CODEC_H265MesiboCall.MESIBOCALL_CODEC_OPUS
Hangup Reasons
MESIBOCALL_HANGUP_REASON_USER, Call hanged up on the local endMESIBOCALL_HANGUP_REASON_REMOTE, Call hanged up by the remote endMESIBOCALL_HANGUP_REASON_ERROR, An error occurred which ended the call. Also, see MesiboCall_OnError
UI States
MESIBOCALL_UI_STATE_SHOWINCOMING, Show incoming call screenMESIBOCALL_UI_STATE_SHOWINPROGRESS, Show the InProgress call screen. For example, after an incoming call is accepted.MESIBOCALL_UI_STATE_SHOWCONTROLS, Show or hide controls
Other Constants
MesiboCall.MESIBOCALL_ERROR_BUSYMesiboCall.MESIBOCALL_NOTIFY_INCOMINGMesiboCall.MESIBOCALL_NOTIFY_MISSINGMesiboCall.MESIBOCALL_PERMISSION_REQUEST_CODEMesiboCall.MESIBOCALL_SOUND_BUSYMesiboCall.MESIBOCALL_SOUND_RINGING