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 StringeeCall instance by calling the StringeeCall constructor.
StringeeCall(client, fromNumber, toNumber, isVideoCall)
Creates a new StringeeCall 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}
|
sendDtmf(digits, callback)
|
Sends number of press button to server -digits(String) : is the key that customers press.- sample: '1'
|
hold()
|
Hold call |
unhold()
|
UnHold call |
sendTransfer(userId, callback)
|
Transfer the call to another client. You only can transfer an app-to-phone or a phone-to-app call. -userId(String) : The user's id to transfer the call to.- sample: 'userid1'
|
mute(enabled)
|
Mute your call -enabled(Boolean) : true: mute, false: unmute |