Represents a voice, video call.
Used to capture an audio-video stream from the device's microphone and camera for use to make or answer a call. Create a StringeeCall2 instance by calling the StringeeCall2 constructor.
StringeeCall2(client, fromNumber, toNumber, isVideoCall)
Creates a new StringeeCall2 instance to make a call.
Parameters | |
---|---|
client |
The client who wants to make or answer a call. |
fromNumber |
The caller's alias to be displayed to the callee (app-to-app call) or the number you've bought (app-to-phone call). |
toNumber |
The user id of the callee. |
isVideoCall |
true = Video call |
client |
The client who wants to make or answer a call. |
fromNumber |
The caller's alias to be displayed to the callee (app-to-app call) or the number you've bought (app-to-phone call). |
toNumber |
The user id of the callee. |
custom |
This data comes with fromNumber, toNumber is sent to Your Server via the project's answer_url. |
customDataFromYourServer |
The custom data from your server when a client makes a call or receives an incoming call. |
fromAlias |
The alias of the caller. |
toAlias |
The alias of the callee. |
fromInternal |
Check whether the call is a phone-to-app call. |
answeredOnAnotherDevice |
Check whether the call is handled on another device. |
isVideoCall |
Whether the call is a video call: |
isIncomingCall |
Check whether the call is an incoming call |
isAnswered |
Check whether the call is answered |
ended |
Check whether the call is ended |
callId |
The call's id |
localVideoEnabled |
Check whether the local video is displayed |
videoResolution |
The resolution of video |
makeCall(callback) |
Make a call with a callback. |
answer(callback) |
Answers a call and starts the conversation with a callback. |
reject(callback) |
Rejects an incoming call with a callback |
ringing(callback) |
Send "Ringing" to the caller. |
hangup(callback) |
Terminates a call with a hangup. This method must be called when you hangs up to release resources. Otherwise, the memory is leaked. - r = 0: Hangup call successfully. |
sendInfo(info, callback) |
Sends any data in JSON format to other clients. -info(JSON Object) : any data JSON Object- sample: {infoA: '1', infoB: 2, test: true} |
mute(muted) |
- muted = true: Mute |
enableLocalVideo(enabled) |
- enabled = true: Enabled video |