@exotel-npm-dev/webrtc-client-sdk 1.0.13 → 1.0.15
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/Changelog +7 -0
- package/dist/exotelsdk.js +103 -48
- package/dist/exotelsdk.js.map +1 -1
- package/package.json +2 -2
- package/src/api/callAPI/CallDetails.js +31 -27
- package/src/listeners/ExWebClient.js +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exotel-npm-dev/webrtc-client-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "client sdk for webrtc based on webrtc core sdk",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"webpack-cli": "^4.10.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@exotel-npm-dev/webrtc-core-sdk": "^1.0.
|
|
32
|
+
"@exotel-npm-dev/webrtc-core-sdk": "^1.0.15"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -11,50 +11,52 @@ export var CallDetails = {
|
|
|
11
11
|
callAnswerTime: '',
|
|
12
12
|
callEndReason: '',
|
|
13
13
|
sessionId: '',
|
|
14
|
+
callSid: '',
|
|
15
|
+
sipHeaders: {},
|
|
14
16
|
|
|
15
|
-
setCallDetails: function (callId,remoteId,remoteDisplayName,callDirection,
|
|
16
|
-
callState,callDuration, callStartedTime, callEstablishedTime, callEndedTime, callAnswerTime, callEndReason, sessionId) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
getCallId: function(){
|
|
17
|
+
setCallDetails: function (callId, remoteId, remoteDisplayName, callDirection,
|
|
18
|
+
callState, callDuration, callStartedTime, callEstablishedTime, callEndedTime, callAnswerTime, callEndReason, sessionId) {
|
|
19
|
+
this.callId = callId;
|
|
20
|
+
this.remoteId = remoteId;
|
|
21
|
+
this.remoteDisplayName = remoteDisplayName;
|
|
22
|
+
this.callDirection = callDirection;
|
|
23
|
+
this.callState = callState;
|
|
24
|
+
this.callDuration = callDuration;
|
|
25
|
+
this.callStartedTime = callStartedTime;
|
|
26
|
+
this.callEstablishedTime = callEstablishedTime;
|
|
27
|
+
this.callEndedTime = callEndedTime;
|
|
28
|
+
this.callAnswerTime = callAnswerTime;
|
|
29
|
+
this.callEndReason = callEndReason;
|
|
30
|
+
this.sessionId = sessionId;
|
|
31
|
+
},
|
|
32
|
+
getCallId: function () {
|
|
31
33
|
return this.callId;
|
|
32
34
|
},
|
|
33
|
-
getRemoteId: function(){
|
|
34
|
-
return
|
|
35
|
+
getRemoteId: function () {
|
|
36
|
+
return this.remoteId;
|
|
35
37
|
},
|
|
36
|
-
getRemoteDisplayName: function() {
|
|
38
|
+
getRemoteDisplayName: function () {
|
|
37
39
|
return this.remoteDisplayName;
|
|
38
40
|
},
|
|
39
|
-
getCallDirection: function() {
|
|
41
|
+
getCallDirection: function () {
|
|
40
42
|
return this.callDirection;
|
|
41
43
|
},
|
|
42
|
-
getCallDuration: function() {
|
|
44
|
+
getCallDuration: function () {
|
|
43
45
|
return this.callDuration;
|
|
44
46
|
},
|
|
45
|
-
getCallEstablishedTime: function() {
|
|
47
|
+
getCallEstablishedTime: function () {
|
|
46
48
|
return this.callEstablishedTime;
|
|
47
49
|
},
|
|
48
|
-
getCallStartedTime: function() {
|
|
49
|
-
return
|
|
50
|
+
getCallStartedTime: function () {
|
|
51
|
+
return this.callStartedTime;
|
|
50
52
|
},
|
|
51
|
-
getCallEndedTime: function() {
|
|
53
|
+
getCallEndedTime: function () {
|
|
52
54
|
return this.callEndedTime;
|
|
53
55
|
},
|
|
54
|
-
getSessionId: function() {
|
|
56
|
+
getSessionId: function () {
|
|
55
57
|
return this.sessionId;
|
|
56
58
|
},
|
|
57
|
-
getCallDetails: function(){
|
|
59
|
+
getCallDetails: function () {
|
|
58
60
|
let callDetailsObj = {
|
|
59
61
|
callId: this.callId,
|
|
60
62
|
remoteId: this.remoteId,
|
|
@@ -68,6 +70,8 @@ export var CallDetails = {
|
|
|
68
70
|
callAnswerTime: this.callAnswerTime,
|
|
69
71
|
callEndReason: this.callEndReason,
|
|
70
72
|
sessionId: this.sessionId,
|
|
73
|
+
callSid: this.callSid,
|
|
74
|
+
sipHeaders: this.sipHeaders
|
|
71
75
|
}
|
|
72
76
|
return callDetailsObj;
|
|
73
77
|
}
|
|
@@ -11,6 +11,7 @@ import { callbacks, registerCallback, sessionCallback } from '../listeners/Callb
|
|
|
11
11
|
import { webrtcTroubleshooterEventBus } from "./Callback";
|
|
12
12
|
|
|
13
13
|
import { webrtcSIPPhone } from '@exotel-npm-dev/webrtc-core-sdk';
|
|
14
|
+
import { CallDetails } from "../api/callAPI/CallDetails";
|
|
14
15
|
|
|
15
16
|
var intervalId;
|
|
16
17
|
var intervalIDMap = new Map();
|
|
@@ -147,6 +148,20 @@ export function ExDelegationHandler(exClient_) {
|
|
|
147
148
|
this.onRecieveInvite = function (incomingSession) {
|
|
148
149
|
logger.log("delegationHandler: onRecieveInvite\n");
|
|
149
150
|
exClient.callFromNumber = incomingSession.incomingInviteRequest.message.from.displayName;
|
|
151
|
+
CallDetails.callSid = incomingSession.incomingInviteRequest.message.headers['X-Exotel-Callsid'][0].raw;
|
|
152
|
+
CallDetails.callId = incomingSession.incomingInviteRequest.message.headers['Call-ID'][0].raw;
|
|
153
|
+
const result = {};
|
|
154
|
+
const obj = incomingSession.incomingInviteRequest.message.headers;
|
|
155
|
+
for (let key in obj) {
|
|
156
|
+
if (obj.hasOwnProperty(key)) {
|
|
157
|
+
if (obj[key].length == 1) {
|
|
158
|
+
result[key] = obj[key][0].raw;
|
|
159
|
+
} else if (obj[key].length > 1) {
|
|
160
|
+
result[key] = obj[key].map(item => item.raw);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
CallDetails.sipHeaders = result;
|
|
150
165
|
}
|
|
151
166
|
|
|
152
167
|
this.onPickCall = function () {
|
|
@@ -190,7 +205,7 @@ export class ExotelWebClient {
|
|
|
190
205
|
|
|
191
206
|
|
|
192
207
|
ctrlr = null;
|
|
193
|
-
call
|
|
208
|
+
call;
|
|
194
209
|
eventListener = null;
|
|
195
210
|
callListener = null;
|
|
196
211
|
callFromNumber = null;
|
|
@@ -520,8 +535,8 @@ export class ExotelWebClient {
|
|
|
520
535
|
logger.registerLoggerCallback(callback);
|
|
521
536
|
}
|
|
522
537
|
|
|
523
|
-
registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback) {
|
|
524
|
-
webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback);
|
|
538
|
+
registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback) {
|
|
539
|
+
webrtcSIPPhone.registerAudioDeviceChangeCallback(audioInputDeviceChangeCallback, audioOutputDeviceChangeCallback, onDeviceChangeCallback);
|
|
525
540
|
}
|
|
526
541
|
}
|
|
527
542
|
|