This component provides methods to make/receive a Stringee call. It contains all data of a call.
| clientId: String |
|---|
|
Id of StringeeClient |
| eventHandlers: Object |
|
Event handlers passed into the native StringeeCall instance. Example:
|
| onChangeSignalingState : Function(callId: string, code: int, reason: string, sipCode: int, sipReason: string) |
|---|
|
Invoked when the call's state changes between: calling, ringing, answered, busy, ended: |
| onChangeMediaState : Function(callId: string, code: int, description: string) |
|
Invoked when the call media state changes between: connected, disconnected: |
| onReceiveLocalStream : Function(callId: string) |
|
Invoked when the local stream is initialized and available to be rendered to a view: |
| onReceiveRemoteStream : Function(callId: string) |
|
Invoked when the client receives a remote stream and can render it to a view: |
| onReceiveDtmfDigit : Function(callId: string, dtmf: string) |
|
Invoked when the client receives a DTMF: |
| onReceiveCallInfo : Function(callId: string, data: string) |
|
Invoked when you receive info from another client: |
| onHandleOnAnotherDevice : Function(callId: string, code: int, description: string) |
|
Invoked when the call is implemented on another device: |
| onAudioDeviceChange : Function(selectedAudioDevice: string, availableAudioDevices: string) |
|
This event only invoked in android. |
| makeCall(parameters: string, callback: (status, code, message, customDataFromYourServer)) |
|---|
|
Make a call with parameters and then returns a callback:
+ from: The caller's phone number or id. + to: The callee's phone number or id. + isVideoCall: Whether the call is a video call, isVideoCall = YES -> a video call, isVideoCall = NO -> a voice call + videoResolution: The local video's resolution ("NORMAL" or "HD") + customData: This is a customizable text of the call. This text will be sent to Stringee server. Then Stringee server sends it to Your Server via the project's answer_url. - callback returns the result: + status = true, code = 0, message = "Make call successfully" + status = false, code = 1, message = "Make call failed. Answer url is empty" + status = false, code = 2, message = "Make call failed. Answer url scco incorrect format" + status = false, code = 3, message = "Make call failed. To type is not internal or external" + status = false, code = 4, message = "Make call failed. From number not found" + status = false, code = 5, message = "Make call failed. From number not belong your account" + status = false, code = 6, message = "Make call failed. SIP Trunk not found" + status = false, code = 7, message = "Make call failed. SIP Trunk not belong your account" + status = false, code = 8, message = "Make call failed. Not enough money" + status = false, code = -1, message = "Make call failed. The client is not connected to Stringee Server" + status = false, code = -2, message = "Make call failed. Generic error" + status = false, code = -4, message = "Make call failed. The parameters format is invalid." - customDataFromYourServer: The custom data from your server when a client makes a call or receives an incoming call. |
| initAnswer(callId: string, callback: (status, code, message)) |
|
Initializes an answer. Must be implemented before you can answer a call: |
| answer(callId: string, callback: (status, code, message)) |
|
Answer a call: |
| hangup(callId: string, callback: (status, code, message)) |
|
Hangup a call: |
| reject(callId: string, callback: (status, code, message)) |
|
Reject a call: |
| sendDTMF(callId: string, dtmf: string, callback: (status, code, message)) |
|
Sends a DTMF: |
| sendCallInfo(callId: string, callInfo: string, callback: (status, code, message)) |
|
Send info to another client: |
| getCallStats(callId: string, callback: (status, code, message, stats)) |
|
Gets the call's statistics: |
| switchCamera(callId: string, callback: (status, code, message)) |
|
Switches the device's camera: |
| enableVideo(callId: string, enabled: boolean, callback: (status, code, message)) |
|
Enables or disables local video: |
| mute(callId: string, mute: boolean, callback: (status, code, message)) |
|
Toggles audio on or off: |
| setSpeakerphoneOn(callId: string, on: boolean, callback: (status, code, message)) |
|
Set the audio output mode: |
| resumeVideo(callId: string, callback: (status, code, message)) |
|
Resume local stream: |