@voicenter-team/opensips-js 1.0.88 → 1.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -7
- package/dist/index.d.ts +3 -0
- package/dist/opensips-js.cjs.js +77 -77
- package/dist/opensips-js.es.js +4502 -4311
- package/dist/opensips-js.iife.js +72 -72
- package/dist/opensips-js.umd.js +72 -72
- package/package.json +4 -3
- package/src/types/listeners.d.ts +2 -0
package/README.md
CHANGED
@@ -1,13 +1,21 @@
|
|
1
|
+
---
|
2
|
+
title: Getting started
|
3
|
+
description: The Opensips JS library and its expansive ecosystem offer developers a powerful and flexible solution for integrating Opensips protocol functionalities into a multitude of applications.
|
4
|
+
navigation:
|
5
|
+
title: Getting Started
|
6
|
+
---
|
7
|
+
|
1
8
|
# Getting started
|
9
|
+
|
2
10
|
## Installation
|
3
11
|
Using npm:
|
4
|
-
```shell
|
12
|
+
```shell[Terminal]
|
5
13
|
$ npm i @voicenter-team/opensips-js
|
6
14
|
```
|
7
15
|
|
8
16
|
## Usage
|
9
17
|
Firstly lets import the library and create the OpenSIPS instance:
|
10
|
-
```javascript
|
18
|
+
```javascript [file.js]
|
11
19
|
import OpenSIPSJS from '@voicenter-team/opensips-js'
|
12
20
|
|
13
21
|
const openSIPSJS = new OpenSIPSJS({
|
@@ -36,13 +44,13 @@ const openSIPSJS = new OpenSIPSJS({
|
|
36
44
|
```
|
37
45
|
|
38
46
|
Then you can work with appropriate modules:
|
39
|
-
```javascript
|
47
|
+
```javascript [file.js]
|
40
48
|
openSIPSJS.audio
|
41
49
|
openSIPSJS.video
|
42
50
|
openSIPSJS.msrp
|
43
51
|
```
|
44
52
|
|
45
|
-
|
53
|
+
## OpensipsJS
|
46
54
|
### OpensipsJS instance methods
|
47
55
|
- `begin(): OpensipsInstance` - start opensips
|
48
56
|
- `on(event: OpensipsEvent, callback): void` - remove event listener
|
@@ -87,7 +95,7 @@ Also, there are next public fields on OpensipsJS instance:
|
|
87
95
|
### OpensipsJS instance fields
|
88
96
|
- `sipDomain: String` - returns sip domain
|
89
97
|
|
90
|
-
|
98
|
+
## Audio
|
91
99
|
|
92
100
|
### Audio methods
|
93
101
|
- `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
|
@@ -124,7 +132,7 @@ Also, there are next public fields on OpensipsJS instance:
|
|
124
132
|
- `isDND: Boolean` - returns if the agent is in "Do not disturb" status
|
125
133
|
- `isMuted: Boolean` - returns if the agent is muted
|
126
134
|
|
127
|
-
|
135
|
+
## MSRP
|
128
136
|
|
129
137
|
### MSRP methods
|
130
138
|
- `initMSRP(target: String, body: String): void` - initialize connection with target contact. Body is the initial message to this target.
|
@@ -136,7 +144,7 @@ Also, there are next public fields on OpensipsJS instance:
|
|
136
144
|
- `getActiveMessages: { [key: string]: IMessage }` - returns an object of active message sessions where key is session id and value is message session data.
|
137
145
|
|
138
146
|
|
139
|
-
|
147
|
+
## Video
|
140
148
|
|
141
149
|
### Video methods
|
142
150
|
- `joinRoom(roomId: String, displayName: String, mediaConstraints: Object): void` - join conference room
|
package/dist/index.d.ts
CHANGED
@@ -376,6 +376,8 @@ declare type ListenerEventType = EndEvent | IncomingEvent | OutgoingEvent | Inco
|
|
376
376
|
|
377
377
|
declare type ListenersKeyType = keyof OpenSIPSEventMap
|
378
378
|
|
379
|
+
declare type memberHangupListener = (event: object) => void
|
380
|
+
|
379
381
|
declare type memberJoinListener = (event: object) => void
|
380
382
|
|
381
383
|
declare const MODULES: {
|
@@ -648,6 +650,7 @@ declare interface OpenSIPSEventMap extends UAEventMap {
|
|
648
650
|
newMSRPSession: MSRPSessionListener
|
649
651
|
changeMainVideoStream: changeMainVideoStreamListener
|
650
652
|
memberJoin: memberJoinListener
|
653
|
+
memberHangup: memberHangupListener
|
651
654
|
}
|
652
655
|
|
653
656
|
declare class OpenSIPSJS extends UAExtended {
|