@exotel-npm-dev/webrtc-client-sdk 1.0.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/package.json +25 -0
- package/src/api/callAPI/Call.js +83 -0
- package/src/api/callAPI/CallDetails.js +74 -0
- package/src/api/omAPI/Diagnostics.js +644 -0
- package/src/api/omAPI/DiagnosticsFSM.js +142 -0
- package/src/api/omAPI/DiagnosticsFSM.ts +378 -0
- package/src/api/omAPI/DiagnosticsListener.js +95 -0
- package/src/api/omAPI/FSM.js +126 -0
- package/src/api/omAPI/WebrtcLogger.js +55 -0
- package/src/api/omAPI/js-finite-state-machine.js +126 -0
- package/src/api/omAPI/log/index.js +8 -0
- package/src/api/omAPI/log/index.ts +3 -0
- package/src/api/omAPI/log/levels.js +13 -0
- package/src/api/omAPI/log/levels.ts +10 -0
- package/src/api/omAPI/log/logger-factory.js +115 -0
- package/src/api/omAPI/log/logger-factory.ts +119 -0
- package/src/api/omAPI/log/logger.js +41 -0
- package/src/api/omAPI/log/logger.ts +42 -0
- package/src/api/registerAPI/RegisterListener.js +43 -0
- package/src/constants/ErrorConstants.js +6 -0
- package/src/constants/common.js +12 -0
- package/src/listeners/CallCtrlerDummy.js +8 -0
- package/src/listeners/CallListener.js +38 -0
- package/src/listeners/Callback.js +176 -0
- package/src/listeners/ExWebClient.js +468 -0
- package/src/listeners/ExotelVoiceClientListener.js +45 -0
- package/src/listeners/SessionListeners.js +123 -0
- package/src/phone.json +75 -0
- package/src/phoneDetailsAPI.js +43 -0
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exotel-npm-dev/webrtc-client-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "client sdk for webrtc based on webrtc core sdk",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://bitbucket.org/Exotel/webrtc-sdk.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"webrtc"
|
|
15
|
+
],
|
|
16
|
+
"author": "exotel",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://bitbucket.org/Exotel/webrtc/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://bitbucket.org/Exotel/webrtc#readme",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@exotel-npm-dev/webrtc-core-sdk": "^1.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { CallDetails } from "./CallDetails";
|
|
2
|
+
import { webrtcLogger } from "../omAPI/WebrtcLogger"
|
|
3
|
+
|
|
4
|
+
var webrtcSIPPhone = require('@exotel-npm-dev/webrtc-core-sdk/src/webrtcSIPPhone').webrtcSIPPhone;
|
|
5
|
+
var logger = webrtcLogger()
|
|
6
|
+
|
|
7
|
+
export function Call() {
|
|
8
|
+
this.Answer = function() {
|
|
9
|
+
/**
|
|
10
|
+
* When agent accepts phone, add appropriate msg to be sent to webclient
|
|
11
|
+
*/
|
|
12
|
+
logger.log('Call answered')
|
|
13
|
+
webrtcSIPPhone.pickCall();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
this.Hangup = function() {
|
|
17
|
+
/**
|
|
18
|
+
* When call is terminated
|
|
19
|
+
*/
|
|
20
|
+
logger.log('call ended')
|
|
21
|
+
webrtcSIPPhone.rejectCall();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.MuteToggle = function() {
|
|
25
|
+
/**
|
|
26
|
+
* When agent clicks on mute
|
|
27
|
+
*/
|
|
28
|
+
logger.log('mute toggle clicked')
|
|
29
|
+
let dummyFlag = null;
|
|
30
|
+
webrtcSIPPhone.webRTCMuteUnmute(null);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
this.Mute = function() {
|
|
34
|
+
/**
|
|
35
|
+
* When agent clicks on mute
|
|
36
|
+
*/
|
|
37
|
+
logger.log('mute clicked')
|
|
38
|
+
let dummyFlag = true;
|
|
39
|
+
webrtcSIPPhone.webRTCMuteUnmute(dummyFlag);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.UnMute = function() {
|
|
43
|
+
/**
|
|
44
|
+
* When agent clicks on mute
|
|
45
|
+
*/
|
|
46
|
+
logger.log('unmute clicked')
|
|
47
|
+
let dummyFlag = false;
|
|
48
|
+
webrtcSIPPhone.webRTCMuteUnmute(dummyFlag);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.HoldToggle = function() {
|
|
52
|
+
/**
|
|
53
|
+
* When user clicks on hold
|
|
54
|
+
*/
|
|
55
|
+
logger.log('Hold toggle clicked')
|
|
56
|
+
webrtcSIPPhone.holdCall();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.Hold = function() {
|
|
60
|
+
/**
|
|
61
|
+
* When user clicks on hold
|
|
62
|
+
*/
|
|
63
|
+
logger.log('hold clicked')
|
|
64
|
+
let dummyFlag = true;
|
|
65
|
+
webrtcSIPPhone.holdCall();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.UnHold = function() {
|
|
69
|
+
/**
|
|
70
|
+
* When user clicks on hold
|
|
71
|
+
*/
|
|
72
|
+
logger.log('unhold clicked')
|
|
73
|
+
let dummyFlag = true;
|
|
74
|
+
webrtcSIPPhone.holdCall();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this.callDetails = function() {
|
|
78
|
+
/**
|
|
79
|
+
* return call details object here
|
|
80
|
+
*/
|
|
81
|
+
return CallDetails.getCallDetails();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export var CallDetails = {
|
|
2
|
+
callId: '',
|
|
3
|
+
remoteId: '',
|
|
4
|
+
remoteDisplayName: '',
|
|
5
|
+
callDirection: '',
|
|
6
|
+
callState: '',
|
|
7
|
+
callDuration: '',
|
|
8
|
+
callStartedTime: '',
|
|
9
|
+
callEstablishedTime: '',
|
|
10
|
+
callEndedTime: '',
|
|
11
|
+
callAnswerTime: '',
|
|
12
|
+
callEndReason: '',
|
|
13
|
+
sessionId: '',
|
|
14
|
+
|
|
15
|
+
setCallDetails: function (callId,remoteId,remoteDisplayName,callDirection,
|
|
16
|
+
callState,callDuration, callStartedTime, callEstablishedTime, callEndedTime, callAnswerTime, callEndReason, sessionId) {
|
|
17
|
+
this.callId = callId;
|
|
18
|
+
this.remoteId = remoteId;
|
|
19
|
+
this.remoteDisplayName = remoteDisplayName;
|
|
20
|
+
this.callDirection = callDirection;
|
|
21
|
+
this.callState = callState;
|
|
22
|
+
this.callDuration = callDuration;
|
|
23
|
+
this.callStartedTime = callStartedTime;
|
|
24
|
+
this.callEstablishedTime = callEstablishedTime;
|
|
25
|
+
this.callEndedTime = callEndedTime;
|
|
26
|
+
this.callAnswerTime = callAnswerTime;
|
|
27
|
+
this.callEndReason = callEndReason;
|
|
28
|
+
this.sessionId = sessionId;
|
|
29
|
+
},
|
|
30
|
+
getCallId: function(){
|
|
31
|
+
return this.callId;
|
|
32
|
+
},
|
|
33
|
+
getRemoteId: function(){
|
|
34
|
+
return this.remoteId;
|
|
35
|
+
},
|
|
36
|
+
getRemoteDisplayName: function() {
|
|
37
|
+
return this.remoteDisplayName;
|
|
38
|
+
},
|
|
39
|
+
getCallDirection: function() {
|
|
40
|
+
return this.callDirection;
|
|
41
|
+
},
|
|
42
|
+
getCallDuration: function() {
|
|
43
|
+
return this.callDuration;
|
|
44
|
+
},
|
|
45
|
+
getCallEstablishedTime: function() {
|
|
46
|
+
return this.callEstablishedTime;
|
|
47
|
+
},
|
|
48
|
+
getCallStartedTime: function() {
|
|
49
|
+
return this.callStartedTime;
|
|
50
|
+
},
|
|
51
|
+
getCallEndedTime: function() {
|
|
52
|
+
return this.callEndedTime;
|
|
53
|
+
},
|
|
54
|
+
getSessionId: function() {
|
|
55
|
+
return this.sessionId;
|
|
56
|
+
},
|
|
57
|
+
getCallDetails: function(){
|
|
58
|
+
let callDetailsObj = {
|
|
59
|
+
callId: this.callId,
|
|
60
|
+
remoteId: this.remoteId,
|
|
61
|
+
remoteDisplayName: this.remoteDisplayName,
|
|
62
|
+
callDirection: this.callDirection,
|
|
63
|
+
callState: this.callState,
|
|
64
|
+
callDuration: this.callDuration,
|
|
65
|
+
callStartedTime: this.callStartedTime,
|
|
66
|
+
callEstablishedTime: this.callEstablishedTime,
|
|
67
|
+
callEndedTime: this.callEndedTime,
|
|
68
|
+
callAnswerTime: this.callAnswerTime,
|
|
69
|
+
callEndReason: this.callEndReason,
|
|
70
|
+
sessionId: this.sessionId,
|
|
71
|
+
}
|
|
72
|
+
return callDetailsObj;
|
|
73
|
+
}
|
|
74
|
+
}
|