Mesibo Video and Voice Calls

Call API Reference

The following is a list of methods available in Call API. The Call object is created by calling MesiboCall.call() or mesibo creates for you in an incoming call as explained in Overview.

Initialization Functions

start

It starts call processing. This MUST be the first function you should call once your user-interface is ready.

It takes the following parameters:

setListener

Set the listener class that will be called during the active call. You will only need to use this function if you need to change the listener after calling start().

It takes the following parameter:

For example, in Android,

mCall.setListener(this);
// The InProgressListener is implemented in "this" context

Call Handling Functions

answer

Answer the incoming call.

It takes the following parameter:

  • video, true in case of answering a video call, false otherwise. If you answer an incoming video call with answer(false), it will be converted to a voice-only call.

For example, in Android, to answer a video call,

mCall.answer(true);

hangup

End the call.

It does not take any parameters.

For example, in Android,

mCall.hangup();

mute

Mute or unmute voice and/or video

It takes the following parameters:

  • audio, audio mute/unmute operation
  • video, video mute/unmute operation
  • enable, Pass true to mute, false to unmute.

For example, in Android, to mute audio

mCall.mute(true, false, true)

sendDtmf

Send DTMF tone

It takes the following parameter:

  • digit Send DTMF tone for this digit

For example, in Android,

mCall.sendDtmf(int digit);

Video Handling Functions

setVideoView

Set the video view for a video call

It takes the following parameters:

  • mesiboVideoView, An instance of MesiboVideoView to display the video
  • remote, true to show remote video in this view, false to show local video.

For example, in Android,

mCall.setVideoView(fullScreenView, true);

setVideoScaling

Set the scaling type

It takes the following parameter:

For example, in Android,

mCall.setVideoScaling(MesiboCall.VideoScalingType.AUTO);

switchCamera

Switch between the back-facing camera and front-facing camera.

It does not take any parameters.

For example, in Android,

mCall.switchCamera();

toggleVideoMute

Toggle mute the video during a call. That is, unmute the video if it is muted and mute it otherwise. Stops video capture through the camera if the video is muted.

It does not take any parameters.

For example, in Android,

mCall.toggleVideoMute();

Voice Handling Functions

setAudioDevice

Set the audio device to be used for the call. The audio device can be Bluetooth, wired headset, earpiece, or the speaker.

Note that audio device selection algorithm varies between manufacturers (especially in Android) and hence it is recommended to only use speaker device in this function call - enable speaker when you'd like to use the speaker, disable otherwise and the API will automatically select the correct device. The selected device will be conveyed in the MesiboCall_OnAudioDeviceChanged callback.

It takes the following parameters:

  • audioDevices, AudioDevice which specifies the type of audio device to be used
  • enable, Set to true to enable audio device, false otherwise

For example, in Android,

mCall.setAudioDevice(MesiboCall.AudioDevice.SPEAKER, true);

toggleAudioDevice

Enable or disable the audio device.

It takes the following parameter:

  • AudioDevice, An audio device indicated by an AudioDevice constant.

For example, in Android,

mCall.toggleAudioDevice(MesiboCall.AudioDevice.SPEAKER);

toggleAudioMute

Toggle mute the audio during a call. That is, unmute the audio if it is muted and mute it otherwise.

It does not take any parameters.

For example, in Android,

mCall.toggleAudioMute();

getActiveAudioDevice

Returns the current audio device being used in a call as an AudioDevice constant. Returns null if there are any errors accessing the device.

It does not take any parameters.

For example, in Android,

mCall.getActiveAudioDevice();

Call Status/Information Functions

getAnswerTime

Returns the timestamp when the call was answered.

It does not take any parameters.

For example, in Android,

mCall.getAnswerTime();

getCallProperties

Returns CallProperties object that was passed while creating the call object(in case of an outgoing call) or the object that was returned by the listener MesiboCall_OnIncoming in case of an incoming call.

It does not take any parameters.

For example, in Android,

mCall.getCallProperties();

getMuteStatus

getMuteStatus Returns the current mute status of the call. In case either of the parties on a call mute audio/video, the mute status will be updated.

It takes the following parameters:

  • video, Pass true to check video mute status, false for voice mute status.
  • remote, Pass true to check remote user mute status, false for local.

For example, in Android, to check if the remote party has muted their audio

boolean m = mCall.getMuteStatus(false, true, false)

isAnswered

Returns true if the call is answered, false otherwise.

It does not take any parameters.

For example, in Android,

mCall.isAnswered();

isCallConnected

Returns true if the call is connected, false otherwise.

It does not take any parameters.

For example, in Android,

mCall.isCallConnected();

isIncoming

Returns true if it is an incoming call, false if it is an outgoing call.

It does not take any parameters.

For example, in Android,

mCall.isIncoming();

isLinkup

Returns true if the peer-to-peer connection is established, false otherwise.

It does not take any parameters.

For example, in Android,

mCall.isLinkup();

isVideoCall

Returns true if it is a video call, false if it is an audio call.

It does not take any parameters.

For example, in Android,

mCall.isVideoCall();

Utility Functions

playInCallSound

Enable playing of the in call ringing sound in case of an outgoing call.

It takes the following parameters:

  • context, Application context.
  • audio file, In Android, pass the resource-ID of the audio that you need to play. In iOS, provide the path to the audio file is an NSUrl.
  • enable, Set to true, to enable playing the sound.

stopInCallSound

Stops the in-call sound.

It does not take any parameters.

For example, in Android,

mCall.stopInCallSound();