@voicenter-team/opensips-js 1.0.75 → 1.0.76

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -29,12 +29,13 @@ const openSIPSJS = new OpenSIPSJS({
29
29
  Then you will be able to call next methods on openSIPSJS instance:
30
30
 
31
31
  ### Methods
32
+ - `begin(): OpensipsInstance` - start opensips
32
33
  - `initCall(target: String, addToCurrentRoom: Boolean): void` - call to the target. If addToCurrentRoom is true then the call will be added to the user's current room
33
34
  - `holdCall(callId: String, automatic?: Boolean): Promise<void>` - put call on hold
34
35
  - `unholdCall(callId: String): Promise<void>` - unhold a call
35
36
  - `terminateCall(callId: String): void` - terminate call
36
- - `moveCall({callId: String, roomId: Number}): Promise<void>` - Same as callChangeRoom. Move call to the specific room
37
- - `transferCall({callId: String, target: String}): void` - transfer call to target
37
+ - `moveCall(callId: String, roomId: Number): Promise<void>` - Same as callChangeRoom. Move call to the specific room
38
+ - `transferCall(callId: String, target: String): void` - transfer call to target
38
39
  - `mergeCall(roomId: Number): void` - merge calls in specific room. Works only for rooms with 2 calls inside
39
40
  - `answerCall(callId: String): void` - answer a call
40
41
  - `mute(): void` - mute ourself
@@ -44,12 +45,34 @@ Then you will be able to call next methods on openSIPSJS instance:
44
45
  - `setMicrophone(deviceId: String): Promise<void>` - set passed device as input device for calls
45
46
  - `setSpeaker(deviceId: String): Promise<void>` - set passed device as output device for calls
46
47
  - `setActiveRoom(roomId: Number): Promise<void>` - switch to the room
47
- - `setMicrophoneSensitivity(value: Number): void` - set sensitivity of microphone
48
+ - `setMicrophoneSensitivity(value: Number): void` - set sensitivity of microphone. Value should be in range from 0 to 1
49
+ - `setSpeakerVolume(value: Number): void` - set volume of callers. Value should be in range from 0 to 1
48
50
  - `setDND(value: Boolean): void` - set the agent "Do not disturb" status
49
51
  - `subscribe({type: String, listener: function}): void` - subscribe to an event. Available events: `new_call`, `ended`, `progress`, `failed`, `confirmed`
50
52
  - `removeIListener(type: String): void` - remove event listener
53
+ - `on(event: OpensipsEvent, callback): void` - remove event listener
51
54
  - `setMetricsConfig(config: WebrtcMetricsConfigType): void` - set the metric config (used for audio quality indicator)
52
55
 
56
+ ### Opensips Events
57
+
58
+ | Event | Callback interface | Description |
59
+ |----------------|---------|---------------|
60
+ | `ready` | `() => {}` | Emitted when opensips is initialized |
61
+ | `changeActiveCalls` | `(calls: { [key: string]: ICall }) => {}` | Emitted when active calls are changed |
62
+ | `callAddingInProgressChanged` | `(callId: string / undefined) => {}` | Emitted when any call adding state is changed |
63
+ | `changeAvailableDeviceList` | `(devices: Array<MediaDeviceInfo>) => {}` | Emitted when the list of available devices is changed |
64
+ | `changeActiveInputMediaDevice` | `(deviceId: string) => {}` | Emitted when active input device is changed |
65
+ | `changeActiveOutputMediaDevice` | `(deviceId: string) => {}` | Emitted when active output device is changed |
66
+ | `changeMuteWhenJoin` | `(value: boolean) => {}` | Emitted when mute on join value is changed |
67
+ | `changeIsDND` | `(value: boolean) => {}` | Emitted when is DND value is changed |
68
+ | `changeIsMuted` | `(value: boolean) => {}` | Emitted when mute value is changed |
69
+ | `changeActiveStream` | `(stream: MediaStream) => {}` | Emitted when active stream was changed |
70
+ | `changeCallVolume` | `(callId: string, volume: number) => {}` | Emits the volume meter's value for each participant |
71
+ | `currentActiveRoomChanged` | `(number / undefined) => {}` | Emitted when active room is changed |
72
+ | `addRoom` | `({room: IRoom, roomList: {[id: number]: IRoom}}) => {}` | Emitted when new room was added |
73
+ | `updateRoom` | `({room: IRoom, roomList: {[id: number]: IRoom}}) => {}` | Emitted when room was updated |
74
+ | `removeRoom` | `({room: IRoom, roomList: {[p: number]: IRoom}}) => {}` | Emitted when room was deleted |
75
+
53
76
  WebrtcMetricsConfigType
54
77
 
55
78
  | Parameter | Type |