@tencentcloud/tccc-sip-js 0.1.0

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 ADDED
@@ -0,0 +1,68 @@
1
+ # 腾讯云联络中心(TCCC) SIP SDK
2
+
3
+ ## 开始
4
+
5
+ * `$ npm install @tencent/tccc-sip-js --registry https://mirrors.tencent.com/npm/'`
6
+
7
+ ## 使用
8
+
9
+
10
+ ```javascript
11
+ import JsSIP from '@tencent/tccc-sip-js';
12
+ // Create our instance and run it:
13
+ const sdkAppId = '1400000000';
14
+ const user = '888888';
15
+ const to = '812921';
16
+ const socket = new JsSIP.WebSocketInterface('wss://' + sdkAppId + '.tccc.qcloud.com');
17
+ const configuration = {
18
+ sockets : [ socket ],
19
+ uri : `sip:${user}@${sdkAppId}tccc.qcloud.com.com`,
20
+ password : 'superpassword'
21
+ };
22
+
23
+ const ua = new JsSIP.UA(configuration);
24
+
25
+ ua.start();
26
+
27
+ // Register callbacks to desired call events
28
+ const eventHandlers = {
29
+ progress(e) {
30
+ console.log('call is in progress');
31
+ },
32
+ failed(e) {
33
+ console.log('call failed with cause: '+ e.data.cause);
34
+ },
35
+ ended(e) {
36
+ console.log('call ended with cause: '+ e.data.cause);
37
+ },
38
+ confirmed(e) {
39
+ console.log('call confirmed');
40
+ }
41
+ };
42
+
43
+ const options = {
44
+ eventHandlers : eventHandlers
45
+ };
46
+
47
+ const session = ua.call(`sip:${to}@${sdkAppId}tccc.qcloud.com`, options);
48
+ ```
49
+
50
+ Want to see more? Check the full documentation at https://jssip.net/documentation/.
51
+
52
+
53
+ ## Demo体验
54
+
55
+ Check our **TCCC SIP Demo** online demo:
56
+
57
+ * [TCCC SIP Demo](https://tccc.woa.com/sip)
58
+
59
+
60
+ ## Website and Documentation
61
+
62
+ * [git docs](https://git.woa.com/tccc/JsSIP)
63
+ * [api docs](https://jssip.net)
64
+
65
+
66
+ ## License
67
+
68
+ JsSIP is released under the [MIT license](https://jssip.net/license).