surflion-service 1.4.0 → 1.5.1
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 +57 -0
- package/package.json +32 -8
- package/surflion.js +14 -12
- package/surflion.min.js +2 -0
- package/shareWork.js +0 -66
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# SurfLion Service
|
|
2
|
+
|
|
3
|
+
🚀 High-performance WebRTC communication library with integrated JsSIP protocol stack, providing complete real-time communication solutions.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 🎯 **WebRTC Communication**: Support for peer-to-peer audio and video calls
|
|
8
|
+
- 📞 **SIP Protocol**: Complete SIP protocol stack support
|
|
9
|
+
- 🔊 **Audio/Video Calls**: High-quality audio and video communication
|
|
10
|
+
- 💬 **Real-time Messaging**: Support for real-time text messaging
|
|
11
|
+
- 🛡️ **Secure Connection**: Built-in security mechanisms
|
|
12
|
+
- 📱 **Cross-platform**: Support for browser and Node.js environments
|
|
13
|
+
|
|
14
|
+
## 📦 Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install surflion-service
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 🔧 Usage
|
|
21
|
+
|
|
22
|
+
### Node.js Environment (Main Entry)
|
|
23
|
+
```javascript
|
|
24
|
+
const SurfLion = require('surflion-service');
|
|
25
|
+
console.log(SurfLion);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Browser Environment (Script Tag)
|
|
29
|
+
```html
|
|
30
|
+
<script src="node_modules/surflion-service/surflion.min.js"></script>
|
|
31
|
+
<script>
|
|
32
|
+
// SurfLion is now available globally
|
|
33
|
+
console.log(SurfLion);
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### ES6 Module
|
|
38
|
+
```javascript
|
|
39
|
+
import SurfLion from 'surflion-service';
|
|
40
|
+
console.log(SurfLion);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 📚 Documentation
|
|
44
|
+
|
|
45
|
+
For detailed API documentation and usage examples, please visit our [GitHub repository](https://github.com/surflionteam/surflion-service).
|
|
46
|
+
|
|
47
|
+
## 📄 License
|
|
48
|
+
|
|
49
|
+
MIT License
|
|
50
|
+
|
|
51
|
+
## 🤝 Contributing
|
|
52
|
+
|
|
53
|
+
Issues and Pull Requests are welcome!
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
**SurfLion Team** - Making real-time communication easier 🚀
|
package/package.json
CHANGED
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "surflion-service",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "SurfLion WebRTC Service Library with integrated JsSIP for real-time communication",
|
|
5
5
|
"main": "surflion.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"files": [
|
|
7
|
+
"surflion.js",
|
|
8
|
+
"surflion.min.js"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"webrtc",
|
|
12
|
+
"sip",
|
|
13
|
+
"voip",
|
|
14
|
+
"surflion",
|
|
15
|
+
"jssip",
|
|
16
|
+
"communication",
|
|
17
|
+
"real-time",
|
|
18
|
+
"audio",
|
|
19
|
+
"video",
|
|
20
|
+
"calling"
|
|
21
|
+
],
|
|
22
|
+
"author": "SurfLion Team",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/surflionteam/surflion-service.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/surflionteam/surflion-service#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/surflionteam/surflion-service/issues"
|
|
8
31
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=12.0.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "echo \"No tests specified\" && exit 0"
|
|
13
37
|
}
|
|
14
38
|
}
|
package/surflion.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import JsSIP from 'jssip'
|
|
2
2
|
var SurfLion = {
|
|
3
|
+
version: process.env.PACKAGE_VERSION,
|
|
3
4
|
showAll: true,
|
|
4
5
|
outgoingSession: null,
|
|
5
6
|
incomingSession: null,
|
|
@@ -1226,7 +1227,7 @@ var SurfLion = {
|
|
|
1226
1227
|
});
|
|
1227
1228
|
|
|
1228
1229
|
window.addEventListener('localStorageSurflionCalling', () => {
|
|
1229
|
-
callingState = window.localStorage.getItem("localStorageSurflionCall") || '1';
|
|
1230
|
+
SurfLion.callingState = window.localStorage.getItem("localStorageSurflionCall") || '1';
|
|
1230
1231
|
setTimeout(()=>{
|
|
1231
1232
|
getLocalPhoneState(SurfLion.phoneState)
|
|
1232
1233
|
},200)
|
|
@@ -1327,6 +1328,10 @@ var SurfLion = {
|
|
|
1327
1328
|
},
|
|
1328
1329
|
'connecting': function (e) {
|
|
1329
1330
|
SurfLion.phoneToward = 'out'
|
|
1331
|
+
SurfLion.phoneEnded = false
|
|
1332
|
+
if (e.request && e.request.call_id) {
|
|
1333
|
+
SurfLion.callID = e.request.call_id
|
|
1334
|
+
}
|
|
1330
1335
|
window.localStorage.setItem("surflion_registered", '3');
|
|
1331
1336
|
const event = new Event('localStorageSurflionChange');
|
|
1332
1337
|
window.dispatchEvent(event);
|
|
@@ -1334,10 +1339,6 @@ var SurfLion = {
|
|
|
1334
1339
|
window.localStorage.setItem("localStorageSurflionCall", '2');
|
|
1335
1340
|
const events = new Event('localStorageSurflionCalling');
|
|
1336
1341
|
window.dispatchEvent(events);
|
|
1337
|
-
SurfLion.phoneEnded = false
|
|
1338
|
-
if (e.request && e.request.call_id) {
|
|
1339
|
-
SurfLion.callID = e.request.call_id
|
|
1340
|
-
}
|
|
1341
1342
|
let callInfo = {
|
|
1342
1343
|
CallID : SurfLion.callID
|
|
1343
1344
|
}
|
|
@@ -1348,13 +1349,6 @@ var SurfLion = {
|
|
|
1348
1349
|
'incoming': function(e) {
|
|
1349
1350
|
SurfLion.phoneToward = 'in'
|
|
1350
1351
|
SurfLion.phoneEnded = false
|
|
1351
|
-
window.localStorage.setItem("surflion_registered", '3');
|
|
1352
|
-
const event = new Event('localStorageSurflionChange');
|
|
1353
|
-
window.dispatchEvent(event);
|
|
1354
|
-
|
|
1355
|
-
window.localStorage.setItem("localStorageSurflionCall", '1');
|
|
1356
|
-
const events = new Event('localStorageSurflionCalling');
|
|
1357
|
-
window.dispatchEvent(events);
|
|
1358
1352
|
let callInfo = {
|
|
1359
1353
|
CallNumber : e.request.from._display_name
|
|
1360
1354
|
}
|
|
@@ -1369,6 +1363,14 @@ var SurfLion = {
|
|
|
1369
1363
|
SurfLion.createVAnswer(callInfo)
|
|
1370
1364
|
}
|
|
1371
1365
|
|
|
1366
|
+
window.localStorage.setItem("surflion_registered", '3');
|
|
1367
|
+
const event = new Event('localStorageSurflionChange');
|
|
1368
|
+
window.dispatchEvent(event);
|
|
1369
|
+
|
|
1370
|
+
window.localStorage.setItem("localStorageSurflionCall", '1');
|
|
1371
|
+
const events = new Event('localStorageSurflionCalling');
|
|
1372
|
+
window.dispatchEvent(events);
|
|
1373
|
+
|
|
1372
1374
|
},
|
|
1373
1375
|
'confirmed': function (e) {
|
|
1374
1376
|
let callInfo = {
|