UNPKG

vertojs

Version:
50 lines (49 loc) 1.64 kB
import { JsonRpcClient, JsonRpcClientParams } from './json-rpc'; import { CallDirection } from './rtc'; import { VertoBase } from './base'; interface VertoOptions { transportConfig: JsonRpcClientParams; rtcConfig?: RTCConfiguration; debug?: boolean; ice_timeout?: number; } interface VertoCallOptions { caller_id_number?: string; caller_id_name?: string; callee_id_number?: string; callee_id_name?: string; } declare class VertoCall extends VertoBase { private rtc; private rpc; id: string; options: VertoCallOptions; direction: CallDirection; holdStatus: boolean; constructor(conf: RTCConfiguration, rpc: JsonRpcClient, dest?: string, id?: string, options?: VertoCallOptions, ice_timeout?: number, debug?: boolean); getStats(): Promise<RTCStatsReport>; onAnswer(sdp: string): void; onMedia(sdp: string): void; addTrack(track: MediaStreamTrack): void; preSdp(sdp: string): void; answer(tracks: Array<MediaStreamTrack>): void; hangup(params?: {}): void; clear(): void; dtmf(input: string): void; hold(params?: object): void; unhold(params?: object): void; toggleHold(params?: object): void; } declare class Verto extends VertoBase { private calls; private rpc; private options; private sessid; private logged_in; constructor(options: VertoOptions); login(): Promise<any>; call(tracks: Array<MediaStreamTrack>, destination: string, options?: VertoCallOptions): VertoCall; isLogged(): boolean; logout(): void; } export { Verto, CallDirection };