@vgroup/dialbox 0.0.28 → 0.0.30
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/esm2020/lib/components/call-progress/call-progress.component.mjs +7 -7
- package/esm2020/lib/components/call-progress/incoming-call/incoming-call.component.mjs +2 -2
- package/esm2020/lib/dialbox.component.mjs +8 -8
- package/esm2020/lib/service/twilio.service.mjs +7 -23
- package/fesm2015/vgroup-dialbox.mjs +20 -36
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +20 -36
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/service/twilio.service.d.ts +0 -2
- package/package.json +1 -1
|
@@ -115,28 +115,12 @@ class TwilioService {
|
|
|
115
115
|
this.callerIdList = new BehaviorSubject([]);
|
|
116
116
|
this.triggerSMSReload = new BehaviorSubject(false);
|
|
117
117
|
}
|
|
118
|
-
onIncomingCall()
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
this.currentCallState.next('ringing');
|
|
125
|
-
// Emit a custom event with the call data
|
|
126
|
-
this.dispatchIncomingCallEvent(call);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
dispatchIncomingCallEvent(call) {
|
|
130
|
-
const event = new CustomEvent('incomingCall', {
|
|
131
|
-
detail: {
|
|
132
|
-
call,
|
|
133
|
-
isIncomingCall: true,
|
|
134
|
-
from: call.parameters['From'],
|
|
135
|
-
to: call.parameters['To']
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
window.dispatchEvent(event);
|
|
139
|
-
}
|
|
118
|
+
// onIncomingCall(){
|
|
119
|
+
// this.device.on('incoming', (call:any) => {
|
|
120
|
+
// console.log(call);
|
|
121
|
+
// //call.accept();
|
|
122
|
+
// });
|
|
123
|
+
// }
|
|
140
124
|
saveContact(payload) {
|
|
141
125
|
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
142
126
|
return this.http.post(environment.apiUrl + '/utilities/phonebook/add/contacts/manually', payload, httpOptions);
|
|
@@ -1587,7 +1571,7 @@ class IncomingCallComponent {
|
|
|
1587
1571
|
}
|
|
1588
1572
|
getUserInformation(incomingCallData) {
|
|
1589
1573
|
let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
|
|
1590
|
-
this.extensionService.getUserInformation(data
|
|
1574
|
+
this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
|
|
1591
1575
|
setTimeout(() => {
|
|
1592
1576
|
incomingCallData['userInfo'] = response;
|
|
1593
1577
|
}, 5000);
|
|
@@ -1666,16 +1650,16 @@ class CallProgressComponent {
|
|
|
1666
1650
|
this.startCall(changes['callData'].currentValue);
|
|
1667
1651
|
}
|
|
1668
1652
|
}
|
|
1669
|
-
if (changes
|
|
1653
|
+
if (changes['newIncomingCallData']) {
|
|
1670
1654
|
try {
|
|
1671
|
-
if (changes
|
|
1655
|
+
if (changes['newIncomingCallData'].currentValue) {
|
|
1672
1656
|
if (this.call && (this.call.status() == 'open')) {
|
|
1673
1657
|
this.call.disconnect();
|
|
1674
|
-
this.call = changes
|
|
1658
|
+
this.call = changes['newIncomingCallData'].currentValue;
|
|
1675
1659
|
this.call?.accept();
|
|
1676
|
-
this.callData.phone =
|
|
1677
|
-
this.callData.name =
|
|
1678
|
-
this.callData.img =
|
|
1660
|
+
this.callData.phone = this.call?.parameters['From'];
|
|
1661
|
+
this.callData.name = this.call?.customParameters.get('name');
|
|
1662
|
+
this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
|
|
1679
1663
|
this.incomingCallInitiated.emit();
|
|
1680
1664
|
this.startTimer();
|
|
1681
1665
|
}
|
|
@@ -2182,20 +2166,20 @@ class DialboxComponent {
|
|
|
2182
2166
|
else {
|
|
2183
2167
|
this.isCallInProgress = true;
|
|
2184
2168
|
this.isDialpadHidden = false;
|
|
2185
|
-
this.callData.phone = incomingCallData.parameters
|
|
2169
|
+
this.callData.phone = incomingCallData.parameters['From'];
|
|
2186
2170
|
this.getUserInformation(incomingCallData);
|
|
2187
2171
|
this.callData.name = incomingCallData.customParameters.get('name');
|
|
2188
2172
|
this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2189
2173
|
this.callData.isIncomingCall = true;
|
|
2190
2174
|
}
|
|
2191
2175
|
incomingCallData.on('cancel', () => {
|
|
2192
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters
|
|
2176
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
|
|
2193
2177
|
if (this.incomingCallsList.length == 0) {
|
|
2194
2178
|
this.isCallInProgress = false;
|
|
2195
2179
|
}
|
|
2196
2180
|
});
|
|
2197
2181
|
incomingCallData.on('disconnect', () => {
|
|
2198
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters
|
|
2182
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
|
|
2199
2183
|
if (this.incomingCallsList.length == 0) {
|
|
2200
2184
|
this.isCallInProgress = false;
|
|
2201
2185
|
}
|
|
@@ -2212,7 +2196,7 @@ class DialboxComponent {
|
|
|
2212
2196
|
getUserInformation(incomingCallData) {
|
|
2213
2197
|
console.log('getUserInformation', incomingCallData);
|
|
2214
2198
|
let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
|
|
2215
|
-
this.extensionService.getUserInformation(data
|
|
2199
|
+
this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
|
|
2216
2200
|
incomingCallData['userInfo'] = response;
|
|
2217
2201
|
this.incomingCallsList.push(incomingCallData);
|
|
2218
2202
|
}, error => {
|
|
@@ -2229,7 +2213,7 @@ class DialboxComponent {
|
|
|
2229
2213
|
this.registerDragElement();
|
|
2230
2214
|
}
|
|
2231
2215
|
ngOnChanges(changes) {
|
|
2232
|
-
if (changes
|
|
2216
|
+
if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
|
|
2233
2217
|
this.getContactList();
|
|
2234
2218
|
this.getUserCallSetting();
|
|
2235
2219
|
setTimeout(() => {
|
|
@@ -2948,8 +2932,8 @@ class DialboxComponent {
|
|
|
2948
2932
|
}
|
|
2949
2933
|
rejectNewIncomingCall(call) {
|
|
2950
2934
|
call.reject();
|
|
2951
|
-
this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters.CallSid !== call.parameters
|
|
2952
|
-
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== call.parameters
|
|
2935
|
+
this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
|
|
2936
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
|
|
2953
2937
|
}
|
|
2954
2938
|
newIncomingCallInitiated() {
|
|
2955
2939
|
this.isCallInProgress = true;
|