const vertoParams = {
websocket: {
login: '<username>@<host>',
password: '<password>',
url: 'webSocketURL'
},
deviceParams: {
useMic: 'any',
useSpeak: 'any',
useCamera: 'any',
}
}
const callbacks = {
onPrivateEvent: (vertoClient, dataParams, userData) => {},
onEvent: (vertoClient, dataParams, userData) => {},
onInfo: (params) => {},
onClientReady: (params) => {},
onNewCall: (call: Call) => {},
onPlayLocalVideo: (stream: MediaStream) => {},
onPlayRemoteVideo: (stream: MediaStream) => {},
}
import {VertoView} from "react-native-verto";
...
const vertoParams = ...
const callbacks = ...
...
return (<VertoView vertoParams={vertoParams} callbacks={callbacks}/>);
Important info: this note needs to be highlighted
import {VertoClient} from 'react-native-verto';
let vertoClient = new VertoClient(vertoParams, callbacks);
{% hint style="info" %} VertoClient using vertoParams and callbacks {% endhint %}
let vertoClient = ...;
const callParams = {
to: '<string>',
from: '<string>',
callerName: '<string>'
};
const call = vertoClient.makeCall(callParams);
{% hint style="info" %} makeCall returns Call object {% endhint %}
let vertoClient = ...;
const callParams = {
to: '<string>',
from: '<string>',
callerName: '<string>'
};
const call = vertoClient.makeVideoCall(callParams);
let vertoClient = ...;
vertoClient.hangup(callId);
you can get callId when you make new call
let vertoClient = ...;
vertoClient.purge();
let vertoClient = ...;
vertoClient.destroy();
{% hint style="info" %} You must make new call or videoCall after use. {% endhint %}
const call = ...;
call.answer();
call.getId();
call.hangup();
const destionation = '<username>'
call.transferTo(destionation);
call.hold();
call.unhold();
call.toogleHold();
call.getDestinationNumber()