Skip to content

Latest commit

 

History

History
178 lines (130 loc) · 2.69 KB

usage.md

File metadata and controls

178 lines (130 loc) · 2.69 KB

Usage

VertoParams

const vertoParams = {
	websocket: {
		login: '<username>@<host>',
		password: '<password>',
		url: 'webSocketURL'
	},
	deviceParams: {
		useMic: 'any',
		useSpeak: 'any',
		useCamera: 'any',
	}
}

Callbacks

const callbacks = {
	onPrivateEvent: (vertoClient, dataParams, userData) => {},
	onEvent: (vertoClient, dataParams, userData) => {},
	onInfo: (params) => {},
	onClientReady: (params) => {},
	onNewCall: (call: Call) => {},
	onPlayLocalVideo: (stream: MediaStream) => {},
	onPlayRemoteVideo: (stream: MediaStream) => {},
}

VertoView

import {VertoView} from "react-native-verto";
...

const vertoParams = ...
const callbacks = ...

...
return (<VertoView vertoParams={vertoParams} callbacks={callbacks}/>);

Important info: this note needs to be highlighted

VertoClient

import {VertoClient} from 'react-native-verto';
let vertoClient = new VertoClient(vertoParams, callbacks);

{% hint style="info" %} VertoClient using vertoParams and callbacks {% endhint %}

#makeCall

let vertoClient = ...;

const callParams = { 
    to: '<string>', 
    from: '<string>', 
    callerName: '<string>'
};

const call = vertoClient.makeCall(callParams);

{% hint style="info" %} makeCall returns Call object {% endhint %}

#makeVideoCall

let vertoClient = ...;

const callParams = { 
    to: '<string>', 
    from: '<string>', 
    callerName: '<string>'
};

const call = vertoClient.makeVideoCall(callParams);

#hangup

let vertoClient = ...;
vertoClient.hangup(callId);

you can get callId when you make new call

#purge

let vertoClient = ...;
vertoClient.purge();

#destroy

let vertoClient = ...;
vertoClient.destroy();

Call

{% hint style="info" %} You must make new call or videoCall after use. {% endhint %}

const call = ...;

#answer

call.answer();

#getId

call.getId();

#hangup

call.hangup();

#transferTo

const destionation = '<username>'
call.transferTo(destionation);

#hold

call.hold();

#unhold

call.unhold();

#toogleHold

call.toogleHold();

#getDestinationNumber

call.getDestinationNumber()