@vgroup/dialbox 0.1.60 → 0.1.62
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 +6 -6
- package/esm2020/keypad.mjs +45 -0
- package/esm2020/lib/components/call-progress/call-progress.component.mjs +37 -5
- package/esm2020/lib/components/call-progress/incoming-call/incoming-call.component.mjs +14 -6
- package/esm2020/lib/components/caller-id-dialog/caller-id-dialog.component.mjs +20 -13
- package/esm2020/lib/dialbox.component.mjs +1202 -31
- package/esm2020/lib/dialbox.module.mjs +16 -6
- package/esm2020/lib/environments/environments.mjs +1 -1
- package/esm2020/lib/service/{notification.service.mjs → Notification.service.mjs} +1 -1
- package/esm2020/lib/service/extension.service.mjs +1039 -37
- package/esm2020/lib/service/ip-address.service.mjs +1 -1
- package/esm2020/lib/service/twilio.service.mjs +2 -2
- package/esm2020/lib/shared/global-constant.mjs +1 -1
- package/esm2020/public-api.mjs +3 -9
- package/fesm2015/vgroup-dialbox.mjs +2622 -405
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +2408 -200
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/lib/components/call-progress/call-progress.component.d.ts +3 -3
- package/lib/components/call-progress/incoming-call/incoming-call.component.d.ts +8 -8
- package/lib/components/caller-id-dialog/caller-id-dialog.component.d.ts +4 -1
- package/lib/dialbox.component.d.ts +114 -6
- package/lib/dialbox.module.d.ts +3 -1
- package/lib/service/extension.service.d.ts +136 -15
- package/lib/service/twilio.service.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -8
- package/esm2020/lib/dialbox.service.mjs +0 -14
- package/esm2020/lib/keypad.mjs +0 -45
- package/lib/dialbox.service.d.ts +0 -6
- /package/{lib/keypad.d.ts → keypad.d.ts} +0 -0
- /package/lib/service/{notification.service.d.ts → Notification.service.d.ts} +0 -0
|
@@ -1,60 +1,22 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, Input, Output, NgModule } from '@angular/core';
|
|
3
|
-
import * as i4 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
1
|
import { __awaiter } from 'tslib';
|
|
6
|
-
import
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
|
|
7
4
|
import swal from 'sweetalert2';
|
|
8
|
-
import {
|
|
5
|
+
import { AsYouType } from 'libphonenumber-js';
|
|
6
|
+
import { throwError, BehaviorSubject, of, interval, Subscription } from 'rxjs';
|
|
9
7
|
import * as i1 from '@angular/common/http';
|
|
10
8
|
import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
|
|
11
9
|
import { catchError, switchMap, map, tap, shareReplay } from 'rxjs/operators';
|
|
10
|
+
import { Device } from '@twilio/voice-sdk';
|
|
11
|
+
import * as i3$1 from '@angular/material/dialog';
|
|
12
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
13
|
+
import * as i5 from '@angular/router';
|
|
14
|
+
import { RouterLink, RouterModule } from '@angular/router';
|
|
15
|
+
import * as i4 from '@angular/common';
|
|
16
|
+
import { CommonModule } from '@angular/common';
|
|
12
17
|
import * as i3 from '@angular/forms';
|
|
13
18
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
class DialboxService {
|
|
17
|
-
constructor() { }
|
|
18
|
-
}
|
|
19
|
-
DialboxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20
|
-
DialboxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxService, providedIn: 'root' });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxService, decorators: [{
|
|
22
|
-
type: Injectable,
|
|
23
|
-
args: [{
|
|
24
|
-
providedIn: 'root'
|
|
25
|
-
}]
|
|
26
|
-
}], ctorParameters: function () { return []; } });
|
|
27
|
-
|
|
28
|
-
const environment = {
|
|
29
|
-
abb: "d",
|
|
30
|
-
production: false,
|
|
31
|
-
secureCookies: true,
|
|
32
|
-
feUrl: 'https://dev.vgroupinc.com:91/',
|
|
33
|
-
apiUrl: 'https://apis.vgroupinc.com/test_softphone',
|
|
34
|
-
captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
|
|
35
|
-
stripePublishableKey: "pk_test_51K6aTuBiNVV2TMlQfmBWY8jziwiDo0IZ3TrqWPqth1m32cpMAAg5Qpi2AlSMDEAX6hCZRBXoTzBB1uQQLc8B4tco00q2SgG6zO",
|
|
36
|
-
sessionTimeout: 15,
|
|
37
|
-
deviceType: "web",
|
|
38
|
-
appVersion: "2.3",
|
|
39
|
-
channelId: '61481b12e138eb7dc3007579',
|
|
40
|
-
c2c_support_point_id: '60424735f74ac306c1bfa900',
|
|
41
|
-
c2c_support_channel_id: '677f67f3be93ab507fbbfdfc',
|
|
42
|
-
c2c_point_url: 'https://bit.ly/3blWnPv',
|
|
43
|
-
c2c_call_label_id: 'ye2XFLfOHCr12GFVRzPh',
|
|
44
|
-
c2c_email_label_id: 'mvjVgOP2VCiYsVovQqdq',
|
|
45
|
-
radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
|
|
46
|
-
firebase: {
|
|
47
|
-
apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
|
|
48
|
-
authDomain: "softphone-d5777.firebaseapp.com",
|
|
49
|
-
projectId: "softphone-d5777",
|
|
50
|
-
storageBucket: "softphone-d5777.appspot.com",
|
|
51
|
-
messagingSenderId: "850812494538",
|
|
52
|
-
appId: "1:850812494538:web:74f8a30fc18e28ded78a33",
|
|
53
|
-
measurementId: "G-NGXTSV9SH3",
|
|
54
|
-
vapidKey: "BD6EgcQgbZTjOQfleG3YlEc0_SajB03prqTdDy-qGJkxTxezbq-A_qtuXE1l3yT47o8hnTAbTKBcH15D2AJB2To"
|
|
55
|
-
},
|
|
56
|
-
perspectiveApiKey: 'AIzaSyClf32lvLH4QOy-vOnzLzwSNntKIgapH8s'
|
|
57
|
-
};
|
|
19
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
58
20
|
|
|
59
21
|
const keypad = [
|
|
60
22
|
{
|
|
@@ -101,6 +63,37 @@ const keypad = [
|
|
|
101
63
|
}
|
|
102
64
|
];
|
|
103
65
|
|
|
66
|
+
const environment = {
|
|
67
|
+
abb: "d",
|
|
68
|
+
production: false,
|
|
69
|
+
secureCookies: true,
|
|
70
|
+
feUrl: 'https://dev.vgroupinc.com:91/',
|
|
71
|
+
apiUrl: 'https://apis.vgroupinc.com/test_softphone',
|
|
72
|
+
captchaKey: "6LfpOmEaAAAAAGsI6JXlMzOl3b7rW4YmYXFDjldD",
|
|
73
|
+
stripePublishableKey: "pk_test_51K6aTuBiNVV2TMlQfmBWY8jziwiDo0IZ3TrqWPqth1m32cpMAAg5Qpi2AlSMDEAX6hCZRBXoTzBB1uQQLc8B4tco00q2SgG6zO",
|
|
74
|
+
sessionTimeout: 15,
|
|
75
|
+
deviceType: "web",
|
|
76
|
+
appVersion: "2.3",
|
|
77
|
+
channelId: '61481b12e138eb7dc3007579',
|
|
78
|
+
c2c_support_point_id: '60424735f74ac306c1bfa900',
|
|
79
|
+
c2c_support_channel_id: '677f67f3be93ab507fbbfdfc',
|
|
80
|
+
c2c_point_url: 'https://bit.ly/3blWnPv',
|
|
81
|
+
c2c_call_label_id: 'ye2XFLfOHCr12GFVRzPh',
|
|
82
|
+
c2c_email_label_id: 'mvjVgOP2VCiYsVovQqdq',
|
|
83
|
+
radarAPIKey: 'prj_live_sk_569b6f639edde6120a26f703511c61aaecd3f7ef',
|
|
84
|
+
firebase: {
|
|
85
|
+
apiKey: "AIzaSyCA8LSPrqlDq_thk26LhBQexAQeY6pkU5Y",
|
|
86
|
+
authDomain: "softphone-d5777.firebaseapp.com",
|
|
87
|
+
projectId: "softphone-d5777",
|
|
88
|
+
storageBucket: "softphone-d5777.appspot.com",
|
|
89
|
+
messagingSenderId: "850812494538",
|
|
90
|
+
appId: "1:850812494538:web:74f8a30fc18e28ded78a33",
|
|
91
|
+
measurementId: "G-NGXTSV9SH3",
|
|
92
|
+
vapidKey: "BD6EgcQgbZTjOQfleG3YlEc0_SajB03prqTdDy-qGJkxTxezbq-A_qtuXE1l3yT47o8hnTAbTKBcH15D2AJB2To"
|
|
93
|
+
},
|
|
94
|
+
perspectiveApiKey: 'AIzaSyClf32lvLH4QOy-vOnzLzwSNntKIgapH8s'
|
|
95
|
+
};
|
|
96
|
+
|
|
104
97
|
class IpAddressService {
|
|
105
98
|
constructor(http) {
|
|
106
99
|
this.http = http;
|
|
@@ -127,6 +120,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
127
120
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
128
121
|
|
|
129
122
|
class ExtensionService {
|
|
123
|
+
setCallSid(callSid, recordCall) {
|
|
124
|
+
this.callSid = callSid;
|
|
125
|
+
this.recordCall = recordCall;
|
|
126
|
+
}
|
|
127
|
+
getCallSid() {
|
|
128
|
+
return {
|
|
129
|
+
callSid: this.callSid,
|
|
130
|
+
recordCall: this.recordCall
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
setCallerId(callerId) {
|
|
134
|
+
this.callerIdSubject.next(callerId);
|
|
135
|
+
}
|
|
130
136
|
constructor(http, ipAddressService) {
|
|
131
137
|
this.http = http;
|
|
132
138
|
this.ipAddressService = ipAddressService;
|
|
@@ -150,140 +156,1020 @@ class ExtensionService {
|
|
|
150
156
|
this.callerIdSubject = new BehaviorSubject(null);
|
|
151
157
|
this.callerId$ = this.callerIdSubject.asObservable();
|
|
152
158
|
}
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
this.recordCall = recordCall;
|
|
159
|
+
changeMessage(message) {
|
|
160
|
+
this.messageSource.next(message);
|
|
156
161
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
GetUserUsage(token) {
|
|
163
|
+
const params = {
|
|
164
|
+
'Content-Type': 'application/json',
|
|
165
|
+
'Auth-Key': "Bearer " + token
|
|
161
166
|
};
|
|
167
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
168
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/usage', httpOptions);
|
|
162
169
|
}
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
GetUserProfile(token, data) {
|
|
171
|
+
const params = {
|
|
172
|
+
'Content-Type': 'application/json',
|
|
173
|
+
'Auth-Key': "Bearer " + token
|
|
174
|
+
};
|
|
175
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
176
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/user', data, httpOptions);
|
|
177
|
+
}
|
|
178
|
+
UpdateProfile(userProfile, token) {
|
|
179
|
+
const userProfileObj = {
|
|
180
|
+
"billingAddress1": userProfile.billingAddress1,
|
|
181
|
+
"billingAddress2": userProfile.billingAddress2,
|
|
182
|
+
"billingCityid": userProfile.billingCity,
|
|
183
|
+
"billingCountryid": userProfile.billingCountry,
|
|
184
|
+
"billingStateid": userProfile.billingState,
|
|
185
|
+
"billingZipid": userProfile.billingZip,
|
|
186
|
+
"email": userProfile.email,
|
|
187
|
+
"mobile": userProfile.mobile,
|
|
188
|
+
"countrycode": userProfile.countrycode,
|
|
189
|
+
"timezone": userProfile.timezone,
|
|
190
|
+
"firstname": userProfile.firstname,
|
|
191
|
+
"lastname": userProfile.lastname,
|
|
192
|
+
"shippingAddress1": (userProfile.shippingAddress1 !== null && userProfile.shippingAddress1 !== undefined && userProfile.shippingAddress1 !== "") ? userProfile.shippingAddress1 : userProfile.billingAddress1,
|
|
193
|
+
"shippingAddress2": (userProfile.shippingAddress2 !== null && userProfile.shippingAddress2 !== undefined && userProfile.shippingAddress2 !== "") ? userProfile.shippingAddress2 : userProfile.billingAddress2,
|
|
194
|
+
"shippingCityid": (userProfile.shippingCity !== null && userProfile.shippingCity !== undefined && userProfile.shippingCity !== "") ? userProfile.shippingCity : userProfile.billingCity,
|
|
195
|
+
"shippingCountryid": (userProfile.shippingCountry !== null && userProfile.shippingCountry !== undefined && userProfile.shippingCountry !== "") ? userProfile.shippingCountry : userProfile.billingCountry,
|
|
196
|
+
"shippingStateid": (userProfile.shippingState !== null && userProfile.shippingState !== undefined && userProfile.shippingState !== "") ? userProfile.shippingState : userProfile.billingState,
|
|
197
|
+
"shippingZipid": (userProfile.shippingZip !== null && userProfile.shippingZip !== undefined && userProfile.shippingZip !== "") ? userProfile.shippingZip : userProfile.billingZip,
|
|
198
|
+
"imageId": (userProfile.imageId),
|
|
199
|
+
"imageName": (userProfile.imageName),
|
|
200
|
+
"companyName": userProfile.companyName,
|
|
201
|
+
"companySize": userProfile.companySize,
|
|
202
|
+
"companyFirstName": userProfile.companyFirstName,
|
|
203
|
+
"companyLastName": userProfile.companyLastName,
|
|
204
|
+
"companyContactNumber": userProfile.companyContactNumber
|
|
205
|
+
};
|
|
206
|
+
const params = {
|
|
207
|
+
'Content-Type': 'application/json',
|
|
208
|
+
'Auth-Key': "Bearer " + token
|
|
209
|
+
};
|
|
210
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
211
|
+
return this.http.put(environment.apiUrl + '/utilities/ext/update', userProfileObj, httpOptions);
|
|
165
212
|
}
|
|
166
|
-
|
|
167
|
-
|
|
213
|
+
deleteProfilePhoto(token) {
|
|
214
|
+
const params = {
|
|
215
|
+
'Auth-Key': "Bearer " + token
|
|
216
|
+
};
|
|
217
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + token }) };
|
|
218
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/delete/profile/photo', params, httpOptions);
|
|
168
219
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return throwError(error);
|
|
182
|
-
}));
|
|
183
|
-
}), catchError(error => {
|
|
184
|
-
return throwError(error);
|
|
185
|
-
}));
|
|
186
|
-
}));
|
|
220
|
+
getOtpCode(countryCode, number, mode, token) {
|
|
221
|
+
const params = {
|
|
222
|
+
'Content-Type': 'application/json',
|
|
223
|
+
'Auth-Key': "Bearer " + token
|
|
224
|
+
};
|
|
225
|
+
const numberObj = {
|
|
226
|
+
"countrycode": countryCode,
|
|
227
|
+
"number": number,
|
|
228
|
+
"mode": mode
|
|
229
|
+
};
|
|
230
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
231
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/sms/otp', numberObj, httpOptions);
|
|
187
232
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
233
|
+
getVerifyMobile(countryName, countrycode, number, otp, token) {
|
|
234
|
+
const params = {
|
|
235
|
+
'Content-Type': 'application/json',
|
|
236
|
+
'Auth-Key': "Bearer " + token
|
|
237
|
+
};
|
|
238
|
+
const verifyObj = {
|
|
239
|
+
"countryName": countryName,
|
|
240
|
+
"countrycode": countrycode,
|
|
241
|
+
"number": number,
|
|
242
|
+
"otp": otp
|
|
243
|
+
};
|
|
244
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
245
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/sms/verify/otp', verifyObj, httpOptions);
|
|
197
246
|
}
|
|
198
|
-
|
|
199
|
-
const
|
|
247
|
+
connectWithStripe(token) {
|
|
248
|
+
const params = {
|
|
249
|
+
'Auth-Key': "Bearer " + token
|
|
250
|
+
};
|
|
251
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + token }) };
|
|
252
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/stripe/connect', params, httpOptions);
|
|
253
|
+
}
|
|
254
|
+
connectWithStripeRedirection(redirection, token) {
|
|
255
|
+
const params = {
|
|
256
|
+
'Auth-Key': "Bearer " + token,
|
|
257
|
+
"redirection": redirection
|
|
258
|
+
};
|
|
259
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + token }) };
|
|
260
|
+
return this.http.post(environment.apiUrl + `/utilities/ext/stripe/connect/${redirection}`, params, httpOptions);
|
|
261
|
+
}
|
|
262
|
+
validateStripeSession(sessionId, token) {
|
|
263
|
+
const params = {
|
|
200
264
|
'Content-Type': 'application/json',
|
|
201
|
-
'Auth-Key': "Bearer " +
|
|
265
|
+
'Auth-Key': "Bearer " + token
|
|
202
266
|
};
|
|
203
|
-
const
|
|
204
|
-
|
|
267
|
+
const data = {
|
|
268
|
+
"sessionid": sessionId,
|
|
269
|
+
};
|
|
270
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
271
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/validate/session', data, httpOptions);
|
|
205
272
|
}
|
|
206
|
-
|
|
273
|
+
loadPaymentMethods(token) {
|
|
207
274
|
const params = {
|
|
208
275
|
'Content-Type': 'application/json',
|
|
209
|
-
'Auth-Key': "Bearer " +
|
|
210
|
-
'c2c-request': window.location.hostname
|
|
276
|
+
'Auth-Key': "Bearer " + token
|
|
211
277
|
};
|
|
212
278
|
const httpOptions = { headers: new HttpHeaders(params) };
|
|
213
|
-
return this.http.
|
|
279
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/payment/methods', httpOptions);
|
|
214
280
|
}
|
|
215
|
-
|
|
216
|
-
const
|
|
281
|
+
setPaymentDefaultMethod(paymentMethodId, token) {
|
|
282
|
+
const params = {
|
|
217
283
|
'Content-Type': 'application/json',
|
|
218
|
-
'Auth-Key':
|
|
219
|
-
}
|
|
220
|
-
const
|
|
221
|
-
|
|
284
|
+
'Auth-Key': "Bearer " + token
|
|
285
|
+
};
|
|
286
|
+
const data = {
|
|
287
|
+
"methodid": paymentMethodId,
|
|
288
|
+
};
|
|
289
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
290
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/update/default', data, httpOptions);
|
|
222
291
|
}
|
|
223
|
-
|
|
224
|
-
const
|
|
292
|
+
sendEmailVerifyLink(emailval, token) {
|
|
293
|
+
const params = {
|
|
294
|
+
'Auth-Key': "Bearer " + token,
|
|
295
|
+
"email": emailval
|
|
296
|
+
};
|
|
297
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + token }) };
|
|
298
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/verify/email', params, httpOptions);
|
|
299
|
+
}
|
|
300
|
+
VerifyEmailLink(key) {
|
|
301
|
+
const keyobj = { "key": key };
|
|
302
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
303
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/verify/request', keyobj, httpOptions);
|
|
304
|
+
}
|
|
305
|
+
DeleteMethod(paymentMethodId, token) {
|
|
306
|
+
const params = {
|
|
225
307
|
'Content-Type': 'application/json',
|
|
226
|
-
'Auth-Key':
|
|
227
|
-
}
|
|
228
|
-
const
|
|
229
|
-
|
|
308
|
+
'Auth-Key': "Bearer " + token
|
|
309
|
+
};
|
|
310
|
+
const data = {
|
|
311
|
+
"methodid": paymentMethodId,
|
|
312
|
+
};
|
|
313
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
314
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/detach/method', data, httpOptions);
|
|
230
315
|
}
|
|
231
|
-
|
|
232
|
-
const
|
|
316
|
+
VerifySession(token) {
|
|
317
|
+
const params = {
|
|
233
318
|
'Content-Type': 'application/json',
|
|
234
|
-
'Auth-Key':
|
|
235
|
-
}
|
|
236
|
-
const httpOptions = { headers:
|
|
237
|
-
return this.http.get(environment.apiUrl +
|
|
319
|
+
'Auth-Key': "Bearer " + token
|
|
320
|
+
};
|
|
321
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
322
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/verify/session', httpOptions);
|
|
238
323
|
}
|
|
239
|
-
|
|
240
|
-
|
|
324
|
+
GetAllCountryList() {
|
|
325
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
326
|
+
return this.http.get(environment.apiUrl + '/global/master/ur/countrylist', httpOptions);
|
|
327
|
+
}
|
|
328
|
+
GetAllStateList(_countryId) {
|
|
329
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
330
|
+
return this.http.get(environment.apiUrl + '/global/master/ur/statelist/' + _countryId, httpOptions);
|
|
331
|
+
}
|
|
332
|
+
LogoutUser(authKey) {
|
|
333
|
+
const auth = { "Auth-Key": authKey };
|
|
334
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': authKey }) };
|
|
335
|
+
return this.http.post(environment.apiUrl + '/client/user/logout', auth, httpOptions);
|
|
336
|
+
}
|
|
337
|
+
purchasedNumber(token) {
|
|
241
338
|
const params = {
|
|
242
339
|
'Content-Type': 'application/json',
|
|
243
340
|
'Auth-Key': "Bearer " + token
|
|
244
341
|
};
|
|
245
342
|
const httpOptions = { headers: new HttpHeaders(params) };
|
|
246
|
-
return this.http.get(environment.apiUrl + '/utilities/
|
|
343
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/view/purchased/number', httpOptions);
|
|
247
344
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const params = {
|
|
256
|
-
'Content-Type': 'application/json',
|
|
257
|
-
'c2c-latlong': c2c_latlong,
|
|
258
|
-
'c2c-request': c2c_request,
|
|
259
|
-
'ip-address': ipAddressInfo.ip,
|
|
260
|
-
'ip-country': ipAddressInfo.address.country,
|
|
261
|
-
};
|
|
262
|
-
dtModel = Object.assign(Object.assign({}, dtModel), { proxy: ipAddressInfo.proxy.toString() });
|
|
263
|
-
const httpOptions = { headers: new HttpHeaders(params) };
|
|
264
|
-
return this.http.post(environment.apiUrl + '/utilities/ext/ur/send/sms', dtModel, httpOptions).pipe(catchError(error => throwError(error)));
|
|
265
|
-
}
|
|
266
|
-
}), catchError(error => throwError(error)));
|
|
267
|
-
}), catchError(error => throwError(error)));
|
|
345
|
+
availableNumber(token, dtModel) {
|
|
346
|
+
const params = {
|
|
347
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
348
|
+
'Auth-Key': "Bearer " + token
|
|
349
|
+
};
|
|
350
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
351
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/available/number', dtModel, httpOptions);
|
|
268
352
|
}
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
'Content-Type': 'application/json',
|
|
273
|
-
'Auth-Key': 'Bearer ' + this.token
|
|
274
|
-
})
|
|
353
|
+
urAvailableNumber(token, dtModel) {
|
|
354
|
+
const params = {
|
|
355
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
275
356
|
};
|
|
276
|
-
|
|
357
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
358
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/ur/available/number', dtModel, httpOptions);
|
|
277
359
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
360
|
+
stagingNumber(token, dtModel) {
|
|
361
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
362
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/save/staging/number', dtModel, httpOptions);
|
|
363
|
+
}
|
|
364
|
+
saveCompanyDetail(dtModel) {
|
|
365
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
366
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/signup/company/details', dtModel, httpOptions);
|
|
367
|
+
}
|
|
368
|
+
saveAddressInfo(dtModel) {
|
|
369
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
370
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/signup/address', dtModel, httpOptions);
|
|
371
|
+
}
|
|
372
|
+
saveStripeInfo(userId) {
|
|
373
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
374
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/stripe/connect/' + userId, httpOptions);
|
|
375
|
+
}
|
|
376
|
+
saveCardInfo(dtModel) {
|
|
377
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
378
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/save/card/info', dtModel, httpOptions);
|
|
379
|
+
}
|
|
380
|
+
deleteCard(dtModel) {
|
|
381
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
382
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/delete/saved/card', dtModel, httpOptions);
|
|
383
|
+
}
|
|
384
|
+
purchasePlan(dtModel) {
|
|
385
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
386
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/ur/purchase/signup/number', dtModel, httpOptions);
|
|
387
|
+
}
|
|
388
|
+
getUserStagingInfo(data) {
|
|
389
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
390
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/signup/staging', data, httpOptions);
|
|
391
|
+
}
|
|
392
|
+
costCheckOut(token, cost) {
|
|
393
|
+
const params = {
|
|
394
|
+
'Content-Type': 'application/json',
|
|
395
|
+
'Auth-Key': "Bearer " + token
|
|
396
|
+
};
|
|
397
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
398
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/number/checkout/' + cost, httpOptions);
|
|
399
|
+
}
|
|
400
|
+
buyNumber(token, dtModel) {
|
|
401
|
+
const params = {
|
|
402
|
+
'Content-Type': 'application/json',
|
|
403
|
+
'Auth-Key': "Bearer " + token
|
|
404
|
+
};
|
|
405
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
406
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/purchase/number', dtModel, httpOptions);
|
|
407
|
+
}
|
|
408
|
+
fetchCallerId(token) {
|
|
409
|
+
const params = {
|
|
410
|
+
'Content-Type': 'application/json',
|
|
411
|
+
'Auth-Key': "Bearer " + token
|
|
412
|
+
};
|
|
413
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
414
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/fetch/callerid', httpOptions);
|
|
415
|
+
}
|
|
416
|
+
updateNumberLabel(token, dtModel) {
|
|
417
|
+
const params = {
|
|
418
|
+
'Content-Type': 'application/json',
|
|
419
|
+
'Auth-Key': "Bearer " + token
|
|
420
|
+
};
|
|
421
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
422
|
+
return this.http.put(environment.apiUrl + '/utilities/softphone/update/number/label', dtModel, httpOptions);
|
|
423
|
+
}
|
|
424
|
+
releaseNumber(token, twilioNum) {
|
|
425
|
+
const params = {
|
|
426
|
+
'Content-Type': 'application/json',
|
|
427
|
+
'Auth-Key': "Bearer " + token
|
|
428
|
+
};
|
|
429
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
430
|
+
// return this.http.post<[]>(environment.apiUrl + '/utilities/softphone/delete/twilio/number', httpOptions);
|
|
431
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/delete/twilio/number/' + twilioNum, httpOptions);
|
|
432
|
+
}
|
|
433
|
+
// Call forwarding api's
|
|
434
|
+
sendOTP(token, dtModel) {
|
|
435
|
+
const params = {
|
|
436
|
+
'Content-Type': 'application/json',
|
|
437
|
+
'Auth-Key': "Bearer " + token
|
|
438
|
+
};
|
|
439
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
440
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/send/otp', dtModel, httpOptions);
|
|
441
|
+
}
|
|
442
|
+
verifyOTP(token, dtModel) {
|
|
443
|
+
const params = {
|
|
444
|
+
'Content-Type': 'application/json',
|
|
445
|
+
'Auth-Key': "Bearer " + token
|
|
446
|
+
};
|
|
447
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
448
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/verify/otp', dtModel, httpOptions);
|
|
449
|
+
}
|
|
450
|
+
updateCallForwarding(token, dtModel) {
|
|
451
|
+
const params = {
|
|
452
|
+
'Content-Type': 'application/json',
|
|
453
|
+
'Auth-Key': "Bearer " + token
|
|
454
|
+
};
|
|
455
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
456
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/configure/call/forwarding', dtModel, httpOptions);
|
|
457
|
+
}
|
|
458
|
+
getSingleNumForwardingSetting(token, number) {
|
|
459
|
+
const params = {
|
|
460
|
+
'Content-Type': 'application/json',
|
|
461
|
+
'Auth-Key': "Bearer " + token
|
|
462
|
+
};
|
|
463
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
464
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/view/call/forwarding/' + number, httpOptions);
|
|
465
|
+
}
|
|
466
|
+
deleteCallForwarding(token, dtModel) {
|
|
467
|
+
const params = {
|
|
468
|
+
'Content-Type': 'application/json',
|
|
469
|
+
'Auth-Key': "Bearer " + token
|
|
470
|
+
};
|
|
471
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
472
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/call/forwarding/action', dtModel, httpOptions);
|
|
473
|
+
}
|
|
474
|
+
//calling prefernece api
|
|
475
|
+
displayID(token) {
|
|
476
|
+
const params = {
|
|
477
|
+
'Content-Type': 'application/json',
|
|
478
|
+
'Auth-Key': "Bearer " + token
|
|
479
|
+
};
|
|
480
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
481
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/display/callerids', httpOptions);
|
|
482
|
+
}
|
|
483
|
+
verifyNumber(token, dtModel) {
|
|
484
|
+
const params = {
|
|
485
|
+
'Content-Type': 'application/json',
|
|
486
|
+
'Auth-Key': "Bearer " + token
|
|
487
|
+
};
|
|
488
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
489
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/add/callerid', dtModel, httpOptions);
|
|
490
|
+
}
|
|
491
|
+
verifyStatus(token, dtModel) {
|
|
492
|
+
const params = {
|
|
493
|
+
'Content-Type': 'application/json',
|
|
494
|
+
'Auth-Key': "Bearer " + token
|
|
495
|
+
};
|
|
496
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
497
|
+
return this.http.get(environment.apiUrl + '/utilities/softphone/callerid/status/' + dtModel, httpOptions);
|
|
498
|
+
}
|
|
499
|
+
existingListmakeCallerID(token, dtModel) {
|
|
500
|
+
const params = {
|
|
501
|
+
'Content-Type': 'application/json',
|
|
502
|
+
'Auth-Key': "Bearer " + token
|
|
503
|
+
};
|
|
504
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
505
|
+
return this.http.post(environment.apiUrl + '/utilities/softphone/make/callerid', dtModel, httpOptions);
|
|
506
|
+
}
|
|
507
|
+
makeCallerID(token, dtModel, number) {
|
|
508
|
+
const params = {
|
|
509
|
+
'Content-Type': 'application/json',
|
|
510
|
+
'Auth-Key': "Bearer " + token
|
|
511
|
+
};
|
|
512
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
513
|
+
return this.http.post(environment.apiUrl + `/utilities/softphone/markas/callerid/${number}`, dtModel, httpOptions);
|
|
514
|
+
}
|
|
515
|
+
deleteCallerID(token, dtModel, id) {
|
|
516
|
+
const params = {
|
|
517
|
+
'Content-Type': 'application/json',
|
|
518
|
+
'Auth-Key': "Bearer " + token
|
|
519
|
+
};
|
|
520
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
521
|
+
return this.http.post(environment.apiUrl + `/utilities/softphone/delete/callerid/${id}`, dtModel, httpOptions);
|
|
522
|
+
}
|
|
523
|
+
deregisterCallerID(token, dtModel, id) {
|
|
524
|
+
const params = {
|
|
525
|
+
'Content-Type': 'application/json',
|
|
526
|
+
'Auth-Key': "Bearer " + token
|
|
527
|
+
};
|
|
528
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
529
|
+
return this.http.post(environment.apiUrl + `/utilities/softphone/deregister/callerid/${id}`, dtModel, httpOptions);
|
|
530
|
+
}
|
|
531
|
+
updateCallerIDLabel(token, dtModel) {
|
|
532
|
+
const params = {
|
|
533
|
+
'Content-Type': 'application/json',
|
|
534
|
+
'Auth-Key': "Bearer " + token
|
|
535
|
+
};
|
|
536
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
537
|
+
return this.http.put(environment.apiUrl + '/utilities/softphone/update/callerid/label', dtModel, httpOptions);
|
|
538
|
+
}
|
|
539
|
+
initiateCall(payload) {
|
|
540
|
+
return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
|
|
541
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap(ipAddressInfo => {
|
|
542
|
+
const params = {
|
|
543
|
+
'Content-Type': 'application/json',
|
|
544
|
+
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
|
|
545
|
+
'ip-address': ipAddressInfo.ip,
|
|
546
|
+
'ip-country': ipAddressInfo.address.country,
|
|
547
|
+
};
|
|
548
|
+
payload = Object.assign(Object.assign({}, payload), { proxy: ipAddressInfo.proxy.toString() });
|
|
549
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
550
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions).pipe(catchError(error => {
|
|
551
|
+
return throwError(error);
|
|
552
|
+
}));
|
|
553
|
+
}), catchError(error => {
|
|
554
|
+
// Catch error from getIpAddressInfo
|
|
555
|
+
return throwError(error);
|
|
556
|
+
}));
|
|
557
|
+
}));
|
|
558
|
+
}
|
|
559
|
+
fetchBlockedCountries() {
|
|
560
|
+
return this.http.get(environment.apiUrl + '/global/master/ur/blacklisted/countrylist').pipe(map(response => {
|
|
561
|
+
if (response.response === 'Success' && Array.isArray(response.countries)) {
|
|
562
|
+
return response.countries.map((country) => country.isocode);
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
throw new Error('Unable to fetch blocked countries');
|
|
566
|
+
}
|
|
567
|
+
}));
|
|
568
|
+
}
|
|
569
|
+
// initiateCall(payload: any): Observable<any> {
|
|
570
|
+
// return this.ipAddressService.getIpAddressInfo().pipe(
|
|
571
|
+
// switchMap(ipAddressInfo => {
|
|
572
|
+
// const params = {
|
|
573
|
+
// 'Content-Type': 'application/json',
|
|
574
|
+
// 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token'),
|
|
575
|
+
// 'ip-address': ipAddressInfo.ip,
|
|
576
|
+
// 'ip-country': ipAddressInfo.address.country
|
|
577
|
+
// };
|
|
578
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
579
|
+
// return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/initiate/call', payload, httpOptions);
|
|
580
|
+
// })
|
|
581
|
+
// );
|
|
582
|
+
// }
|
|
583
|
+
getIncomingCallToken(deviceId) {
|
|
584
|
+
const headers = {
|
|
585
|
+
'Content-Type': 'application/json',
|
|
586
|
+
'Auth-Key': "Bearer " + localStorage.getItem('ext_token')
|
|
587
|
+
};
|
|
588
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
589
|
+
const params = new HttpParams().set('deviceId', deviceId);
|
|
590
|
+
return this.http.get(environment.apiUrl + '/utilities/twilio/incomingcall/token/web', { headers, params });
|
|
591
|
+
}
|
|
592
|
+
getOutgoingCallToken(payload) {
|
|
593
|
+
const params = {
|
|
594
|
+
'Content-Type': 'application/json',
|
|
595
|
+
'Auth-Key': "Bearer " + localStorage.getItem('ext_token'),
|
|
596
|
+
'c2c-request': window.location.hostname
|
|
597
|
+
};
|
|
598
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
599
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/generate/token', payload, httpOptions);
|
|
600
|
+
}
|
|
601
|
+
getCallRecording(callSid) {
|
|
602
|
+
const headers = new HttpHeaders({
|
|
603
|
+
'Content-Type': 'application/json',
|
|
604
|
+
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
|
|
605
|
+
});
|
|
606
|
+
const httpOptions = { headers: headers };
|
|
607
|
+
return this.http.post(environment.apiUrl + '/utilities/twilio/call/callrecording?callSid=' + callSid, {}, httpOptions);
|
|
608
|
+
}
|
|
609
|
+
pauseOrResumeRecording(callSid, status) {
|
|
610
|
+
const headers = new HttpHeaders({
|
|
611
|
+
'Content-Type': 'application/json',
|
|
612
|
+
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
|
|
613
|
+
});
|
|
614
|
+
const httpOptions = { headers: headers };
|
|
615
|
+
return this.http.post(environment.apiUrl + `/utilities/twilio/update/recording/status?callSid=${callSid}&status=${status}`, {}, httpOptions);
|
|
616
|
+
}
|
|
617
|
+
getCallStatus(callAuthId) {
|
|
618
|
+
const headers = new HttpHeaders({
|
|
619
|
+
'Content-Type': 'application/json',
|
|
620
|
+
'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token')
|
|
621
|
+
});
|
|
622
|
+
const httpOptions = { headers: headers };
|
|
623
|
+
return this.http.get(environment.apiUrl + `/utilities/twilio/call/status/${callAuthId}`, httpOptions);
|
|
624
|
+
}
|
|
625
|
+
//sms api
|
|
626
|
+
sendSms(c2c_latlong, c2c_request, dtModel) {
|
|
627
|
+
return this.fetchBlockedCountries().pipe(switchMap(blockedCountries => {
|
|
628
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap((ipAddressInfo) => {
|
|
629
|
+
if (blockedCountries.includes(ipAddressInfo.address.countryCode)) {
|
|
630
|
+
return throwError({ message: ['User from blocked country'] });
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
const params = {
|
|
634
|
+
'Content-Type': 'application/json',
|
|
635
|
+
'c2c-latlong': c2c_latlong,
|
|
636
|
+
'c2c-request': c2c_request,
|
|
637
|
+
'ip-address': ipAddressInfo.ip,
|
|
638
|
+
'ip-country': ipAddressInfo.address.country,
|
|
639
|
+
};
|
|
640
|
+
dtModel = Object.assign(Object.assign({}, dtModel), { proxy: ipAddressInfo.proxy.toString() });
|
|
641
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
642
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/ur/send/sms', dtModel, httpOptions).pipe(catchError(error => {
|
|
643
|
+
// Handle HTTP errors here if needed
|
|
644
|
+
return throwError(error);
|
|
645
|
+
}));
|
|
646
|
+
}
|
|
647
|
+
}), catchError(error => {
|
|
648
|
+
// Catch error from getIpAddressInfo
|
|
649
|
+
return throwError(error);
|
|
650
|
+
}));
|
|
651
|
+
}), catchError(error => {
|
|
652
|
+
// Catch error from fetchBlockedCountries
|
|
653
|
+
return throwError(error);
|
|
654
|
+
}));
|
|
655
|
+
}
|
|
656
|
+
// sendSms(c2c_latlong: string, c2c_request: string, dtModel: any): Observable<any> {
|
|
657
|
+
// return this.ipAddressService.getIpAddressInfo().pipe(
|
|
658
|
+
// switchMap(ipAddressInfo => {
|
|
659
|
+
// const params = {
|
|
660
|
+
// 'Content-Type': 'application/json',
|
|
661
|
+
// 'c2c-latlong': c2c_latlong,
|
|
662
|
+
// 'c2c-request': c2c_request,
|
|
663
|
+
// 'ip-address': ipAddressInfo.ip,
|
|
664
|
+
// 'ip-country': ipAddressInfo.address.country
|
|
665
|
+
// };
|
|
666
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
667
|
+
// return this.http.post<[]>(environment.apiUrl + '/utilities/ext/ur/send/sms', dtModel, httpOptions);
|
|
668
|
+
// })
|
|
669
|
+
// );
|
|
670
|
+
// }
|
|
671
|
+
readContacts(token) {
|
|
672
|
+
const params = {
|
|
673
|
+
'Content-Type': 'application/json',
|
|
674
|
+
'Auth-Key': "Bearer " + token
|
|
675
|
+
};
|
|
676
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
677
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/read/contacts', httpOptions);
|
|
678
|
+
}
|
|
679
|
+
sentSMS(token, pageSize, pageIndex) {
|
|
680
|
+
const headers = {
|
|
681
|
+
'Content-Type': 'application/json',
|
|
682
|
+
'Auth-Key': "Bearer " + token,
|
|
683
|
+
};
|
|
684
|
+
let params = new HttpParams();
|
|
685
|
+
params = params.set('size', pageSize || '10');
|
|
686
|
+
params = params.set('page', pageIndex || '1');
|
|
687
|
+
const httpOptions = { headers, params };
|
|
688
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/sent/', httpOptions);
|
|
689
|
+
}
|
|
690
|
+
deleteSMS(token, recordIds, dtModel) {
|
|
691
|
+
const params = {
|
|
692
|
+
'Content-Type': 'application/json',
|
|
693
|
+
'Auth-Key': "Bearer " + token
|
|
694
|
+
};
|
|
695
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
696
|
+
return this.http.post(environment.apiUrl + `/utilities/sms/delete/${recordIds}`, dtModel, httpOptions);
|
|
697
|
+
}
|
|
698
|
+
// inboxSMS(token: string) {
|
|
699
|
+
// const params = {
|
|
700
|
+
// 'Content-Type': 'application/json',
|
|
701
|
+
// 'Auth-Key': "Bearer " + token
|
|
702
|
+
// }
|
|
703
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
704
|
+
// return this.http.get<[]>(environment.apiUrl + '/utilities/sms/inbox', httpOptions);
|
|
705
|
+
// }
|
|
706
|
+
inboxSMS(token, page, size) {
|
|
707
|
+
const params = new HttpParams()
|
|
708
|
+
.set('page', page.toString())
|
|
709
|
+
.set('size', size.toString());
|
|
710
|
+
const httpOptions = {
|
|
711
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
712
|
+
params: params
|
|
713
|
+
};
|
|
714
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/inbox', httpOptions);
|
|
715
|
+
}
|
|
716
|
+
readInboxStatus(token, recordId, dtModel) {
|
|
717
|
+
const params = {
|
|
718
|
+
'Content-Type': 'application/json',
|
|
719
|
+
'Auth-Key': "Bearer " + token
|
|
720
|
+
};
|
|
721
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
722
|
+
return this.http.post(environment.apiUrl + `/utilities/sms/markas/read/${recordId}`, dtModel, httpOptions);
|
|
723
|
+
}
|
|
724
|
+
markAsFavourite(token, recordIds, dtModel) {
|
|
725
|
+
const params = {
|
|
726
|
+
'Content-Type': 'application/json',
|
|
727
|
+
'Auth-Key': "Bearer " + token
|
|
728
|
+
};
|
|
729
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
730
|
+
return this.http.post(environment.apiUrl + `/utilities/sms/mark/favourite/${recordIds}`, dtModel, httpOptions);
|
|
731
|
+
}
|
|
732
|
+
markAsUnFavourite(token, recordIds, dtModel) {
|
|
733
|
+
const params = {
|
|
734
|
+
'Content-Type': 'application/json',
|
|
735
|
+
'Auth-Key': "Bearer " + token
|
|
736
|
+
};
|
|
737
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
738
|
+
return this.http.post(environment.apiUrl + `/utilities/sms/mark/unfavourite/${recordIds}`, dtModel, httpOptions);
|
|
739
|
+
}
|
|
740
|
+
viewfavouriteSMS(token, page, size) {
|
|
741
|
+
const params = new HttpParams()
|
|
742
|
+
.set('page', page.toString())
|
|
743
|
+
.set('size', size.toString());
|
|
744
|
+
const httpOptions = {
|
|
745
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
746
|
+
params: params
|
|
747
|
+
};
|
|
748
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/view/favourite', httpOptions);
|
|
749
|
+
}
|
|
750
|
+
saveDraft(token, dtModel) {
|
|
751
|
+
const params = {
|
|
752
|
+
'Content-Type': 'application/json',
|
|
753
|
+
'Auth-Key': "Bearer " + token
|
|
754
|
+
};
|
|
755
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
756
|
+
return this.http.post(environment.apiUrl + '/utilities/sms/save/draft', dtModel, httpOptions);
|
|
757
|
+
}
|
|
758
|
+
viewDraft(token, page, size) {
|
|
759
|
+
const params = new HttpParams()
|
|
760
|
+
.set('page', page.toString())
|
|
761
|
+
.set('size', size.toString());
|
|
762
|
+
const httpOptions = {
|
|
763
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
764
|
+
params: params
|
|
765
|
+
};
|
|
766
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/view/draft', httpOptions);
|
|
767
|
+
}
|
|
768
|
+
deleteDraftSMS(token, draftIds, dtModel) {
|
|
769
|
+
const params = {
|
|
770
|
+
'Content-Type': 'application/json',
|
|
771
|
+
'Auth-Key': "Bearer " + token
|
|
772
|
+
};
|
|
773
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
774
|
+
return this.http.post(environment.apiUrl + `/utilities/sms/delete/draft/${draftIds}`, dtModel, httpOptions);
|
|
775
|
+
}
|
|
776
|
+
//Address Book
|
|
777
|
+
viewContactLists(token) {
|
|
778
|
+
const params = {
|
|
779
|
+
'Content-Type': 'application/json',
|
|
780
|
+
'Auth-Key': "Bearer " + token
|
|
781
|
+
};
|
|
782
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
783
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/read/contacts', httpOptions);
|
|
784
|
+
}
|
|
785
|
+
deleteContact(token, phonebookid, dtModel) {
|
|
786
|
+
const params = {
|
|
787
|
+
'Content-Type': 'application/json',
|
|
788
|
+
'Auth-Key': "Bearer " + token
|
|
789
|
+
};
|
|
790
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
791
|
+
return this.http.post(environment.apiUrl + `/utilities/phonebook/delete/contact/${phonebookid}`, dtModel, httpOptions);
|
|
792
|
+
}
|
|
793
|
+
updateFavContacts(token, dtModel) {
|
|
794
|
+
const params = {
|
|
795
|
+
'Content-Type': 'application/json',
|
|
796
|
+
'Auth-Key': "Bearer " + token
|
|
797
|
+
};
|
|
798
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
799
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/update/favourite', dtModel, httpOptions);
|
|
800
|
+
}
|
|
801
|
+
// saveContacts(token: string, dtModel: any){
|
|
802
|
+
// const params = {
|
|
803
|
+
// 'Content-Type': 'application/json',
|
|
804
|
+
// 'Auth-Key': "Bearer " + token
|
|
805
|
+
// }
|
|
806
|
+
// const httpOptions = { headers: new HttpHeaders(params) };
|
|
807
|
+
// return this.http.post<[]>(environment.apiUrl + '/utilities/phonebook/add/contacts/manually',dtModel, httpOptions);
|
|
808
|
+
// }
|
|
809
|
+
uploadImage(token, dtModel) {
|
|
810
|
+
const params = {
|
|
811
|
+
//'Content-Type': 'multipart/form-data',
|
|
812
|
+
'Auth-Key': "Bearer " + token
|
|
813
|
+
};
|
|
814
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
815
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/upload/photo', dtModel, httpOptions);
|
|
816
|
+
}
|
|
817
|
+
//Call Histroy
|
|
818
|
+
recentCallHistory(token, page, size) {
|
|
819
|
+
const params = new HttpParams()
|
|
820
|
+
.set('page', page.toString())
|
|
821
|
+
.set('size', size.toString());
|
|
822
|
+
const httpOptions = {
|
|
823
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
824
|
+
params: params
|
|
825
|
+
};
|
|
826
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/recent/calls', httpOptions);
|
|
827
|
+
}
|
|
828
|
+
deleteCalls(token, recordId, dtModel) {
|
|
829
|
+
const params = {
|
|
830
|
+
'Content-Type': 'application/json',
|
|
831
|
+
'Auth-Key': "Bearer " + token
|
|
832
|
+
};
|
|
833
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
834
|
+
return this.http.post(environment.apiUrl + `/utilities/phonebook/delete/calls/${recordId}`, dtModel, httpOptions);
|
|
835
|
+
}
|
|
836
|
+
//SMS History
|
|
837
|
+
recentSMSHistory(token, page, size) {
|
|
838
|
+
const params = new HttpParams()
|
|
839
|
+
.set('page', page.toString())
|
|
840
|
+
.set('size', size.toString());
|
|
841
|
+
const httpOptions = {
|
|
842
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
843
|
+
params: params
|
|
844
|
+
};
|
|
845
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/history', httpOptions);
|
|
846
|
+
}
|
|
847
|
+
getRecentVoiceRecordingData(token, filterData, page, size) {
|
|
848
|
+
const params = new HttpParams()
|
|
849
|
+
.set('page', page.toString())
|
|
850
|
+
.set('size', size.toString());
|
|
851
|
+
const httpOptions = {
|
|
852
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
853
|
+
params: params
|
|
854
|
+
};
|
|
855
|
+
const filterObj = {};
|
|
856
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/recent/voicerecording', filterData, httpOptions);
|
|
857
|
+
}
|
|
858
|
+
// save voice mail recording
|
|
859
|
+
saveVoiceMailReocrding(token, recordingData) {
|
|
860
|
+
const httpOptions = {
|
|
861
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
862
|
+
// params: params
|
|
863
|
+
};
|
|
864
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/update/recording', recordingData, httpOptions);
|
|
865
|
+
}
|
|
866
|
+
deleteVoiceRecording(token, recordingId) {
|
|
867
|
+
const httpOptions = {
|
|
868
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
869
|
+
// params: params
|
|
870
|
+
};
|
|
871
|
+
return this.http.delete(environment.apiUrl + `/utilities/phonebook/delete/voicerecordings/${recordingId}`, httpOptions);
|
|
872
|
+
}
|
|
873
|
+
markAsVoiceRecording(token, recordingId, dtModel) {
|
|
874
|
+
const httpOptions = {
|
|
875
|
+
headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + token }),
|
|
876
|
+
};
|
|
877
|
+
return this.http.post(environment.apiUrl + `/utilities/phonebook/markas/voicemail/read/${recordingId}`, dtModel, httpOptions);
|
|
878
|
+
}
|
|
879
|
+
editContactById(token, id) {
|
|
880
|
+
const params = {
|
|
881
|
+
'Content-Type': 'application/json',
|
|
882
|
+
'Auth-Key': "Bearer " + token
|
|
883
|
+
};
|
|
884
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
885
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/search/contactid/' + id, httpOptions);
|
|
886
|
+
}
|
|
887
|
+
updateContacts(token, dtModel) {
|
|
888
|
+
const params = {
|
|
889
|
+
'Content-Type': 'application/json',
|
|
890
|
+
'Auth-Key': "Bearer " + token
|
|
891
|
+
};
|
|
892
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
893
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/update/contact', dtModel, httpOptions);
|
|
894
|
+
}
|
|
895
|
+
uploadPhoto(payload) {
|
|
896
|
+
let httpOptions = {
|
|
897
|
+
headers: new HttpHeaders({
|
|
898
|
+
'Auth-Key': "Bearer " + localStorage.getItem('ext_token')
|
|
899
|
+
})
|
|
900
|
+
};
|
|
901
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/upload/photo', payload, httpOptions);
|
|
902
|
+
}
|
|
903
|
+
saveContacts(token, payload) {
|
|
904
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + token }) };
|
|
905
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/add/contacts/manually', payload, httpOptions);
|
|
906
|
+
}
|
|
907
|
+
//Dowload csv template
|
|
908
|
+
downloadCsvTemplate(token) {
|
|
909
|
+
const params = {
|
|
910
|
+
'Content-Type': 'application/json',
|
|
911
|
+
'Auth-Key': "Bearer " + token
|
|
912
|
+
};
|
|
913
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
914
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/download/csv', httpOptions);
|
|
915
|
+
}
|
|
916
|
+
//Upload csv contacts
|
|
917
|
+
updateCSVContacts(token, dtModel) {
|
|
918
|
+
const params = {
|
|
919
|
+
'Content-Type': 'application/json',
|
|
920
|
+
'Auth-Key': "Bearer " + token
|
|
921
|
+
};
|
|
922
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
923
|
+
return this.http.post(environment.apiUrl + '/utilities/phonebook/add/contacts', dtModel, httpOptions);
|
|
924
|
+
}
|
|
925
|
+
//City list
|
|
926
|
+
GetAllCityList(_countryId, _stateName) {
|
|
927
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
928
|
+
return this.http.get(environment.apiUrl + '/global/master/ur/citylist/' + _countryId + '/' + _stateName, httpOptions);
|
|
929
|
+
}
|
|
930
|
+
//zip list
|
|
931
|
+
GetAllZipList(dataModel) {
|
|
932
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
933
|
+
return this.http.post(environment.apiUrl + '/global/master/ur/postalcodes', dataModel, httpOptions);
|
|
934
|
+
}
|
|
935
|
+
//Get all invoices
|
|
936
|
+
GetInvoices(viewType, token) {
|
|
937
|
+
const params = {
|
|
938
|
+
'Content-Type': 'application/json',
|
|
939
|
+
'Auth-Key': "Bearer " + token
|
|
940
|
+
};
|
|
941
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
942
|
+
return this.http.get(environment.apiUrl + '/utilities/billing/invoices/' + viewType, httpOptions);
|
|
943
|
+
}
|
|
944
|
+
DownloadInvoice(invoiceId, token) {
|
|
945
|
+
const httpOptions = {
|
|
946
|
+
responseType: 'blob',
|
|
947
|
+
headers: new HttpHeaders({
|
|
948
|
+
'Content-Type': 'application/json',
|
|
949
|
+
'Auth-Key': "Bearer " + token
|
|
950
|
+
})
|
|
951
|
+
};
|
|
952
|
+
return this.http.get(environment.apiUrl + '/utilities/billing/invoice/file/' + invoiceId, httpOptions);
|
|
953
|
+
}
|
|
954
|
+
GetInvoice(invoiceId) {
|
|
955
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
956
|
+
return this.http.get(environment.apiUrl + '/utilities/billing/invoice/' + invoiceId, httpOptions);
|
|
957
|
+
}
|
|
958
|
+
//Billing summary
|
|
959
|
+
GetBillingSummary(token) {
|
|
960
|
+
const params = {
|
|
961
|
+
'Content-Type': 'application/json',
|
|
962
|
+
'Auth-Key': "Bearer " + token
|
|
963
|
+
};
|
|
964
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
965
|
+
return this.http.get(environment.apiUrl + '/utilities/billing/summary', httpOptions);
|
|
966
|
+
}
|
|
967
|
+
//Billing Plan & Pricing
|
|
968
|
+
GetAllPlans(token) {
|
|
969
|
+
const params = {
|
|
970
|
+
'Content-Type': 'application/json',
|
|
971
|
+
'Auth-Key': "Bearer " + token
|
|
972
|
+
};
|
|
973
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
974
|
+
return this.http.get(environment.apiUrl + '/utilities/billing/tiers', httpOptions);
|
|
975
|
+
}
|
|
976
|
+
//Pay Now
|
|
977
|
+
payNow(invoiceId, cardId, token) {
|
|
978
|
+
const params = {
|
|
979
|
+
'Content-Type': 'application/json',
|
|
980
|
+
'Auth-Key': "Bearer " + token
|
|
981
|
+
};
|
|
982
|
+
const data = {
|
|
983
|
+
"invoiceId": invoiceId,
|
|
984
|
+
"cardId": cardId
|
|
985
|
+
};
|
|
986
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
987
|
+
return this.http.post(environment.apiUrl + `/utilities/billing/pay/invoice/${invoiceId}/${cardId}`, data, httpOptions);
|
|
988
|
+
}
|
|
989
|
+
confirmInvoicePayment(customerId, token) {
|
|
990
|
+
const params = {
|
|
991
|
+
'Content-Type': 'application/json',
|
|
992
|
+
'Auth-Key': "Bearer " + token
|
|
993
|
+
};
|
|
994
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
995
|
+
return this.http.post(environment.apiUrl + `/utilities/billing/invoice/confirmation/${customerId}`, {}, httpOptions);
|
|
996
|
+
}
|
|
997
|
+
loadStripeMethods(sessionid, token) {
|
|
998
|
+
const params = {
|
|
999
|
+
'Content-Type': 'application/json',
|
|
1000
|
+
'Auth-Key': "Bearer " + token
|
|
1001
|
+
};
|
|
1002
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1003
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/duplicate/card/' + sessionid, httpOptions);
|
|
1004
|
+
}
|
|
1005
|
+
logOut(authKey) {
|
|
1006
|
+
const auth = { "Auth-Key": authKey };
|
|
1007
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + authKey }) };
|
|
1008
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/logout', {}, httpOptions);
|
|
1009
|
+
}
|
|
1010
|
+
registerFCMToken(payload) {
|
|
1011
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1012
|
+
return this.http.post(environment.apiUrl + '/firebase/register/device', payload, httpOptions);
|
|
1013
|
+
}
|
|
1014
|
+
getNotificationList(pageIndex, pageSize) {
|
|
1015
|
+
let params = new HttpParams();
|
|
1016
|
+
params = params.set('size', pageSize || '10');
|
|
1017
|
+
params = params.set('page', pageIndex || '1');
|
|
1018
|
+
const headers = { 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') };
|
|
1019
|
+
const httpOptions = { headers, params };
|
|
1020
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/stored/notification', httpOptions);
|
|
1021
|
+
}
|
|
1022
|
+
getTotalUnreadCount() {
|
|
1023
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1024
|
+
return this.http.get(environment.apiUrl + '/utilities/sms/notification/count', httpOptions);
|
|
1025
|
+
}
|
|
1026
|
+
markNotification(payload) {
|
|
1027
|
+
//const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1028
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
1029
|
+
return this.http.post(environment.apiUrl + '/firebase/ur/markas/seen/' + payload.notificationId + '/' + payload.status, {}, httpOptions);
|
|
1030
|
+
}
|
|
1031
|
+
deleteNotification(payload) {
|
|
1032
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1033
|
+
return this.http.post(environment.apiUrl + '/firebase/markas/seen/' + payload.notificationId + '/' + payload.status, {}, httpOptions);
|
|
1034
|
+
}
|
|
1035
|
+
getVoicemailDetails(recordId, token) {
|
|
1036
|
+
const params = {
|
|
1037
|
+
'Content-Type': 'application/json',
|
|
1038
|
+
'Auth-Key': "Bearer " + token
|
|
1039
|
+
};
|
|
1040
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1041
|
+
return this.http.get(environment.apiUrl + `/utilities/phonebook/play/voicerecordings/${recordId}`, httpOptions);
|
|
1042
|
+
}
|
|
1043
|
+
deleteNotifications(token, notificationIds) {
|
|
1044
|
+
const params = {
|
|
1045
|
+
'Content-Type': 'application/json',
|
|
1046
|
+
'Auth-Key': "Bearer " + token
|
|
1047
|
+
};
|
|
1048
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1049
|
+
return this.http.get(environment.apiUrl + `/utilities/sms/delete/notification/${notificationIds}`, httpOptions);
|
|
1050
|
+
}
|
|
1051
|
+
getReports(filterData, pageIndex, pageSize) {
|
|
1052
|
+
const filterObj = {
|
|
1053
|
+
accountStatus: filterData.accountStatus || "",
|
|
1054
|
+
dateType: filterData.dateType || "",
|
|
1055
|
+
fieldType: filterData.fieldType || "",
|
|
1056
|
+
fieldValue: filterData.fieldValue || "",
|
|
1057
|
+
fromDate: filterData.fromDate || "",
|
|
1058
|
+
pendingDues: filterData.pendingDues,
|
|
1059
|
+
toDate: filterData.toDate || "",
|
|
1060
|
+
};
|
|
1061
|
+
const params = new HttpParams()
|
|
1062
|
+
.set('page', (pageIndex === null || pageIndex === void 0 ? void 0 : pageIndex.toString()) || '1')
|
|
1063
|
+
.set('size', (pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) || '10');
|
|
1064
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }),
|
|
1065
|
+
params: params };
|
|
1066
|
+
return this.http.post(environment.apiUrl + '/utilities/report/user/details', filterObj, httpOptions);
|
|
1067
|
+
}
|
|
1068
|
+
getReportsFilter() {
|
|
1069
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1070
|
+
return this.http.get(environment.apiUrl + '/utilities/report/dropdown', httpOptions);
|
|
1071
|
+
}
|
|
1072
|
+
getSyncReportData() {
|
|
1073
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1074
|
+
return this.http.post(environment.apiUrl + '/utilities/report/update/cache', {}, httpOptions);
|
|
1075
|
+
}
|
|
1076
|
+
getDownloadCSV(filterData, pageIndex, pageSize) {
|
|
1077
|
+
const filterObj = {
|
|
1078
|
+
accountStatus: filterData.accountStatus || "",
|
|
1079
|
+
dateType: filterData.dateType || "",
|
|
1080
|
+
fieldType: filterData.fieldType || "",
|
|
1081
|
+
fieldValue: filterData.fieldValue || "",
|
|
1082
|
+
fromDate: filterData.fromDate || "",
|
|
1083
|
+
pendingDues: filterData.pendingDues,
|
|
1084
|
+
toDate: filterData.toDate || "",
|
|
1085
|
+
};
|
|
1086
|
+
const params = new HttpParams()
|
|
1087
|
+
.set('page', pageIndex > 0 ? pageIndex.toString() : '1')
|
|
1088
|
+
.set('size', pageSize.toString());
|
|
1089
|
+
const httpOptions = { headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }), params: params };
|
|
1090
|
+
return this.http.post(environment.apiUrl + '/utilities/report/csv/download', filterObj, httpOptions);
|
|
1091
|
+
}
|
|
1092
|
+
getDeleteFile(filePathValue) {
|
|
1093
|
+
const httpOptions = {
|
|
1094
|
+
body: { filePath: filePathValue },
|
|
1095
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1096
|
+
};
|
|
1097
|
+
return this.http.post(environment.apiUrl + '/utilities/report/download/complete', httpOptions);
|
|
1098
|
+
}
|
|
1099
|
+
getDownloadPDF(filterData, pageIndex, pageSize) {
|
|
1100
|
+
const filterObj = {
|
|
1101
|
+
accountStatus: filterData.accountStatus || "",
|
|
1102
|
+
dateType: filterData.dateType || "",
|
|
1103
|
+
fieldType: filterData.fieldType || "",
|
|
1104
|
+
fieldValue: filterData.fieldValue || "",
|
|
1105
|
+
fromDate: filterData.fromDate || "",
|
|
1106
|
+
pendingDues: filterData.pendingDues,
|
|
1107
|
+
toDate: filterData.toDate || "",
|
|
1108
|
+
};
|
|
1109
|
+
const params = new HttpParams()
|
|
1110
|
+
.set('page', pageIndex > 0 ? pageIndex.toString() : '1')
|
|
1111
|
+
.set('size', pageSize.toString());
|
|
1112
|
+
const httpOptions = { headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }), params: params };
|
|
1113
|
+
return this.http.post(environment.apiUrl + '/utilities/report/pdf/download', filterObj, httpOptions);
|
|
1114
|
+
}
|
|
1115
|
+
getSuspendCategoriesData() {
|
|
1116
|
+
const httpOptions = {
|
|
1117
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1118
|
+
};
|
|
1119
|
+
return this.http.get(environment.apiUrl + '/utilities/report/suspend/category/dropdown', httpOptions);
|
|
1120
|
+
}
|
|
1121
|
+
getUserDetailsForSuspend(userIds) {
|
|
1122
|
+
const httpOptions = {
|
|
1123
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1124
|
+
};
|
|
1125
|
+
return this.http.post(`${environment.apiUrl}/admin/suspension/data/${encodeURIComponent(userIds)}`, null, httpOptions);
|
|
1126
|
+
}
|
|
1127
|
+
suspendUsers(userData) {
|
|
1128
|
+
const httpOptions = {
|
|
1129
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1130
|
+
};
|
|
1131
|
+
return this.http.post(`${environment.apiUrl}/admin/suspend/user`, userData, httpOptions);
|
|
1132
|
+
}
|
|
1133
|
+
resumeUser(userData) {
|
|
1134
|
+
const httpOptions = {
|
|
1135
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1136
|
+
};
|
|
1137
|
+
return this.http.post(`${environment.apiUrl}/admin/resume/user`, userData, httpOptions);
|
|
1138
|
+
}
|
|
1139
|
+
resumeUnpaidUsers(userData) {
|
|
1140
|
+
const httpOptions = {
|
|
1141
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1142
|
+
};
|
|
1143
|
+
return this.http.post(`${environment.apiUrl}/admin/resume/unpaid/user`, userData, httpOptions);
|
|
1144
|
+
}
|
|
1145
|
+
deleteUser(userData) {
|
|
1146
|
+
const httpOptions = {
|
|
1147
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1148
|
+
};
|
|
1149
|
+
return this.http.post(`${environment.apiUrl}/admin/delete/user`, userData, httpOptions);
|
|
1150
|
+
}
|
|
1151
|
+
deleteUserAccount() {
|
|
1152
|
+
const httpOptions = {
|
|
1153
|
+
headers: new HttpHeaders({ 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') })
|
|
1154
|
+
};
|
|
1155
|
+
// return this.http.post<any[]>(`${environment.apiUrl}/utilities/ext/delete/user/`, userData, httpOptions);
|
|
1156
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap((ipAddressInfo) => {
|
|
1157
|
+
return this.http.post(`${environment.apiUrl}/utilities/ext/delete/user/${this.platform}/${ipAddressInfo.ip}`, null, httpOptions);
|
|
1158
|
+
}), catchError((error) => {
|
|
1159
|
+
// Properly catch errors
|
|
1160
|
+
return throwError(error);
|
|
1161
|
+
}));
|
|
1162
|
+
}
|
|
1163
|
+
getIPDetailsForCall(recordId, callStatus, deviceId) {
|
|
1164
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap((ipAddressInfo) => {
|
|
1165
|
+
const IpObj = {
|
|
1166
|
+
'ipAddress': ipAddressInfo.ip,
|
|
1167
|
+
'ipCountry': ipAddressInfo.address.country,
|
|
1168
|
+
'recordId': recordId,
|
|
1169
|
+
'callStatus': callStatus,
|
|
1170
|
+
'deviceId': deviceId
|
|
1171
|
+
};
|
|
1172
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
287
1173
|
return this.http.post(environment.apiUrl + '/utilities/twilio/incoming/call/ip', IpObj, httpOptions).pipe(catchError(postError => {
|
|
288
1174
|
// console.log('Error during HTTP POST request:', postError);
|
|
289
1175
|
return throwError(postError);
|
|
@@ -293,6 +1179,114 @@ class ExtensionService {
|
|
|
293
1179
|
return throwError(ipError);
|
|
294
1180
|
}));
|
|
295
1181
|
}
|
|
1182
|
+
getIPDetailsForSMS(recordId) {
|
|
1183
|
+
return this.ipAddressService.getIpAddressInfo().pipe(switchMap((ipAddressInfo) => {
|
|
1184
|
+
const IpObj = {
|
|
1185
|
+
'ipAddress': ipAddressInfo.ip,
|
|
1186
|
+
'ipCountry': ipAddressInfo.address.country,
|
|
1187
|
+
'recordId': recordId,
|
|
1188
|
+
};
|
|
1189
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1190
|
+
return this.http.post(environment.apiUrl + '/utilities/twilio/inbound/sms/ip', IpObj, httpOptions);
|
|
1191
|
+
}, catchError(error => {
|
|
1192
|
+
// Catch error from getIpAddressInfo
|
|
1193
|
+
return throwError(error);
|
|
1194
|
+
})));
|
|
1195
|
+
}
|
|
1196
|
+
GetAllAvailableCountryList() {
|
|
1197
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
|
|
1198
|
+
return this.http.get(environment.apiUrl + '/global/master/ur/dedicated/countrylist');
|
|
1199
|
+
// return this.http.get<string>(environment.apiUrl + '/global/master/ur/countrylist', httpOptions);
|
|
1200
|
+
}
|
|
1201
|
+
getUserSettings() {
|
|
1202
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1203
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/settings', httpOptions);
|
|
1204
|
+
}
|
|
1205
|
+
updateDialCodePreference(settings) {
|
|
1206
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1207
|
+
return this.http.put(environment.apiUrl + '/utilities/ext/update/settings', settings, httpOptions);
|
|
1208
|
+
}
|
|
1209
|
+
updateLongPressTime(time) {
|
|
1210
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1211
|
+
return this.http.put(environment.apiUrl + '/utilities/ext/update/longpress/' + time, {}, httpOptions);
|
|
1212
|
+
}
|
|
1213
|
+
exportToCSV() {
|
|
1214
|
+
const httpOptions = { headers: new HttpHeaders({ 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }), responseType: 'blob' };
|
|
1215
|
+
return this.http.get(environment.apiUrl + '/utilities/phonebook/download/contacts', httpOptions);
|
|
1216
|
+
}
|
|
1217
|
+
getDialPreferenceNums() {
|
|
1218
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1219
|
+
return this.http.get(environment.apiUrl + '/utilities/ext/dial/preference/dropdown', httpOptions);
|
|
1220
|
+
}
|
|
1221
|
+
updateVASSettings(token, dtModel) {
|
|
1222
|
+
const params = {
|
|
1223
|
+
'Content-Type': 'application/json',
|
|
1224
|
+
'Auth-Key': "Bearer " + token
|
|
1225
|
+
};
|
|
1226
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1227
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/value/added/service', dtModel, httpOptions);
|
|
1228
|
+
}
|
|
1229
|
+
updateVoiceMailSettings(token, dtModel) {
|
|
1230
|
+
const params = {
|
|
1231
|
+
'Content-Type': 'application/json',
|
|
1232
|
+
'Auth-Key': "Bearer " + token
|
|
1233
|
+
};
|
|
1234
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1235
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/update/voicemail/setting', dtModel, httpOptions);
|
|
1236
|
+
}
|
|
1237
|
+
updateVoiceRecordSettings(token, dtModel) {
|
|
1238
|
+
const params = {
|
|
1239
|
+
'Content-Type': 'application/json',
|
|
1240
|
+
'Auth-Key': "Bearer " + token
|
|
1241
|
+
};
|
|
1242
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1243
|
+
return this.http.post(environment.apiUrl + '/utilities/ext/update/call/recording/setting', dtModel, httpOptions);
|
|
1244
|
+
}
|
|
1245
|
+
getManualLinks(deviceType) {
|
|
1246
|
+
return `${environment.apiUrl}/landing/support/ur/user/manual/${deviceType}`;
|
|
1247
|
+
}
|
|
1248
|
+
updateSignupProfile(body) {
|
|
1249
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': 'Bearer ' + localStorage.getItem('ext_token') }) };
|
|
1250
|
+
return this.http.put(environment.apiUrl + '/utilities/ext/ur/update/signup/profile', body, httpOptions);
|
|
1251
|
+
}
|
|
1252
|
+
getAdminSettings() {
|
|
1253
|
+
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json', 'Auth-Key': "Bearer " + localStorage.getItem('ext_token') }) };
|
|
1254
|
+
return this.http.get(environment.apiUrl + '/admin/settings', httpOptions);
|
|
1255
|
+
}
|
|
1256
|
+
updateActions(token, dtModel) {
|
|
1257
|
+
const params = {
|
|
1258
|
+
'Content-Type': 'application/json',
|
|
1259
|
+
'Auth-Key': "Bearer " + token
|
|
1260
|
+
};
|
|
1261
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1262
|
+
return this.http.post(environment.apiUrl + '/admin/change/settings', dtModel, httpOptions);
|
|
1263
|
+
}
|
|
1264
|
+
updateValueAddedServices(token, dtModel) {
|
|
1265
|
+
const params = {
|
|
1266
|
+
'Content-Type': 'application/json',
|
|
1267
|
+
'Auth-Key': "Bearer " + token
|
|
1268
|
+
};
|
|
1269
|
+
const httpOptions = { headers: new HttpHeaders(params) };
|
|
1270
|
+
return this.http.post(environment.apiUrl + '/admin/value/added/service', dtModel, httpOptions);
|
|
1271
|
+
}
|
|
1272
|
+
deleteAdminUsers(token, userIds) {
|
|
1273
|
+
const httpOptions = {
|
|
1274
|
+
headers: new HttpHeaders({
|
|
1275
|
+
'Content-Type': 'application/json',
|
|
1276
|
+
'Auth-Key': 'Bearer ' + token
|
|
1277
|
+
})
|
|
1278
|
+
};
|
|
1279
|
+
return this.http.delete(environment.apiUrl + `/admin/delete/value/usage/${userIds}`, httpOptions);
|
|
1280
|
+
}
|
|
1281
|
+
getUserInformation(twilioAuthId) {
|
|
1282
|
+
const httpOptions = {
|
|
1283
|
+
headers: new HttpHeaders({
|
|
1284
|
+
'Content-Type': 'application/json',
|
|
1285
|
+
'Auth-Key': 'Bearer ' + this.token
|
|
1286
|
+
})
|
|
1287
|
+
};
|
|
1288
|
+
return this.http.get(environment.apiUrl + '/utilities/twilio/c2c/information/' + twilioAuthId, httpOptions);
|
|
1289
|
+
}
|
|
296
1290
|
}
|
|
297
1291
|
ExtensionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExtensionService, deps: [{ token: i1.HttpClient }, { token: IpAddressService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
298
1292
|
ExtensionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ExtensionService, providedIn: 'root' });
|
|
@@ -303,12 +1297,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
303
1297
|
}]
|
|
304
1298
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: IpAddressService }]; } });
|
|
305
1299
|
|
|
306
|
-
const GlobalConstant = {
|
|
307
|
-
ErrorMsg500: "Unable to process request. Please try again later.",
|
|
308
|
-
isSMSVisible: true,
|
|
309
|
-
dedicatedNumText: 'C2C Number'
|
|
310
|
-
};
|
|
311
|
-
|
|
312
1300
|
class NotificationService {
|
|
313
1301
|
constructor(twilioService) {
|
|
314
1302
|
this.twilioService = twilioService;
|
|
@@ -567,6 +1555,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
567
1555
|
}]
|
|
568
1556
|
}], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: ExtensionService }, { type: NotificationService }]; } });
|
|
569
1557
|
|
|
1558
|
+
const GlobalConstant = {
|
|
1559
|
+
ErrorMsg500: "Unable to process request. Please try again later.",
|
|
1560
|
+
isSMSVisible: true,
|
|
1561
|
+
dedicatedNumText: 'C2C Number'
|
|
1562
|
+
};
|
|
1563
|
+
|
|
570
1564
|
class IncomingCallComponent {
|
|
571
1565
|
constructor(extensionService, twilioService, notificationSerivce) {
|
|
572
1566
|
this.extensionService = extensionService;
|
|
@@ -590,9 +1584,16 @@ class IncomingCallComponent {
|
|
|
590
1584
|
console.log('IncomingCallComponent');
|
|
591
1585
|
}
|
|
592
1586
|
ngOnInit() {
|
|
1587
|
+
// this.twilioService.currentCall.subscribe((call: any) => {
|
|
1588
|
+
// if (call) {
|
|
1589
|
+
// this.twilioCallData = call;
|
|
1590
|
+
// this.notificationSerivce.showNotification(call);
|
|
1591
|
+
// // Handle the call UI
|
|
1592
|
+
// }
|
|
1593
|
+
// });
|
|
593
1594
|
console.log('IncomingCallComponent ngOnInit');
|
|
594
1595
|
try {
|
|
595
|
-
this.twilioService.currentCall.subscribe(
|
|
1596
|
+
this.twilioService.currentCall.subscribe(call => {
|
|
596
1597
|
if (call) {
|
|
597
1598
|
this.twilioCallData = call;
|
|
598
1599
|
this.twilioAuthId = call.customParameters.get('twilioAuthId');
|
|
@@ -639,8 +1640,8 @@ class IncomingCallComponent {
|
|
|
639
1640
|
data.accept();
|
|
640
1641
|
data.isCallConnected = true;
|
|
641
1642
|
data.isFirstCall = true;
|
|
1643
|
+
this.extensionService.setCallSid(this.CallSid, this.recordCall);
|
|
642
1644
|
this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
|
|
643
|
-
this.extensionService.setCallSid(this.CallSid, this.recordCall);
|
|
644
1645
|
this.closeIncomingCallWrapper(1);
|
|
645
1646
|
});
|
|
646
1647
|
}
|
|
@@ -802,6 +1803,7 @@ class IncomingCallComponent {
|
|
|
802
1803
|
});
|
|
803
1804
|
}
|
|
804
1805
|
resumeRecording(sid) {
|
|
1806
|
+
// let sid;
|
|
805
1807
|
const details = this.extensionService.getCallSid();
|
|
806
1808
|
this.incomingCallSid = details.callSid;
|
|
807
1809
|
this.incomingRecordCall = details.recordCall;
|
|
@@ -829,10 +1831,10 @@ class IncomingCallComponent {
|
|
|
829
1831
|
}
|
|
830
1832
|
}
|
|
831
1833
|
IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
832
|
-
IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList", deviceId: "deviceId" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%; left: 116px;\" *ngIf=\"newIncomingCallsList?.length > 0\">\r\n <div class=\"collops\">\r\n <div class=\"d-flex w-100\">\r\n <div class=\"d-flex flex-column container-fluid\" >\r\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\r\n <ng-container *ngFor=\"let data of newIncomingCallsList\"> \r\n <div class=\"p-2 \">\r\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\r\n <div class=\"img\">\r\n <img class=\"avatar-img-wrapper\" [src]=\"data?.img\" alt=\"\" width=\"45\" />\r\n </div>\r\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\r\n <div class=\"callerDetails-wrapper\">\r\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\r\n <p class=\"break-word\">{{data?.userInfo?.displayNum ? data?.userInfo?.c2cInformation?.number : data?.userInfo?.c2cInformation?.number }}</p>\r\n </div> \r\n <div class=\"d-flex align-items-center\">\r\n <button class=\"call-btn-wrapper receive-btn\" *ngIf=\"!data?.isCallConnected\">\r\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\r\n </button>\r\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.isCallConnected\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic</span>\r\n </button>\r\n <div class=\"record-btn-container\">\r\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording('')\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"recording-icon\"></span>\r\n </button> \r\n <div class=\"pause-resume-btns\">\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\r\n <span class=\"material-symbols-outlined\"> pause </span>\r\n </button>\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording('')\">\r\n <span class=\"material-symbols-outlined\"> play_arrow </span>\r\n </button>\r\n </div>\r\n </div>\r\n <button class=\"call-btn-wrapper reject-btn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\r\n </button>\r\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand \"> \r\n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\r\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\r\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\r\n </div>\r\n <div class=\"text-center\">\r\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\r\n </div>\r\n <div class=\"f-13\">\r\n <div class=\"row mb-3\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Subject:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\r\n </div> \r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Email:</div>\r\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\r\n </div> \r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Number:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\r\n </div>\r\n <div class=\"col-6\">\r\n <div class=\"\">Language:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Extension:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mb-3\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Image:</div>\r\n <div class=\"text-ellipsis\">\r\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\r\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\r\n </ng-container>\r\n <ng-template #noImage>\r\n <span class=\"ml-2\">No Image Available</span>\r\n </ng-template>\r\n </div>\r\n </div> \r\n </div>\r\n\r\n <div class=\" mb-4\">\r\n <div class=\"\">\r\n <div class=\"\">Message:</div>\r\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Point Name:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\r\n </div>\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Source Name:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"call-action-btns mt-0\">\r\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.isCallConnected\">\r\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\r\n </button>\r\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.isCallConnected\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n </button>\r\n <button class=\"call-btn reject-btn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wave-container\">\r\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\r\n <defs>\r\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n</div>\r\n\r\n\r\n", styles: [".call-container{width:752px!important;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:400px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:395px!important}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1834
|
+
IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList", deviceId: "deviceId" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%; left: 116px;\" *ngIf=\"newIncomingCallsList?.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\" >\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\"> \n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"data?.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data?.userInfo?.displayNum ? data?.userInfo?.c2cInformation?.number : data?.userInfo?.c2cInformation?.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" *ngIf=\"!data?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.isCallConnected\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic</span>\n </button>\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording('')\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button> \n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording('')\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand \"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.isCallConnected\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:752px!important;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:400px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:395px!important}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
833
1835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
|
|
834
1836
|
type: Component,
|
|
835
|
-
args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%; left: 116px;\" *ngIf=\"newIncomingCallsList?.length > 0\">\r\n <div class=\"collops\">\r\n <div class=\"d-flex w-100\">\r\n <div class=\"d-flex flex-column container-fluid\" >\r\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\r\n <ng-container *ngFor=\"let data of newIncomingCallsList\"> \r\n <div class=\"p-2 \">\r\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\r\n <div class=\"img\">\r\n <img class=\"avatar-img-wrapper\" [src]=\"data?.img\" alt=\"\" width=\"45\" />\r\n </div>\r\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\r\n <div class=\"callerDetails-wrapper\">\r\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\r\n <p class=\"break-word\">{{data?.userInfo?.displayNum ? data?.userInfo?.c2cInformation?.number : data?.userInfo?.c2cInformation?.number }}</p>\r\n </div> \r\n <div class=\"d-flex align-items-center\">\r\n <button class=\"call-btn-wrapper receive-btn\" *ngIf=\"!data?.isCallConnected\">\r\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\r\n </button>\r\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.isCallConnected\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic</span>\r\n </button>\r\n <div class=\"record-btn-container\">\r\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording('')\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"recording-icon\"></span>\r\n </button> \r\n <div class=\"pause-resume-btns\">\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\r\n <span class=\"material-symbols-outlined\"> pause </span>\r\n </button>\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording('')\">\r\n <span class=\"material-symbols-outlined\"> play_arrow </span>\r\n </button>\r\n </div>\r\n </div>\r\n <button class=\"call-btn-wrapper reject-btn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\r\n </button>\r\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand \"> \r\n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\r\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\r\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\r\n </div>\r\n <div class=\"text-center\">\r\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\r\n </div>\r\n <div class=\"f-13\">\r\n <div class=\"row mb-3\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Subject:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\r\n </div> \r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Email:</div>\r\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\r\n </div> \r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Number:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\r\n </div>\r\n <div class=\"col-6\">\r\n <div class=\"\">Language:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Extension:</div>\r\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mb-3\">\r\n <div class=\"col-12 d-flex align-items-center mb-2\">\r\n <div class=\"me-2\">Image:</div>\r\n <div class=\"text-ellipsis\">\r\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\r\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\r\n </ng-container>\r\n <ng-template #noImage>\r\n <span class=\"ml-2\">No Image Available</span>\r\n </ng-template>\r\n </div>\r\n </div> \r\n </div>\r\n\r\n <div class=\" mb-4\">\r\n <div class=\"\">\r\n <div class=\"\">Message:</div>\r\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mb-2\">\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Point Name:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\r\n </div>\r\n <div class=\"col-6 mb-2\">\r\n <div class=\"\">Source Name:</div>\r\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"call-action-btns mt-0\">\r\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.isCallConnected\">\r\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\r\n </button>\r\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.isCallConnected\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n </button>\r\n <button class=\"call-btn reject-btn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wave-container\">\r\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\r\n <defs>\r\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n</div>\r\n\r\n\r\n", styles: [".call-container{width:752px!important;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:400px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:395px!important}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
|
|
1837
|
+
args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%; left: 116px;\" *ngIf=\"newIncomingCallsList?.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\" >\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\"> \n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"data?.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data?.userInfo?.displayNum ? data?.userInfo?.c2cInformation?.number : data?.userInfo?.c2cInformation?.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" *ngIf=\"!data?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.isCallConnected\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic</span>\n </button>\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording('')\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button> \n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording('')\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand \"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.isCallConnected\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:752px!important;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:400px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:395px!important}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
|
|
836
1838
|
}], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }, { type: NotificationService }]; }, propDecorators: { incomingCallData: [{
|
|
837
1839
|
type: Input
|
|
838
1840
|
}], newIncomingCallsList: [{
|
|
@@ -866,6 +1868,7 @@ class CallProgressComponent {
|
|
|
866
1868
|
this.isCollops = false;
|
|
867
1869
|
// Incoming call variables
|
|
868
1870
|
this.incomingCallDiv = false;
|
|
1871
|
+
//@Output() showCallProgressEvent: EventEmitter<void> = new EventEmitter<void>();
|
|
869
1872
|
this.incomingCallInitiated = new EventEmitter();
|
|
870
1873
|
this.isRecording = false;
|
|
871
1874
|
this.isPaused = false;
|
|
@@ -911,7 +1914,10 @@ class CallProgressComponent {
|
|
|
911
1914
|
}
|
|
912
1915
|
}
|
|
913
1916
|
ngAfterViewInit() {
|
|
914
|
-
//
|
|
1917
|
+
// this.isRecording = false;
|
|
1918
|
+
// setTimeout(() => {
|
|
1919
|
+
// this.isRecording = false;
|
|
1920
|
+
// }, 3000);
|
|
915
1921
|
}
|
|
916
1922
|
startCall(callData) {
|
|
917
1923
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1007,314 +2013,1512 @@ class CallProgressComponent {
|
|
|
1007
2013
|
(_f = this.call) === null || _f === void 0 ? void 0 : _f.on('accept', () => {
|
|
1008
2014
|
this.showRingAnimation = false;
|
|
1009
2015
|
this.disbaleEndCallBtn = false;
|
|
2016
|
+
// Start recording if recordCall is true and call is accepted for 30 seconds
|
|
2017
|
+
// if (this.recordCall) {
|
|
2018
|
+
// setTimeout(() => {
|
|
2019
|
+
// if (this.isRecording) return; // If already recording, skip
|
|
2020
|
+
// this.startRecording();
|
|
2021
|
+
// }, 30000);
|
|
2022
|
+
// } else {
|
|
2023
|
+
// this.stopRecording();
|
|
2024
|
+
// }
|
|
2025
|
+
});
|
|
2026
|
+
(_g = this.call) === null || _g === void 0 ? void 0 : _g.on('messageReceived', (message) => {
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
2029
|
+
startTimer() {
|
|
2030
|
+
let seconds = 0;
|
|
2031
|
+
this.intervalId = setInterval(() => {
|
|
2032
|
+
seconds++;
|
|
2033
|
+
this.timer = this.formatTime(seconds);
|
|
2034
|
+
}, 1000);
|
|
2035
|
+
}
|
|
2036
|
+
stopTimer() {
|
|
2037
|
+
clearInterval(this.intervalId);
|
|
2038
|
+
this.timer = '00:00';
|
|
2039
|
+
}
|
|
2040
|
+
formatTime(totalSeconds) {
|
|
2041
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
2042
|
+
const seconds = totalSeconds % 60;
|
|
2043
|
+
return `${this.pad(minutes)}:${this.pad(seconds)}`;
|
|
2044
|
+
}
|
|
2045
|
+
pad(value) {
|
|
2046
|
+
return value < 10 ? `0${value}` : `${value}`;
|
|
2047
|
+
}
|
|
2048
|
+
handleError(error) {
|
|
2049
|
+
swal("Error", error, "error");
|
|
2050
|
+
}
|
|
2051
|
+
endCall() {
|
|
2052
|
+
this.endCallEvent.emit();
|
|
2053
|
+
if (this.call) {
|
|
2054
|
+
this.call.disconnect();
|
|
2055
|
+
}
|
|
2056
|
+
this.showRingAnimation = false;
|
|
2057
|
+
this.stopTimer();
|
|
2058
|
+
this.maximiseDialpad();
|
|
2059
|
+
}
|
|
2060
|
+
toggleMute() {
|
|
2061
|
+
var _a;
|
|
2062
|
+
this.isMute = !this.isMute;
|
|
2063
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.mute(this.isMute);
|
|
2064
|
+
}
|
|
2065
|
+
toggleKeypad() {
|
|
2066
|
+
this.showKeypad = !this.showKeypad;
|
|
2067
|
+
this.callInput = '';
|
|
2068
|
+
}
|
|
2069
|
+
onCallInputs(num) {
|
|
2070
|
+
var _a;
|
|
2071
|
+
try {
|
|
2072
|
+
if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
|
|
2073
|
+
if (num == '#') {
|
|
2074
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
|
|
2075
|
+
}
|
|
2076
|
+
else if (num == '*') {
|
|
2077
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
|
|
2078
|
+
}
|
|
2079
|
+
else {
|
|
2080
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
|
|
2081
|
+
}
|
|
2082
|
+
this.callInput = this.callInput + String(num);
|
|
2083
|
+
this.showClearBtn = true;
|
|
2084
|
+
}
|
|
2085
|
+
let str = String(num);
|
|
2086
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(str);
|
|
2087
|
+
}
|
|
2088
|
+
catch (e) {
|
|
2089
|
+
console.log(e);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
onCallInputEnter(ev) {
|
|
2093
|
+
var _a;
|
|
2094
|
+
try {
|
|
2095
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(String(ev.key));
|
|
2096
|
+
}
|
|
2097
|
+
catch (e) {
|
|
2098
|
+
console.log(e);
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
closeIncomingCall(data) {
|
|
2102
|
+
// this.incomingCallDiv = false;
|
|
2103
|
+
if (data.show) {
|
|
2104
|
+
//this.showCallProgressEvent.emit()
|
|
2105
|
+
// handle incoming call accepted
|
|
2106
|
+
this.startTimer();
|
|
2107
|
+
this.disbaleEndCallBtn = false;
|
|
2108
|
+
this.call = data.call;
|
|
2109
|
+
const incomingDetail = this.extensionService.getCallSid();
|
|
2110
|
+
this.incomingRecordCall = incomingDetail.recordCall;
|
|
2111
|
+
// Start recording if the call is answered and recording is enabled
|
|
2112
|
+
if (this.incomingRecordCall) {
|
|
2113
|
+
this.startRecording();
|
|
2114
|
+
}
|
|
2115
|
+
else {
|
|
2116
|
+
this.isRecording = false;
|
|
2117
|
+
}
|
|
2118
|
+
this.cdr.detectChanges();
|
|
2119
|
+
}
|
|
2120
|
+
else {
|
|
2121
|
+
// incoming call rejected
|
|
2122
|
+
this.endCallEvent.emit();
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
clearInputs() {
|
|
2126
|
+
this.callInput = this.callInput.slice(0, -1);
|
|
2127
|
+
}
|
|
2128
|
+
minimiseDialpad() {
|
|
2129
|
+
this.minimiseEvent.emit(true);
|
|
2130
|
+
this.isMinimised = true;
|
|
2131
|
+
}
|
|
2132
|
+
maximiseDialpad() {
|
|
2133
|
+
this.minimiseEvent.emit(false);
|
|
2134
|
+
this.isMinimised = false;
|
|
2135
|
+
}
|
|
2136
|
+
toggleRecording() {
|
|
2137
|
+
if (this.isRecording) {
|
|
2138
|
+
this.stopRecording();
|
|
2139
|
+
}
|
|
2140
|
+
else {
|
|
2141
|
+
this.startRecording();
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
startRecording() {
|
|
2145
|
+
let sid;
|
|
2146
|
+
const details = this.extensionService.getCallSid();
|
|
2147
|
+
this.incomingCallSid = details.callSid;
|
|
2148
|
+
this.incomingRecordCall = details.recordCall;
|
|
2149
|
+
sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2150
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2151
|
+
// return;
|
|
2152
|
+
// }
|
|
2153
|
+
this.extensionService.getCallRecording(sid).subscribe(response => {
|
|
2154
|
+
this.isRecording = true;
|
|
2155
|
+
this.isPaused = false;
|
|
2156
|
+
this.timeElapsed = 0;
|
|
2157
|
+
this.startTimer1();
|
|
2158
|
+
}, error => {
|
|
2159
|
+
console.error('Error starting recording', error);
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
stopRecording() {
|
|
2163
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2164
|
+
// return;
|
|
2165
|
+
// }
|
|
2166
|
+
this.isRecording = false;
|
|
2167
|
+
this.isPaused = false;
|
|
2168
|
+
if (this.timerSubscription) {
|
|
2169
|
+
this.timerSubscription.unsubscribe();
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
pauseRecording() {
|
|
2173
|
+
const details = this.extensionService.getCallSid();
|
|
2174
|
+
this.incomingCallSid = details.callSid;
|
|
2175
|
+
this.incomingRecordCall = details.recordCall;
|
|
2176
|
+
const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2177
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2178
|
+
// return;
|
|
2179
|
+
// }
|
|
2180
|
+
this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
|
|
2181
|
+
this.stopRecordingTimer();
|
|
2182
|
+
this.isPaused = true;
|
|
2183
|
+
}, error => {
|
|
2184
|
+
console.error('Error pausing recording:', error);
|
|
2185
|
+
// Consider updating the UI to show the error state
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
resumeRecording() {
|
|
2189
|
+
let sid;
|
|
2190
|
+
const details = this.extensionService.getCallSid();
|
|
2191
|
+
this.incomingCallSid = details.callSid;
|
|
2192
|
+
this.incomingRecordCall = details.recordCall;
|
|
2193
|
+
sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
2194
|
+
// if (!this.incomingRecordCall && !this.recordCall) {
|
|
2195
|
+
// return; // Skip if recording is not enabled
|
|
2196
|
+
// }
|
|
2197
|
+
this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
|
|
2198
|
+
this.isPaused = false;
|
|
2199
|
+
this.startTimer1();
|
|
2200
|
+
}, error => {
|
|
2201
|
+
console.error('Error resuming recording', error);
|
|
1010
2202
|
});
|
|
1011
|
-
|
|
2203
|
+
}
|
|
2204
|
+
startTimer1() {
|
|
2205
|
+
this.timerSubscription = interval(1000).subscribe(() => {
|
|
2206
|
+
this.timeElapsed++;
|
|
1012
2207
|
});
|
|
1013
2208
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
}, 1000);
|
|
2209
|
+
stopRecordingTimer() {
|
|
2210
|
+
if (this.timerSubscription) {
|
|
2211
|
+
this.timerSubscription.unsubscribe(); // Pause the timer
|
|
2212
|
+
this.timerSubscription = undefined; // Optionally reset the subscription
|
|
2213
|
+
}
|
|
1020
2214
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
this.
|
|
2215
|
+
getFormattedTime() {
|
|
2216
|
+
const minutes = Math.floor(this.timeElapsed / 60);
|
|
2217
|
+
const seconds = this.timeElapsed % 60;
|
|
2218
|
+
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
1024
2219
|
}
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
const
|
|
1028
|
-
|
|
2220
|
+
pollCallStatus(callAuthId) {
|
|
2221
|
+
const maxTime = 30000; // Poll for up to 30 seconds
|
|
2222
|
+
const pollInterval = 3000; // Poll every 3 seconds
|
|
2223
|
+
let elapsedTime = 0;
|
|
2224
|
+
const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
2225
|
+
elapsedTime += pollInterval;
|
|
2226
|
+
try {
|
|
2227
|
+
const statusResponse = yield this.extensionService.getCallStatus(callAuthId).toPromise();
|
|
2228
|
+
if (statusResponse && statusResponse.callDetails) {
|
|
2229
|
+
this.callStatus = statusResponse.callDetails.callStatus;
|
|
2230
|
+
if (this.callStatus === 'in-progress') {
|
|
2231
|
+
this.callSid = statusResponse.callDetails.callSid;
|
|
2232
|
+
if (this.recordCall && !this.isRecording) {
|
|
2233
|
+
this.startRecording();
|
|
2234
|
+
}
|
|
2235
|
+
clearInterval(intervalId);
|
|
2236
|
+
}
|
|
2237
|
+
else if (this.callStatus === 'completed') {
|
|
2238
|
+
clearInterval(intervalId);
|
|
2239
|
+
this.endCall();
|
|
2240
|
+
this.stopRecording();
|
|
2241
|
+
}
|
|
2242
|
+
else if (this.callStatus === 'ringing') {
|
|
2243
|
+
// Continue polling; do not clear the interval yet
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
catch (error) {
|
|
2248
|
+
clearInterval(intervalId);
|
|
2249
|
+
}
|
|
2250
|
+
if (elapsedTime >= maxTime) {
|
|
2251
|
+
// console.log('Max polling time reached. Stopping poll.');
|
|
2252
|
+
clearInterval(intervalId);
|
|
2253
|
+
}
|
|
2254
|
+
}), pollInterval);
|
|
1029
2255
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
2256
|
+
getUserInformation(id) {
|
|
2257
|
+
this.extensionService.getUserInformation(id).subscribe(response => {
|
|
2258
|
+
console.log(response);
|
|
2259
|
+
}, error => {
|
|
2260
|
+
console.error('Error starting recording', error);
|
|
2261
|
+
});
|
|
1032
2262
|
}
|
|
1033
|
-
|
|
1034
|
-
|
|
2263
|
+
incomingCallsNewList(data) {
|
|
2264
|
+
this.newIncomingCallsList = data;
|
|
2265
|
+
this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
1035
2266
|
}
|
|
1036
|
-
|
|
1037
|
-
this.
|
|
1038
|
-
|
|
1039
|
-
|
|
2267
|
+
selectedIncomingCallInfo(data) {
|
|
2268
|
+
this.selectedIncomingCall = data;
|
|
2269
|
+
}
|
|
2270
|
+
ngOnDestroy() {
|
|
2271
|
+
this.callData.dial = false;
|
|
2272
|
+
if (this.timerSubscription) {
|
|
2273
|
+
this.timerSubscription.unsubscribe();
|
|
1040
2274
|
}
|
|
1041
|
-
this.showRingAnimation = false;
|
|
1042
|
-
this.stopTimer();
|
|
1043
|
-
this.maximiseDialpad();
|
|
1044
2275
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
this.isMute = !this.isMute;
|
|
1048
|
-
|
|
2276
|
+
}
|
|
2277
|
+
CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2278
|
+
CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList", deviceId: "deviceId" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand }\">\n <!-- <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div> -->\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [deviceId]=\"deviceId\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div [ngStyle]=\"{'display': 'flex', 'flex-direction': 'column', 'position': 'relative', 'width': '100%', 'left': callData?.isIncomingCall ? '100px' : '0'}\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button> \n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : ' '}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: ["incomingCallData", "newIncomingCallsList", "deviceId"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
|
|
2279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
|
|
2280
|
+
type: Component,
|
|
2281
|
+
args: [{ selector: 'lib-call-progress', template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand }\">\n <!-- <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div> -->\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [deviceId]=\"deviceId\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div [ngStyle]=\"{'display': 'flex', 'flex-direction': 'column', 'position': 'relative', 'width': '100%', 'left': callData?.isIncomingCall ? '100px' : '0'}\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button> \n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : ' '}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
|
|
2282
|
+
}], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
|
|
2283
|
+
type: Input
|
|
2284
|
+
}], newIncomingCallData: [{
|
|
2285
|
+
type: Input
|
|
2286
|
+
}], newIncomingCallsList: [{
|
|
2287
|
+
type: Input
|
|
2288
|
+
}], deviceId: [{
|
|
2289
|
+
type: Input
|
|
2290
|
+
}], endCallEvent: [{
|
|
2291
|
+
type: Output
|
|
2292
|
+
}], incomingCallsNewInfo: [{
|
|
2293
|
+
type: Output
|
|
2294
|
+
}], minimiseEvent: [{
|
|
2295
|
+
type: Output
|
|
2296
|
+
}], incomingCallInitiated: [{
|
|
2297
|
+
type: Output
|
|
2298
|
+
}] } });
|
|
2299
|
+
|
|
2300
|
+
class DialboxComponent {
|
|
2301
|
+
set isDialpadHidden(value) {
|
|
2302
|
+
this._isDialpadHidden = value;
|
|
2303
|
+
if (!value) {
|
|
2304
|
+
// When dialpad becomes visible, ensure Twilio is initialized
|
|
2305
|
+
this.initializeTwilio();
|
|
2306
|
+
}
|
|
1049
2307
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
this.callInput = '';
|
|
2308
|
+
get isDialpadHidden() {
|
|
2309
|
+
return this._isDialpadHidden;
|
|
1053
2310
|
}
|
|
1054
|
-
|
|
1055
|
-
|
|
2311
|
+
constructor(twilioService, extService, dialog, ipService, extensionService, cdk, router) {
|
|
2312
|
+
this.twilioService = twilioService;
|
|
2313
|
+
this.extService = extService;
|
|
2314
|
+
this.dialog = dialog;
|
|
2315
|
+
this.ipService = ipService;
|
|
2316
|
+
this.extensionService = extensionService;
|
|
2317
|
+
this.cdk = cdk;
|
|
2318
|
+
this.router = router;
|
|
2319
|
+
this._isDialpadHidden = true;
|
|
2320
|
+
// Let the library decide to auto-open on incoming call without host wiring
|
|
2321
|
+
this.autoOpenOnIncoming = true;
|
|
2322
|
+
this.closeDialpadEvent = new EventEmitter();
|
|
2323
|
+
this.callInitiated = new EventEmitter();
|
|
2324
|
+
this.endCallEvent = new EventEmitter();
|
|
2325
|
+
this.minimiseEvent = new EventEmitter();
|
|
2326
|
+
this.incomingCallsNewInfoEvent = new EventEmitter();
|
|
2327
|
+
this.incomingCallInitiated = new EventEmitter();
|
|
2328
|
+
this.numberDialed = new EventEmitter();
|
|
2329
|
+
this.isCallInProgress = false;
|
|
2330
|
+
this.keypadVal = keypad;
|
|
2331
|
+
this.showInputClearBtn = false;
|
|
2332
|
+
this.dialedNumber = '';
|
|
2333
|
+
this.contactList = [];
|
|
2334
|
+
this.filteredContactList = [];
|
|
2335
|
+
this.callerIdList = [];
|
|
2336
|
+
this.isCallerIdHidden = true;
|
|
2337
|
+
this.isTrialPeriodOver = false;
|
|
2338
|
+
this.isPaymentDue = false;
|
|
2339
|
+
this.terminateCall = false;
|
|
2340
|
+
this.toastTimeout = 7000;
|
|
2341
|
+
this.callNumberToast = {
|
|
2342
|
+
show: false,
|
|
2343
|
+
type: 'alert-success',
|
|
2344
|
+
number: '',
|
|
2345
|
+
displayNum: ''
|
|
2346
|
+
};
|
|
2347
|
+
this.callData = {
|
|
2348
|
+
phone: '',
|
|
2349
|
+
displayNum: '',
|
|
2350
|
+
dial: false,
|
|
2351
|
+
name: '',
|
|
2352
|
+
img: 'assets/images/user.jpg',
|
|
2353
|
+
isIncomingCall: false,
|
|
2354
|
+
extNum: ''
|
|
2355
|
+
};
|
|
2356
|
+
this.lastDialed = null;
|
|
2357
|
+
this.dialAlert = {
|
|
2358
|
+
msg: '',
|
|
2359
|
+
show: false
|
|
2360
|
+
};
|
|
2361
|
+
this.showDedicatedPopup = false;
|
|
2362
|
+
this.newIncomingCalls = [];
|
|
2363
|
+
this.incomingCallsList = [];
|
|
2364
|
+
this.subscriptions = new Subscription();
|
|
2365
|
+
this.shakeDedicatedBtn = false;
|
|
2366
|
+
this.isSmartDialCall = false;
|
|
2367
|
+
this.isInitialized = false;
|
|
2368
|
+
this.isMinimised = false;
|
|
2369
|
+
// Initialize if dialpad is visible by default
|
|
2370
|
+
if (!this.isDialpadHidden) {
|
|
2371
|
+
console.log('sfsdfdsf');
|
|
2372
|
+
this.initializeTwilio();
|
|
2373
|
+
}
|
|
2374
|
+
console.log('DialboxComponent constructor');
|
|
2375
|
+
}
|
|
2376
|
+
initializeTwilio() {
|
|
2377
|
+
console.log('initializeTwilio');
|
|
2378
|
+
if (!this.isInitialized) {
|
|
2379
|
+
this.token = localStorage.getItem('ext_token') || '';
|
|
2380
|
+
if (!this.token) {
|
|
2381
|
+
console.error('No authentication token found');
|
|
2382
|
+
return;
|
|
2383
|
+
}
|
|
2384
|
+
this.isInitialized = true;
|
|
2385
|
+
// Initialize Twilio service
|
|
2386
|
+
this.twilioService.initializeTwilioDevice(this.deviceId);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
// ngOnChange() {
|
|
2390
|
+
// this.initializeTwilio();
|
|
2391
|
+
// }
|
|
2392
|
+
// ngOnInit() {
|
|
2393
|
+
// try {
|
|
2394
|
+
// this.getContactList();
|
|
2395
|
+
// this.getUserCallSetting();
|
|
2396
|
+
// // Subscribe to dial number events
|
|
2397
|
+
// const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact: any) => {
|
|
2398
|
+
// if (contact.number) {
|
|
2399
|
+
// this.isSmartDialCall = false;
|
|
2400
|
+
// if (contact.isDialFromHistory) {
|
|
2401
|
+
// //handle dialing from history page
|
|
2402
|
+
// if(contact.callerId == 'smartDialing'){
|
|
2403
|
+
// this.selectedCallerId = { number: contact.from };
|
|
2404
|
+
// this.isSmartDialCall = true;
|
|
2405
|
+
// setTimeout(() => {
|
|
2406
|
+
// this.isDialpadHidden = false;
|
|
2407
|
+
// }, 2000);
|
|
2408
|
+
// this.callData.phone = contact.number;
|
|
2409
|
+
// this.callData.name = contact.name;
|
|
2410
|
+
// this.callData.img = contact.img;
|
|
2411
|
+
// this.callData.from = contact.from;
|
|
2412
|
+
// this.sanitizedNum = contact.number;
|
|
2413
|
+
// this.getUserInformation(contact);
|
|
2414
|
+
// // this.incomingCallsList.push(contact)
|
|
2415
|
+
// this.initiateCall();
|
|
2416
|
+
// }else{
|
|
2417
|
+
// this.getUserCallSetting();
|
|
2418
|
+
// setTimeout(() => {
|
|
2419
|
+
// this.isDialpadHidden = false;
|
|
2420
|
+
// }, 1000);
|
|
2421
|
+
// this.getUserInformation(contact);
|
|
2422
|
+
// // this.incomingCallsList.push(contact)
|
|
2423
|
+
// this.dialedNumber = contact.number;
|
|
2424
|
+
// this.sanitizedNum = contact.number;
|
|
2425
|
+
// }
|
|
2426
|
+
// } else {
|
|
2427
|
+
// if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
|
|
2428
|
+
// this.getUserCallSetting();
|
|
2429
|
+
// setTimeout(() => {
|
|
2430
|
+
// this.isDialpadHidden = false;
|
|
2431
|
+
// }, 1000);
|
|
2432
|
+
// this.dialedNumber = contact.number;
|
|
2433
|
+
// this.sanitizedNum = contact.number;
|
|
2434
|
+
// } else {
|
|
2435
|
+
// setTimeout(() => {
|
|
2436
|
+
// this.isDialpadHidden = false;
|
|
2437
|
+
// }, 2000);
|
|
2438
|
+
// this.callData.phone = contact.number;
|
|
2439
|
+
// this.callData.name = contact.name;
|
|
2440
|
+
// this.callData.img = contact.img;
|
|
2441
|
+
// this.sanitizedNum = contact.number;
|
|
2442
|
+
// this.initiateCall();
|
|
2443
|
+
// }
|
|
2444
|
+
// }
|
|
2445
|
+
// }
|
|
2446
|
+
// })
|
|
2447
|
+
// // handle incoming call
|
|
2448
|
+
// const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
|
|
2449
|
+
// // if (incomingCallData) {
|
|
2450
|
+
// // this.isCallInProgress = true;
|
|
2451
|
+
// // this.isDialpadHidden = false;
|
|
2452
|
+
// // this.callData.phone = incomingCallData.parameters.From;
|
|
2453
|
+
// // this.callData.name = incomingCallData.customParameters.get('name');
|
|
2454
|
+
// // this.callData.img = incomingCallData.customParameters.get('image');
|
|
2455
|
+
// // this.callData.isIncomingCall = true;
|
|
2456
|
+
// // }
|
|
2457
|
+
// if (incomingCallData) {
|
|
2458
|
+
// if (this.isCallInProgress) {
|
|
2459
|
+
// this.newIncomingCalls.push(incomingCallData);
|
|
2460
|
+
// this.getUserInformation(incomingCallData);
|
|
2461
|
+
// } else {
|
|
2462
|
+
// this.isCallInProgress = true;
|
|
2463
|
+
// this.isDialpadHidden = false;
|
|
2464
|
+
// this.callData.phone = incomingCallData.parameters['From'];
|
|
2465
|
+
// this.getUserInformation(incomingCallData);
|
|
2466
|
+
// this.callData.name = incomingCallData.customParameters.get('name');
|
|
2467
|
+
// this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2468
|
+
// this.callData.isIncomingCall = true;
|
|
2469
|
+
// }
|
|
2470
|
+
// incomingCallData.on('cancel', () => {
|
|
2471
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
|
|
2472
|
+
// if(this.incomingCallsList.length == 0){
|
|
2473
|
+
// this.isCallInProgress = false;
|
|
2474
|
+
// }
|
|
2475
|
+
// });
|
|
2476
|
+
// incomingCallData.on('disconnect', () => {
|
|
2477
|
+
// this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
|
|
2478
|
+
// if(this.incomingCallsList.length == 0){
|
|
2479
|
+
// this.isCallInProgress = false;
|
|
2480
|
+
// }
|
|
2481
|
+
// });
|
|
2482
|
+
// }
|
|
2483
|
+
// });
|
|
2484
|
+
// this.subscriptions.add(sub1);
|
|
2485
|
+
// this.subscriptions.add(sub2);
|
|
2486
|
+
// }catch(e){
|
|
2487
|
+
// console.log(e)
|
|
2488
|
+
// }
|
|
2489
|
+
// }
|
|
2490
|
+
ngOnInit() {
|
|
2491
|
+
console.log('ngOnInit');
|
|
2492
|
+
// Ensure Twilio is initialized even when dialpad starts hidden,
|
|
2493
|
+
// so we can auto-open on incoming calls.
|
|
2494
|
+
this.initializeTwilio();
|
|
1056
2495
|
try {
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
2496
|
+
this.token = localStorage.getItem('ext_token') || '';
|
|
2497
|
+
//this.isCallInProgress = true;
|
|
2498
|
+
this.getContactList();
|
|
2499
|
+
this.getUserCallSetting();
|
|
2500
|
+
const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
|
|
2501
|
+
if (contact.number) {
|
|
2502
|
+
this.isSmartDialCall = false;
|
|
2503
|
+
if (contact.isDialFromHistory) {
|
|
2504
|
+
//handle dialing from history page
|
|
2505
|
+
if (contact.callerId == 'smartDialing') {
|
|
2506
|
+
this.selectedCallerId = { number: contact.from };
|
|
2507
|
+
this.isSmartDialCall = true;
|
|
2508
|
+
setTimeout(() => {
|
|
2509
|
+
this.isDialpadHidden = false;
|
|
2510
|
+
}, 2000);
|
|
2511
|
+
this.callData.phone = contact.number;
|
|
2512
|
+
this.callData.name = contact.name;
|
|
2513
|
+
this.callData.img = contact.img;
|
|
2514
|
+
this.callData.from = contact.from;
|
|
2515
|
+
this.sanitizedNum = contact.number;
|
|
2516
|
+
console.log('274', contact);
|
|
2517
|
+
this.getUserInformation(contact);
|
|
2518
|
+
// this.incomingCallsList.push(contact)
|
|
2519
|
+
this.initiateCall();
|
|
2520
|
+
}
|
|
2521
|
+
else {
|
|
2522
|
+
this.getUserCallSetting();
|
|
2523
|
+
setTimeout(() => {
|
|
2524
|
+
this.isDialpadHidden = false;
|
|
2525
|
+
}, 1000);
|
|
2526
|
+
console.log('282', contact);
|
|
2527
|
+
this.getUserInformation(contact);
|
|
2528
|
+
// this.incomingCallsList.push(contact)
|
|
2529
|
+
this.dialedNumber = contact.number;
|
|
2530
|
+
this.sanitizedNum = contact.number;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
else {
|
|
2534
|
+
if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
|
|
2535
|
+
this.getUserCallSetting();
|
|
2536
|
+
setTimeout(() => {
|
|
2537
|
+
this.isDialpadHidden = false;
|
|
2538
|
+
}, 1000);
|
|
2539
|
+
this.dialedNumber = contact.number;
|
|
2540
|
+
this.sanitizedNum = contact.number;
|
|
2541
|
+
}
|
|
2542
|
+
else {
|
|
2543
|
+
setTimeout(() => {
|
|
2544
|
+
this.isDialpadHidden = false;
|
|
2545
|
+
}, 2000);
|
|
2546
|
+
this.callData.phone = contact.number;
|
|
2547
|
+
this.callData.name = contact.name;
|
|
2548
|
+
this.callData.img = contact.img;
|
|
2549
|
+
this.sanitizedNum = contact.number;
|
|
2550
|
+
this.initiateCall();
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
1060
2553
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
2554
|
+
});
|
|
2555
|
+
// handle incoming call (managed internally; host need not pass incomingCallData)
|
|
2556
|
+
const sub2 = this.twilioService.currentCall.subscribe((incomingCallData) => {
|
|
2557
|
+
// if (incomingCallData) {
|
|
2558
|
+
// this.isCallInProgress = true;
|
|
2559
|
+
// this.isDialpadHidden = false;
|
|
2560
|
+
// this.callData.phone = incomingCallData.parameters.From;
|
|
2561
|
+
// this.callData.name = incomingCallData.customParameters.get('name');
|
|
2562
|
+
// this.callData.img = incomingCallData.customParameters.get('image');
|
|
2563
|
+
// this.callData.isIncomingCall = true;
|
|
2564
|
+
// }
|
|
2565
|
+
if (incomingCallData) {
|
|
2566
|
+
if (this.autoOpenOnIncoming && this._isDialpadHidden) {
|
|
2567
|
+
this._isDialpadHidden = false;
|
|
2568
|
+
}
|
|
2569
|
+
if (this.isCallInProgress) {
|
|
2570
|
+
this.newIncomingCalls.push(incomingCallData);
|
|
2571
|
+
console.log('325', incomingCallData);
|
|
2572
|
+
this.getUserInformation(incomingCallData);
|
|
2573
|
+
}
|
|
2574
|
+
else {
|
|
2575
|
+
incomingCallData['isFirstCall'] = true;
|
|
2576
|
+
this.isCallInProgress = true;
|
|
2577
|
+
this.isDialpadHidden = false;
|
|
2578
|
+
this.callData.phone = incomingCallData.parameters['From'];
|
|
2579
|
+
console.log('332', incomingCallData);
|
|
2580
|
+
this.getUserInformation(incomingCallData);
|
|
2581
|
+
this.callData.name = incomingCallData.customParameters.get('name');
|
|
2582
|
+
this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2583
|
+
this.callData.isIncomingCall = true;
|
|
2584
|
+
}
|
|
2585
|
+
incomingCallData.on('cancel', () => {
|
|
2586
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
2587
|
+
if (this.incomingCallsList.length == 0) {
|
|
2588
|
+
this.isCallInProgress = false;
|
|
2589
|
+
}
|
|
2590
|
+
});
|
|
2591
|
+
incomingCallData.on('disconnect', () => {
|
|
2592
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
|
|
2593
|
+
if (this.incomingCallsList.length == 0) {
|
|
2594
|
+
this.isCallInProgress = false;
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
});
|
|
2599
|
+
this.subscriptions.add(sub1);
|
|
2600
|
+
this.subscriptions.add(sub2);
|
|
2601
|
+
}
|
|
2602
|
+
catch (e) {
|
|
2603
|
+
console.log(e);
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
getUserInformation(incomingCallData) {
|
|
2607
|
+
// console.log('getUserInformation', incomingCallData);
|
|
2608
|
+
let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
|
|
2609
|
+
console.log('366---', data);
|
|
2610
|
+
this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
|
|
2611
|
+
incomingCallData['userInfo'] = response;
|
|
2612
|
+
const alreadyExists = this.incomingCallsList.some((call) => { var _a, _b; return ((_a = call.parameters) === null || _a === void 0 ? void 0 : _a.CallSid) === ((_b = incomingCallData.parameters) === null || _b === void 0 ? void 0 : _b.CallSid); });
|
|
2613
|
+
if (!alreadyExists) {
|
|
2614
|
+
this.incomingCallsList.push(incomingCallData);
|
|
2615
|
+
}
|
|
2616
|
+
this.cdk.detectChanges();
|
|
2617
|
+
}, error => {
|
|
2618
|
+
console.error('Error starting recording', error);
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
fromEntries(entries) {
|
|
2622
|
+
return entries.reduce((acc, [key, value]) => {
|
|
2623
|
+
acc[key] = value;
|
|
2624
|
+
return acc;
|
|
2625
|
+
}, {});
|
|
2626
|
+
}
|
|
2627
|
+
ngAfterViewInit() {
|
|
2628
|
+
this.registerDragElement();
|
|
2629
|
+
}
|
|
2630
|
+
ngOnChanges(changes) {
|
|
2631
|
+
if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
|
|
2632
|
+
this.getContactList();
|
|
2633
|
+
this.getUserCallSetting();
|
|
2634
|
+
setTimeout(() => {
|
|
2635
|
+
this.dialInputElement.nativeElement.focus();
|
|
2636
|
+
}, 0);
|
|
2637
|
+
if (this.incomingCallData) {
|
|
2638
|
+
if (this.isCallInProgress) {
|
|
2639
|
+
this.newIncomingCalls.push(this.incomingCallData);
|
|
2640
|
+
console.log('404', this.incomingCallData);
|
|
2641
|
+
this.getUserInformation(this.incomingCallData);
|
|
1063
2642
|
}
|
|
1064
2643
|
else {
|
|
1065
|
-
|
|
2644
|
+
this.isCallInProgress = true;
|
|
2645
|
+
this.isDialpadHidden = false;
|
|
2646
|
+
this.callData.phone = this.incomingCallData.parameters['From'];
|
|
2647
|
+
console.log('411', this.incomingCallData);
|
|
2648
|
+
this.getUserInformation(this.incomingCallData);
|
|
2649
|
+
this.callData.name = this.incomingCallData.customParameters.get('name');
|
|
2650
|
+
this.callData.img = this.incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
|
|
2651
|
+
this.callData.isIncomingCall = true;
|
|
1066
2652
|
}
|
|
1067
|
-
this.
|
|
1068
|
-
|
|
2653
|
+
this.incomingCallData.on('cancel', () => {
|
|
2654
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2655
|
+
if (this.incomingCallsList.length == 0) {
|
|
2656
|
+
this.isCallInProgress = false;
|
|
2657
|
+
}
|
|
2658
|
+
this.incomingCallData.disconnect();
|
|
2659
|
+
});
|
|
2660
|
+
this.incomingCallData.on('disconnect', () => {
|
|
2661
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
|
|
2662
|
+
this.incomingCallData.disconnect();
|
|
2663
|
+
if (this.incomingCallsList.length == 0) {
|
|
2664
|
+
this.isCallInProgress = false;
|
|
2665
|
+
}
|
|
2666
|
+
});
|
|
1069
2667
|
}
|
|
1070
|
-
let str = String(num);
|
|
1071
|
-
(_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(str);
|
|
1072
2668
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
2669
|
+
if (changes['contactInfo'] && this.contactInfo) {
|
|
2670
|
+
let contact = this.contactInfo;
|
|
2671
|
+
if (contact.number) {
|
|
2672
|
+
this.isSmartDialCall = false;
|
|
2673
|
+
if (contact.isDialFromHistory) {
|
|
2674
|
+
//handle dialing from history page
|
|
2675
|
+
if (contact.callerId == 'smartDialing') {
|
|
2676
|
+
this.selectedCallerId = { number: contact.from };
|
|
2677
|
+
this.isSmartDialCall = true;
|
|
2678
|
+
setTimeout(() => {
|
|
2679
|
+
this.isDialpadHidden = false;
|
|
2680
|
+
}, 2000);
|
|
2681
|
+
this.callData.phone = contact.number;
|
|
2682
|
+
this.callData.name = contact.name;
|
|
2683
|
+
this.callData.img = contact.img;
|
|
2684
|
+
this.callData.from = contact.from;
|
|
2685
|
+
this.sanitizedNum = contact.number;
|
|
2686
|
+
console.log('274', contact);
|
|
2687
|
+
this.getUserInformation(contact);
|
|
2688
|
+
// this.incomingCallsList.push(contact)
|
|
2689
|
+
this.initiateCall();
|
|
2690
|
+
}
|
|
2691
|
+
else {
|
|
2692
|
+
this.getUserCallSetting();
|
|
2693
|
+
setTimeout(() => {
|
|
2694
|
+
this.isDialpadHidden = false;
|
|
2695
|
+
}, 1000);
|
|
2696
|
+
console.log('282', contact);
|
|
2697
|
+
this.getUserInformation(contact);
|
|
2698
|
+
// this.incomingCallsList.push(contact)
|
|
2699
|
+
this.dialedNumber = contact.number;
|
|
2700
|
+
this.sanitizedNum = contact.number;
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
else {
|
|
2704
|
+
if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
|
|
2705
|
+
this.getUserCallSetting();
|
|
2706
|
+
setTimeout(() => {
|
|
2707
|
+
this.isDialpadHidden = false;
|
|
2708
|
+
}, 1000);
|
|
2709
|
+
this.dialedNumber = contact.number;
|
|
2710
|
+
this.sanitizedNum = contact.number;
|
|
2711
|
+
}
|
|
2712
|
+
else {
|
|
2713
|
+
setTimeout(() => {
|
|
2714
|
+
this.isDialpadHidden = false;
|
|
2715
|
+
}, 2000);
|
|
2716
|
+
this.callData.phone = contact.number;
|
|
2717
|
+
this.callData.name = contact.name;
|
|
2718
|
+
this.callData.img = contact.img;
|
|
2719
|
+
this.sanitizedNum = contact.number;
|
|
2720
|
+
this.initiateCall();
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
}
|
|
1075
2724
|
}
|
|
1076
2725
|
}
|
|
1077
|
-
|
|
1078
|
-
var _a;
|
|
2726
|
+
registerDragElement() {
|
|
1079
2727
|
try {
|
|
1080
|
-
|
|
2728
|
+
const elmnt = document.getElementById('dragparent1');
|
|
2729
|
+
if (!elmnt) {
|
|
2730
|
+
console.error('Drag element not found');
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
|
|
2734
|
+
const dragMouseDown = (e) => {
|
|
2735
|
+
const target = e.target;
|
|
2736
|
+
if (target.tagName.toLowerCase() === 'input') {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
e.preventDefault();
|
|
2740
|
+
pos3 = e.clientX;
|
|
2741
|
+
pos4 = e.clientY;
|
|
2742
|
+
const onMouseMove = (moveEvent) => elementDrag(moveEvent);
|
|
2743
|
+
const onMouseUp = () => {
|
|
2744
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
2745
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
2746
|
+
};
|
|
2747
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
2748
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
2749
|
+
};
|
|
2750
|
+
const elementDrag = (e) => {
|
|
2751
|
+
e.preventDefault();
|
|
2752
|
+
pos1 = pos3 - e.clientX;
|
|
2753
|
+
pos2 = pos4 - e.clientY;
|
|
2754
|
+
pos3 = e.clientX;
|
|
2755
|
+
pos4 = e.clientY;
|
|
2756
|
+
elmnt.style.top = (elmnt.offsetTop - pos2) + 'px';
|
|
2757
|
+
elmnt.style.left = (elmnt.offsetLeft - pos1) + 'px';
|
|
2758
|
+
};
|
|
2759
|
+
// Check for header element
|
|
2760
|
+
const header = document.getElementById(elmnt.id + 'header');
|
|
2761
|
+
if (header) {
|
|
2762
|
+
header.onmousedown = dragMouseDown;
|
|
2763
|
+
}
|
|
2764
|
+
else {
|
|
2765
|
+
elmnt.onmousedown = dragMouseDown;
|
|
2766
|
+
}
|
|
1081
2767
|
}
|
|
1082
2768
|
catch (e) {
|
|
1083
2769
|
console.log(e);
|
|
1084
2770
|
}
|
|
1085
2771
|
}
|
|
1086
|
-
|
|
1087
|
-
if (
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
2772
|
+
addNumber(num) {
|
|
2773
|
+
if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
|
|
2774
|
+
if (num == '#') {
|
|
2775
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
|
|
2776
|
+
}
|
|
2777
|
+
else if (num == '*') {
|
|
2778
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
|
|
2779
|
+
}
|
|
2780
|
+
else {
|
|
2781
|
+
new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
|
|
2782
|
+
}
|
|
2783
|
+
this.dialedNumber += num;
|
|
2784
|
+
this.showInputClearBtn = true;
|
|
2785
|
+
this.numberDialed.emit(this.dialedNumber);
|
|
2786
|
+
this.onDialInputChange(this.dialedNumber);
|
|
2787
|
+
// this.dialInputRef.nativeElement.focus();
|
|
2788
|
+
}
|
|
2789
|
+
else if (num === 'voicemail') {
|
|
2790
|
+
// this.showDedicatedPopup = true;
|
|
2791
|
+
this.router.navigate(['extension/voicemail/' + this.token]);
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
hideDialpad() {
|
|
2795
|
+
this.isDialpadHidden = true;
|
|
2796
|
+
this.closeDialpadEvent.emit();
|
|
2797
|
+
this.clearAllDialed();
|
|
2798
|
+
this.filteredContactList = [];
|
|
2799
|
+
}
|
|
2800
|
+
onDialInputChange(inputVal) {
|
|
2801
|
+
try {
|
|
2802
|
+
// Updated regex to include x, X, ext., Ext., and ,
|
|
2803
|
+
const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
|
|
2804
|
+
let mainNumber = inputVal;
|
|
2805
|
+
// Check for extension indicators and split the input
|
|
2806
|
+
const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
|
|
2807
|
+
if (extMatch) {
|
|
2808
|
+
mainNumber = inputVal.substring(0, extMatch.index).trim();
|
|
2809
|
+
this.callData.extNum = extMatch[2].trim();
|
|
2810
|
+
}
|
|
2811
|
+
this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
|
|
2812
|
+
this.callData.phone = isNumericInput ? this.sanitizedNum : '';
|
|
2813
|
+
this.showInputClearBtn = inputVal.length > 0;
|
|
2814
|
+
if (isNumericInput) {
|
|
2815
|
+
this.dialedNumber = new AsYouType().input(this.sanitizedNum);
|
|
2816
|
+
}
|
|
2817
|
+
// emit current number whenever input changes
|
|
2818
|
+
this.numberDialed.emit(this.dialedNumber);
|
|
2819
|
+
if (inputVal.length > 2) {
|
|
2820
|
+
this.filteredContactList = this.contactList.filter(contact => {
|
|
2821
|
+
const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
|
|
2822
|
+
return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some((num) => num.number.includes(this.sanitizedNum));
|
|
2823
|
+
}).slice(0, 2);
|
|
1095
2824
|
}
|
|
1096
2825
|
else {
|
|
1097
|
-
this.
|
|
2826
|
+
this.filteredContactList = [];
|
|
1098
2827
|
}
|
|
1099
|
-
this.cdr.detectChanges();
|
|
1100
2828
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
2829
|
+
catch (e) {
|
|
2830
|
+
console.log(e);
|
|
1103
2831
|
}
|
|
1104
2832
|
}
|
|
1105
|
-
|
|
1106
|
-
|
|
2833
|
+
getFirstLetter(name) {
|
|
2834
|
+
return name ? name.charAt(0).toUpperCase() : '';
|
|
1107
2835
|
}
|
|
1108
|
-
|
|
1109
|
-
this.
|
|
1110
|
-
|
|
2836
|
+
clearInput() {
|
|
2837
|
+
if (this.dialedNumber.length > 0) {
|
|
2838
|
+
this.dialedNumber = this.dialedNumber.slice(0, -1);
|
|
2839
|
+
this.showInputClearBtn = this.dialedNumber.length !== 0;
|
|
2840
|
+
this.onDialInputChange(this.dialedNumber);
|
|
2841
|
+
}
|
|
1111
2842
|
}
|
|
1112
|
-
|
|
1113
|
-
this.
|
|
1114
|
-
this.
|
|
2843
|
+
clearAllDialed() {
|
|
2844
|
+
this.dialedNumber = '';
|
|
2845
|
+
this.sanitizedNum = '';
|
|
2846
|
+
this.showInputClearBtn = false;
|
|
2847
|
+
}
|
|
2848
|
+
getCallerIdList() {
|
|
2849
|
+
this.extService.displayID(this.token || '').subscribe((res) => {
|
|
2850
|
+
//this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
|
|
2851
|
+
this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
|
|
2852
|
+
// this.callerIdList = res.callerIdList;
|
|
2853
|
+
if (this.callerIdList.length == 1) {
|
|
2854
|
+
this.selectedCallerId = this.callerIdList[0];
|
|
2855
|
+
}
|
|
2856
|
+
else {
|
|
2857
|
+
if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
|
|
2858
|
+
this.selectedCallerId = null;
|
|
2859
|
+
}
|
|
2860
|
+
else {
|
|
2861
|
+
this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
});
|
|
1115
2865
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
2866
|
+
getContactList() {
|
|
2867
|
+
this.twilioService.getContactList().subscribe((resp) => {
|
|
2868
|
+
if (resp.response == 'Success') {
|
|
2869
|
+
this.contactList = resp.phoneBook;
|
|
2870
|
+
}
|
|
2871
|
+
}, err => {
|
|
2872
|
+
console.log(err);
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
getFullName(contact) {
|
|
2876
|
+
let fullName = contact.firstName || '';
|
|
2877
|
+
if (contact.middleName) {
|
|
2878
|
+
fullName += ` ${contact.middleName}`;
|
|
1119
2879
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
2880
|
+
if (contact.lastName) {
|
|
2881
|
+
fullName += ` ${contact.lastName}`;
|
|
1122
2882
|
}
|
|
2883
|
+
return fullName.trim();
|
|
1123
2884
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
const details = this.extensionService.getCallSid();
|
|
1127
|
-
this.incomingCallSid = details.callSid;
|
|
1128
|
-
this.incomingRecordCall = details.recordCall;
|
|
1129
|
-
sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
|
|
1130
|
-
this.extensionService.getCallRecording(sid).subscribe(response => {
|
|
1131
|
-
this.isRecording = true;
|
|
1132
|
-
this.isPaused = false;
|
|
1133
|
-
this.timeElapsed = 0;
|
|
1134
|
-
this.startTimer1();
|
|
1135
|
-
}, error => {
|
|
1136
|
-
console.error('Error starting recording', error);
|
|
1137
|
-
});
|
|
2885
|
+
toggleCallerIdDiv() {
|
|
2886
|
+
this.isCallerIdHidden = !this.isCallerIdHidden;
|
|
1138
2887
|
}
|
|
1139
|
-
|
|
1140
|
-
this.
|
|
1141
|
-
this.
|
|
1142
|
-
|
|
1143
|
-
|
|
2888
|
+
onContactSelect(contact) {
|
|
2889
|
+
this.dialedNumber = contact.numbersList[0].number;
|
|
2890
|
+
this.callData.name = this.getFullName(contact);
|
|
2891
|
+
this.callData.img = contact.image || 'assets/images/user.jpg';
|
|
2892
|
+
this.onDialInputChange(this.dialedNumber);
|
|
2893
|
+
this.filteredContactList = [];
|
|
2894
|
+
}
|
|
2895
|
+
endCall() {
|
|
2896
|
+
try {
|
|
2897
|
+
console.log('Ending call');
|
|
2898
|
+
this.isCallInProgress = false;
|
|
2899
|
+
this.filteredContactList = [];
|
|
2900
|
+
// Reset call data
|
|
2901
|
+
this.callData = {
|
|
2902
|
+
phone: '',
|
|
2903
|
+
name: '',
|
|
2904
|
+
img: 'assets/images/user.jpg',
|
|
2905
|
+
isIncomingCall: false,
|
|
2906
|
+
dial: false,
|
|
2907
|
+
displayNum: '',
|
|
2908
|
+
extNum: ''
|
|
2909
|
+
};
|
|
2910
|
+
// Reset dialed number
|
|
2911
|
+
this.dialedNumber = '';
|
|
2912
|
+
this.sanitizedNum = '';
|
|
2913
|
+
// Emit end call event
|
|
2914
|
+
this.endCallEvent.emit();
|
|
2915
|
+
console.log('Call ended successfully');
|
|
2916
|
+
}
|
|
2917
|
+
catch (error) {
|
|
2918
|
+
console.error('Error in endCall:', error);
|
|
2919
|
+
// Even if there's an error, try to reset the state
|
|
2920
|
+
this.isCallInProgress = false;
|
|
2921
|
+
this.callData = {
|
|
2922
|
+
phone: '',
|
|
2923
|
+
name: '',
|
|
2924
|
+
img: 'assets/images/user.jpg',
|
|
2925
|
+
isIncomingCall: false,
|
|
2926
|
+
dial: false,
|
|
2927
|
+
displayNum: '',
|
|
2928
|
+
extNum: ''
|
|
2929
|
+
};
|
|
2930
|
+
this.endCallEvent.emit();
|
|
1144
2931
|
}
|
|
1145
2932
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
2933
|
+
// async initiateCall() {
|
|
2934
|
+
// try {
|
|
2935
|
+
// console.log('Initiating call with number:', this.dialedNumber);
|
|
2936
|
+
// if (!this.dialedNumber && this.lastDialed) {
|
|
2937
|
+
// console.log('Using last dialed number:', this.lastDialed.number);
|
|
2938
|
+
// this.sanitizedNum = this.lastDialed.number;
|
|
2939
|
+
// }
|
|
2940
|
+
// const isInvalid = await this.isInvalidNumber();
|
|
2941
|
+
// if (isInvalid) {
|
|
2942
|
+
// console.error('Invalid number format');
|
|
2943
|
+
// return false;
|
|
2944
|
+
// }
|
|
2945
|
+
// this.saveLastDialed();
|
|
2946
|
+
// this.isSavedContactDialled();
|
|
2947
|
+
// // Check payment status
|
|
2948
|
+
// this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
|
|
2949
|
+
// if (this.isPaymentDue) {
|
|
2950
|
+
// console.warn('Payment is due');
|
|
2951
|
+
// swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
|
|
2952
|
+
// return false;
|
|
2953
|
+
// }
|
|
2954
|
+
// // Check if dialing own number
|
|
2955
|
+
// if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
|
|
2956
|
+
// console.error('Attempted to dial own number');
|
|
2957
|
+
// swal('Error', 'You cannot dial your own number');
|
|
2958
|
+
// return false;
|
|
2959
|
+
// }
|
|
2960
|
+
// // Check microphone permissions
|
|
2961
|
+
// const hasPermission = await this.checkMicrophonePermission();
|
|
2962
|
+
// if (!hasPermission) {
|
|
2963
|
+
// console.warn('Microphone permission not granted');
|
|
2964
|
+
// await this.askForMicrophonePermission();
|
|
2965
|
+
// return false;
|
|
2966
|
+
// }
|
|
2967
|
+
// if (!this.selectedCallerId) {
|
|
2968
|
+
// console.error('No caller ID selected');
|
|
2969
|
+
// this.shakeDedicatedBtn = true;
|
|
2970
|
+
// this.showDialAlert('Please select a C2C number to call from');
|
|
2971
|
+
// setTimeout(() => {
|
|
2972
|
+
// this.shakeDedicatedBtn = false;
|
|
2973
|
+
// }, 3000);
|
|
2974
|
+
// return false;
|
|
2975
|
+
// }
|
|
2976
|
+
// console.log('Getting number with country code...');
|
|
2977
|
+
// this.callData.displayNum = '';
|
|
2978
|
+
// try {
|
|
2979
|
+
// await this.getToNumber(this.sanitizedNum);
|
|
2980
|
+
// } catch (error) {
|
|
2981
|
+
// console.error('Error getting number with country code:', error);
|
|
2982
|
+
// this.showDialAlert('Error processing number. Please try again.');
|
|
2983
|
+
// return false;
|
|
2984
|
+
// }
|
|
2985
|
+
// if (this.terminateCall) {
|
|
2986
|
+
// console.log('Call terminated by user');
|
|
2987
|
+
// this.terminateCall = false;
|
|
2988
|
+
// return false;
|
|
2989
|
+
// }
|
|
2990
|
+
// // Prepare call data
|
|
2991
|
+
// this.callData = {
|
|
2992
|
+
// ...this.callData,
|
|
2993
|
+
// phone: this.sanitizedNum,
|
|
2994
|
+
// isIncomingCall: false,
|
|
2995
|
+
// dial: true,
|
|
2996
|
+
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
2997
|
+
// timestamp: new Date().toISOString()
|
|
2998
|
+
// };
|
|
2999
|
+
// console.log('Initiating call with data:', this.callData);
|
|
3000
|
+
// this.isCallInProgress = true;
|
|
3001
|
+
// this.callInitiated.emit({ ...this.callData });
|
|
3002
|
+
// return true;
|
|
3003
|
+
// } catch (error) {
|
|
3004
|
+
// console.error('Error in initiateCall:', error);
|
|
3005
|
+
// this.showDialAlert('Failed to initiate call. Please try again.');
|
|
3006
|
+
// this.isCallInProgress = false;
|
|
3007
|
+
// return false;
|
|
3008
|
+
// }
|
|
3009
|
+
// //this.clearAllDialed();
|
|
3010
|
+
// // } else {
|
|
3011
|
+
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
3012
|
+
// // }
|
|
3013
|
+
// }
|
|
3014
|
+
// async initiateCall() {
|
|
3015
|
+
// if (!this.dialedNumber && this.lastDialed) {
|
|
3016
|
+
// this.sanitizedNum = this.lastDialed.number;
|
|
3017
|
+
// }
|
|
3018
|
+
// const isInvalid = await this.isInvalidNumber();
|
|
3019
|
+
// if (isInvalid) {
|
|
3020
|
+
// return false;
|
|
3021
|
+
// }
|
|
3022
|
+
// this.saveLastDialed();
|
|
3023
|
+
// this.isSavedContactDialled();
|
|
3024
|
+
// //let isCallerIdSet = await this.isCallerIdSet();
|
|
3025
|
+
// this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
|
|
3026
|
+
// if (this.isPaymentDue) {
|
|
3027
|
+
// swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
|
|
3028
|
+
// return;
|
|
3029
|
+
// }
|
|
3030
|
+
// this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
|
|
3031
|
+
// // if (!this.isTrialPeriodOver) {
|
|
3032
|
+
// if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
|
|
3033
|
+
// swal('Error', 'You can not dial this number');
|
|
3034
|
+
// return;
|
|
3035
|
+
// }
|
|
3036
|
+
// const hasPermission = await this.checkMicrophonePermission();
|
|
3037
|
+
// if (hasPermission) {
|
|
3038
|
+
// if (this.selectedCallerId) {
|
|
3039
|
+
// //clear displayNum if value is binded from previous call
|
|
3040
|
+
// this.callData.displayNum = '';
|
|
3041
|
+
// // get number to be dialled from backend
|
|
3042
|
+
// await this.getToNumber(this.sanitizedNum);
|
|
3043
|
+
// if (this.terminateCall) {
|
|
3044
|
+
// this.terminateCall = false;
|
|
3045
|
+
// return;
|
|
3046
|
+
// }
|
|
3047
|
+
// this.callData.phone = this.sanitizedNum;
|
|
3048
|
+
// this.callData.isIncomingCall = false;
|
|
3049
|
+
// this.callData.dial = true;
|
|
3050
|
+
// if (!this.isSmartDialCall) {
|
|
3051
|
+
// this.callData.from = this.selectedCallerId.number;
|
|
3052
|
+
// }
|
|
3053
|
+
// this.isCallInProgress = true;
|
|
3054
|
+
// this.callData = {
|
|
3055
|
+
// ...this.callData,
|
|
3056
|
+
// phone: this.sanitizedNum,
|
|
3057
|
+
// isIncomingCall: false,
|
|
3058
|
+
// dial: true,
|
|
3059
|
+
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
3060
|
+
// timestamp: new Date().toISOString()
|
|
3061
|
+
// };
|
|
3062
|
+
// console.log('Initiating call with data:', this.callData);
|
|
3063
|
+
// this.isCallInProgress = true;
|
|
3064
|
+
// this.callInitiated.emit({ ...this.callData });
|
|
3065
|
+
// return true;
|
|
3066
|
+
// } else {
|
|
3067
|
+
// this.shakeDedicatedBtn = true;
|
|
3068
|
+
// this.showDialAlert('Select a C2C number to call');
|
|
3069
|
+
// setTimeout(() => {
|
|
3070
|
+
// this.shakeDedicatedBtn = false;
|
|
3071
|
+
// }, 3000);
|
|
3072
|
+
// return false;
|
|
3073
|
+
// }
|
|
3074
|
+
// //this.callingOpenEvent.emit({ phone: this.dialedNumber });
|
|
3075
|
+
// } else {
|
|
3076
|
+
// await this.askForMicrophonePermission();
|
|
3077
|
+
// }
|
|
3078
|
+
// //this.clearAllDialed();
|
|
3079
|
+
// // } else {
|
|
3080
|
+
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
3081
|
+
// // }
|
|
3082
|
+
// }
|
|
3083
|
+
// async initiateCall() {
|
|
3084
|
+
// try{
|
|
3085
|
+
// if (!this.dialedNumber && this.lastDialed) {
|
|
3086
|
+
// this.sanitizedNum = this.lastDialed.number;
|
|
3087
|
+
// }
|
|
3088
|
+
// const isInvalid = await this.isInvalidNumber();
|
|
3089
|
+
// if (isInvalid) {
|
|
3090
|
+
// return false;
|
|
3091
|
+
// }
|
|
3092
|
+
// this.saveLastDialed();
|
|
3093
|
+
// this.isSavedContactDialled();
|
|
3094
|
+
// //let isCallerIdSet = await this.isCallerIdSet();
|
|
3095
|
+
// this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
|
|
3096
|
+
// if (this.isPaymentDue) {
|
|
3097
|
+
// swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
|
|
3098
|
+
// return false;
|
|
3099
|
+
// }
|
|
3100
|
+
// this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
|
|
3101
|
+
// // if (!this.isTrialPeriodOver) {
|
|
3102
|
+
// if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
|
|
3103
|
+
// swal('Error', 'You can not dial this number');
|
|
3104
|
+
// return false;
|
|
3105
|
+
// }
|
|
3106
|
+
// const hasPermission = await this.checkMicrophonePermission();
|
|
3107
|
+
// if (hasPermission) {
|
|
3108
|
+
// if (this.selectedCallerId) {
|
|
3109
|
+
// //clear displayNum if value is binded from previous call
|
|
3110
|
+
// this.callData.displayNum = '';
|
|
3111
|
+
// // get number to be dialled from backend
|
|
3112
|
+
// await this.getToNumber(this.sanitizedNum);
|
|
3113
|
+
// if (this.terminateCall) {
|
|
3114
|
+
// this.terminateCall = false;
|
|
3115
|
+
// return;
|
|
3116
|
+
// }
|
|
3117
|
+
// this.callData.phone = this.sanitizedNum;
|
|
3118
|
+
// this.callData.isIncomingCall = false;
|
|
3119
|
+
// this.callData.dial = true;
|
|
3120
|
+
// if (!this.isSmartDialCall) {
|
|
3121
|
+
// this.callData.from = this.selectedCallerId.number;
|
|
3122
|
+
// }
|
|
3123
|
+
// this.isCallInProgress = true;
|
|
3124
|
+
// this.callData = {
|
|
3125
|
+
// ...this.callData,
|
|
3126
|
+
// phone: this.sanitizedNum,
|
|
3127
|
+
// isIncomingCall: false,
|
|
3128
|
+
// dial: true,
|
|
3129
|
+
// from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
|
|
3130
|
+
// timestamp: new Date().toISOString()
|
|
3131
|
+
// };
|
|
3132
|
+
// console.log('Initiating call with data:', this.callData);
|
|
3133
|
+
// this.isCallInProgress = true;
|
|
3134
|
+
// this.callInitiated.emit({ ...this.callData });
|
|
3135
|
+
// return true;
|
|
3136
|
+
// } else {
|
|
3137
|
+
// this.shakeDedicatedBtn = true;
|
|
3138
|
+
// this.showDialAlert('Select a C2C number to call');
|
|
3139
|
+
// setTimeout(() => {
|
|
3140
|
+
// this.shakeDedicatedBtn = false;
|
|
3141
|
+
// }, 3000);
|
|
3142
|
+
// return false;
|
|
3143
|
+
// }
|
|
3144
|
+
// //this.callingOpenEvent.emit({ phone: this.dialedNumber });
|
|
3145
|
+
// } else {
|
|
3146
|
+
// await this.askForMicrophonePermission();
|
|
3147
|
+
// }
|
|
3148
|
+
// //this.clearAllDialed();
|
|
3149
|
+
// // } else {
|
|
3150
|
+
// // swal('Error', 'Trial period is over. Please setup payment method to continue services')
|
|
3151
|
+
// // }
|
|
3152
|
+
// }catch(e){
|
|
3153
|
+
// console.error('Error in initiateCall:', e);
|
|
3154
|
+
// this.showDialAlert('Failed to initiate call. Please try again.');
|
|
3155
|
+
// this.isCallInProgress = false;
|
|
3156
|
+
// return false;
|
|
3157
|
+
// }
|
|
3158
|
+
// }
|
|
3159
|
+
initiateCall() {
|
|
3160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3161
|
+
try {
|
|
3162
|
+
if (!this.dialedNumber && this.lastDialed) {
|
|
3163
|
+
this.sanitizedNum = this.lastDialed.number;
|
|
3164
|
+
}
|
|
3165
|
+
const isInvalid = yield this.isInvalidNumber();
|
|
3166
|
+
if (isInvalid) {
|
|
3167
|
+
return false;
|
|
3168
|
+
}
|
|
3169
|
+
this.saveLastDialed();
|
|
3170
|
+
this.isSavedContactDialled();
|
|
3171
|
+
this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
|
|
3172
|
+
if (this.isPaymentDue) {
|
|
3173
|
+
swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
|
|
3174
|
+
return false;
|
|
3175
|
+
}
|
|
3176
|
+
this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
|
|
3177
|
+
if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
|
|
3178
|
+
swal('Error', 'You can not dial this number');
|
|
3179
|
+
return false;
|
|
3180
|
+
}
|
|
3181
|
+
const hasPermission = yield this.checkMicrophonePermission();
|
|
3182
|
+
if (!hasPermission) {
|
|
3183
|
+
yield this.askForMicrophonePermission();
|
|
3184
|
+
return false;
|
|
3185
|
+
}
|
|
3186
|
+
if (!this.selectedCallerId) {
|
|
3187
|
+
this.shakeDedicatedBtn = true;
|
|
3188
|
+
this.showDialAlert('Select a C2C number to call');
|
|
3189
|
+
setTimeout(() => {
|
|
3190
|
+
this.shakeDedicatedBtn = false;
|
|
3191
|
+
}, 3000);
|
|
3192
|
+
return false;
|
|
3193
|
+
}
|
|
3194
|
+
// Clear displayNum if value is bound from previous call
|
|
3195
|
+
this.callData.displayNum = '';
|
|
3196
|
+
// Get number to be dialed from backend
|
|
3197
|
+
yield this.getToNumber(this.sanitizedNum);
|
|
3198
|
+
if (this.terminateCall) {
|
|
3199
|
+
this.terminateCall = false;
|
|
3200
|
+
return;
|
|
3201
|
+
}
|
|
3202
|
+
// Update call data in a single operation
|
|
3203
|
+
this.callData = Object.assign(Object.assign({}, this.callData), { phone: this.sanitizedNum, isIncomingCall: false, dial: true, from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number, timestamp: new Date().toISOString() });
|
|
3204
|
+
// console.log('Initiating call with data:', this.callData);
|
|
3205
|
+
this.isCallInProgress = true;
|
|
3206
|
+
this.callInitiated.emit(Object.assign({}, this.callData));
|
|
3207
|
+
return true;
|
|
3208
|
+
}
|
|
3209
|
+
catch (e) {
|
|
3210
|
+
// console.error('Error in initiateCall:', e);
|
|
3211
|
+
this.showDialAlert('Failed to initiate call. Please try again.');
|
|
3212
|
+
this.isCallInProgress = false;
|
|
3213
|
+
return false;
|
|
3214
|
+
}
|
|
1156
3215
|
});
|
|
1157
3216
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
3217
|
+
isInvalidNumber() {
|
|
3218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3219
|
+
try {
|
|
3220
|
+
if (this.sanitizedNum == '') {
|
|
3221
|
+
this.showDialAlert('Invalid Number');
|
|
3222
|
+
return true;
|
|
3223
|
+
}
|
|
3224
|
+
const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
|
|
3225
|
+
const phoneNumber = this.sanitizedNum;
|
|
3226
|
+
if (!validNumberPattern.test(phoneNumber)) {
|
|
3227
|
+
this.showDialAlert('Invalid Number');
|
|
3228
|
+
return true;
|
|
3229
|
+
}
|
|
3230
|
+
return false;
|
|
3231
|
+
}
|
|
3232
|
+
catch (error) {
|
|
3233
|
+
this.showDialAlert('Invalid Number');
|
|
3234
|
+
return true; // Return true if an error occurred, meaning the number is invalid
|
|
3235
|
+
}
|
|
1169
3236
|
});
|
|
1170
3237
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
3238
|
+
saveLastDialed() {
|
|
3239
|
+
const contact = this.filteredContactList.find((c) => c.numbersList.some((n) => n.number === this.dialedNumber));
|
|
3240
|
+
if (contact) {
|
|
3241
|
+
this.lastDialed = {
|
|
3242
|
+
name: contact.name,
|
|
3243
|
+
image: contact.image,
|
|
3244
|
+
number: this.dialedNumber
|
|
3245
|
+
};
|
|
3246
|
+
}
|
|
3247
|
+
else {
|
|
3248
|
+
if (this.dialedNumber) {
|
|
3249
|
+
this.lastDialed = { number: this.dialedNumber };
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
1175
3252
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
3253
|
+
isSavedContactDialled() {
|
|
3254
|
+
let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
|
|
3255
|
+
let contact = this.contactList.filter((contact) => {
|
|
3256
|
+
return contact.numbersList.some((num) => num.number === phoneNum);
|
|
3257
|
+
});
|
|
3258
|
+
if (contact.length) {
|
|
3259
|
+
this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
|
|
3260
|
+
this.callData.img = contact[0].image || 'assets/images/user.jpg';
|
|
3261
|
+
this.callData.phone = this.sanitizedNum;
|
|
3262
|
+
return true;
|
|
1180
3263
|
}
|
|
3264
|
+
return false;
|
|
1181
3265
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
3266
|
+
showDialAlert(message) {
|
|
3267
|
+
this.dialAlert = {
|
|
3268
|
+
msg: message,
|
|
3269
|
+
show: true
|
|
3270
|
+
};
|
|
3271
|
+
setTimeout(() => {
|
|
3272
|
+
this.dialAlert.show = false;
|
|
3273
|
+
}, 3000);
|
|
1186
3274
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
const pollInterval = 3000; // Poll every 3 seconds
|
|
1190
|
-
let elapsedTime = 0;
|
|
1191
|
-
const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
1192
|
-
elapsedTime += pollInterval;
|
|
3275
|
+
isCallerIdSet() {
|
|
3276
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1193
3277
|
try {
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
clearInterval(intervalId);
|
|
1206
|
-
this.endCall();
|
|
1207
|
-
this.stopRecording();
|
|
1208
|
-
}
|
|
1209
|
-
else if (this.callStatus === 'ringing') {
|
|
1210
|
-
// Continue polling; do not clear the interval yet
|
|
1211
|
-
}
|
|
3278
|
+
const tkn = localStorage.getItem('ext_token');
|
|
3279
|
+
const res = yield this.extService.fetchCallerId(tkn || '').toPromise();
|
|
3280
|
+
if (res.status == 200) {
|
|
3281
|
+
localStorage.setItem('trialOver', res.trialOver);
|
|
3282
|
+
this.twilioService.isTrialOver.next(res.trialOver);
|
|
3283
|
+
localStorage.setItem('paymentDue', res.paymentDue);
|
|
3284
|
+
this.twilioService.isPaymentDue.next(res.paymentDue);
|
|
3285
|
+
}
|
|
3286
|
+
if (res.callerid) {
|
|
3287
|
+
localStorage.setItem('callerID', res.callerid);
|
|
3288
|
+
this.extService.changeMessage(res.callerid);
|
|
1212
3289
|
}
|
|
3290
|
+
else {
|
|
3291
|
+
localStorage.setItem('callerID', 'Not set');
|
|
3292
|
+
this.extService.changeMessage('Not set');
|
|
3293
|
+
}
|
|
3294
|
+
return (localStorage.getItem('callerID') !== 'Not set');
|
|
3295
|
+
}
|
|
3296
|
+
catch (e) {
|
|
3297
|
+
console.log(e);
|
|
3298
|
+
return false;
|
|
3299
|
+
}
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
checkMicrophonePermission() {
|
|
3303
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3304
|
+
try {
|
|
3305
|
+
const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
|
|
3306
|
+
stream.getTracks().forEach(track => track.stop());
|
|
3307
|
+
return true;
|
|
1213
3308
|
}
|
|
1214
3309
|
catch (error) {
|
|
1215
|
-
|
|
3310
|
+
if (error.name === 'NotAllowedError') {
|
|
3311
|
+
return false;
|
|
3312
|
+
}
|
|
3313
|
+
else {
|
|
3314
|
+
return false;
|
|
3315
|
+
}
|
|
1216
3316
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
3317
|
+
});
|
|
3318
|
+
}
|
|
3319
|
+
askForMicrophonePermission() {
|
|
3320
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3321
|
+
try {
|
|
3322
|
+
const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
|
|
3323
|
+
stream.getTracks().forEach(track => track.stop());
|
|
1219
3324
|
}
|
|
1220
|
-
|
|
3325
|
+
catch (error) {
|
|
3326
|
+
console.error('User denied microphone permission:', error);
|
|
3327
|
+
}
|
|
3328
|
+
});
|
|
1221
3329
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
3330
|
+
// below function is to get the country code with number from server
|
|
3331
|
+
getToNumber(dialedNumber) {
|
|
3332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3333
|
+
if (dialedNumber[0] !== '+') {
|
|
3334
|
+
// this is case when user geolocation dial code is on
|
|
3335
|
+
let ipAddress = yield this.ipService.getIpAddressInfo().toPromise();
|
|
3336
|
+
const res = yield this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
|
|
3337
|
+
if (res.status == 200) {
|
|
3338
|
+
this.toastTimeout = res.timeInterval * 1000;
|
|
3339
|
+
yield this.showNumberToast(res);
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
1227
3342
|
});
|
|
1228
3343
|
}
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
|
|
3344
|
+
isAlertEnable() {
|
|
3345
|
+
return localStorage.getItem('isAlertEnable');
|
|
1232
3346
|
}
|
|
1233
|
-
|
|
1234
|
-
this
|
|
3347
|
+
showNumberToast(data) {
|
|
3348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3349
|
+
const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
|
|
3350
|
+
if (isAlertOn == 'true') {
|
|
3351
|
+
this.callNumberToast.show = true;
|
|
3352
|
+
this.callNumberToast.number = data.toNumber;
|
|
3353
|
+
this.callNumberToast.displayNum = data.displayNumber;
|
|
3354
|
+
}
|
|
3355
|
+
this.callData.displayNum = data.displayNumber;
|
|
3356
|
+
//this.callData.phone = data.toNumber;
|
|
3357
|
+
yield this.delay(this.toastTimeout);
|
|
3358
|
+
this.dialedNumber = data.toNumber;
|
|
3359
|
+
this.sanitizedNum = data.toNumber;
|
|
3360
|
+
this.callNumberToast.show = false;
|
|
3361
|
+
this.callNumberToast.number = '';
|
|
3362
|
+
this.callNumberToast.displayNum = '';
|
|
3363
|
+
});
|
|
1235
3364
|
}
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
3365
|
+
delay(ms) {
|
|
3366
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
3367
|
+
}
|
|
3368
|
+
onMinimise(isMinimised) {
|
|
3369
|
+
this.isMinimised = isMinimised;
|
|
3370
|
+
this.minimiseEvent.emit(isMinimised);
|
|
3371
|
+
}
|
|
3372
|
+
handleNumberPaste(event) {
|
|
3373
|
+
event.preventDefault();
|
|
3374
|
+
const clipboardData = event.clipboardData || window.clipboardData;
|
|
3375
|
+
const pastedData = clipboardData.getData('text');
|
|
3376
|
+
// Log the pasted content to the console
|
|
3377
|
+
if (pastedData) {
|
|
3378
|
+
this.dialedNumber = pastedData;
|
|
3379
|
+
this.sanitizedNum = pastedData;
|
|
1240
3380
|
}
|
|
1241
3381
|
}
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList", deviceId: "deviceId" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand }\">\r\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [deviceId]=\"deviceId\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \r\n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\r\n <div [ngStyle]=\"{'display': 'flex', 'flex-direction': 'column', 'position': 'relative', 'width': '100%', 'left': callData?.isIncomingCall ? '100px' : '0'}\">\r\n \r\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\r\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\r\n </div>\r\n <div class=\"callerDetails\">\r\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\r\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\r\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\r\n </div>\r\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\r\n <div class=\"record-btn-container\">\r\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"recording-icon\"></span>\r\n </button> \r\n <div class=\"pause-resume-btns\">\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\r\n <span class=\"material-symbols-outlined\"> pause </span>\r\n </button>\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\r\n <span class=\"material-symbols-outlined\"> play_arrow </span>\r\n </button>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isRecording\" class=\"timer-display\">\r\n {{ getFormattedTime() }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\r\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\r\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\r\n </div>\r\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\r\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\r\n {{key.num}}\r\n <span class=\"btn-albhabets\">{{key.text ? key.text : ' '}}</span>\r\n </div>\r\n </div>\r\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\r\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n\r\n </button>\r\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\r\n <span class=\"material-symbols-outlined\"> call_end </span>\r\n </button>\r\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wave-container\">\r\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\r\n <defs>\r\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n</div>\r\n\r\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\r\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\r\n <div style=\"display: flex; width: 100%\">\r\n <div>\r\n <div class=\"min-call-animation\" id=\"call-avatar\">\r\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\r\n </div>\r\n </div>\r\n <div>\r\n <div class=\"min-callerDetails\">\r\n <div class=\"name\">\r\n {{callData.name}}\r\n </div>\r\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"min-btn-container\">\r\n <div class=\"min-timer\">{{timer}}</div>\r\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n </button>\r\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\r\n <span class=\"material-symbols-outlined\"> call_end </span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n\r\n", styles: [".call-container{width:385px;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: ["incomingCallData", "newIncomingCallsList", "deviceId"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
args: [{ selector: 'lib-call-progress', template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand }\">\r\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [deviceId]=\"deviceId\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \r\n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\r\n <div [ngStyle]=\"{'display': 'flex', 'flex-direction': 'column', 'position': 'relative', 'width': '100%', 'left': callData?.isIncomingCall ? '100px' : '0'}\">\r\n \r\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\r\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\r\n </div>\r\n <div class=\"callerDetails\">\r\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\r\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\r\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\r\n </div>\r\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\r\n <div class=\"record-btn-container\">\r\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"recording-icon\"></span>\r\n </button> \r\n <div class=\"pause-resume-btns\">\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\r\n <span class=\"material-symbols-outlined\"> pause </span>\r\n </button>\r\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\r\n <span class=\"material-symbols-outlined\"> play_arrow </span>\r\n </button>\r\n </div>\r\n </div>\r\n <div *ngIf=\"isRecording\" class=\"timer-display\">\r\n {{ getFormattedTime() }}\r\n </div>\r\n </div>\r\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\r\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\r\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\r\n </div>\r\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\r\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\r\n {{key.num}}\r\n <span class=\"btn-albhabets\">{{key.text ? key.text : ' '}}</span>\r\n </div>\r\n </div>\r\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\r\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n\r\n </button>\r\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\r\n <span class=\"material-symbols-outlined\"> call_end </span>\r\n </button>\r\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"wave-container\">\r\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\r\n <defs>\r\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n</div>\r\n\r\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\r\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\r\n <div style=\"display: flex; width: 100%\">\r\n <div>\r\n <div class=\"min-call-animation\" id=\"call-avatar\">\r\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\r\n </div>\r\n </div>\r\n <div>\r\n <div class=\"min-callerDetails\">\r\n <div class=\"name\">\r\n {{callData.name}}\r\n </div>\r\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"min-btn-container\">\r\n <div class=\"min-timer\">{{timer}}</div>\r\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\r\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\r\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\r\n </button>\r\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\r\n <span class=\"material-symbols-outlined\"> call_end </span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n\r\n", styles: [".call-container{width:385px;height:646px!important;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
}], incomingCallsNewInfo: [{
|
|
1259
|
-
type: Output
|
|
1260
|
-
}], minimiseEvent: [{
|
|
1261
|
-
type: Output
|
|
1262
|
-
}], incomingCallInitiated: [{
|
|
1263
|
-
type: Output
|
|
1264
|
-
}] } });
|
|
1265
|
-
|
|
1266
|
-
class DialboxComponent {
|
|
1267
|
-
constructor() {
|
|
1268
|
-
this.isDialpadHidden = false;
|
|
1269
|
-
this.closeDialpadEvent = new EventEmitter();
|
|
1270
|
-
this.minimiseEvent = new EventEmitter();
|
|
3382
|
+
onEnter(num) {
|
|
3383
|
+
// console.log(num, 'number fn')
|
|
3384
|
+
this.dialedNumber = this.dialedNumber + num;
|
|
3385
|
+
this.sanitizedNum = this.dialedNumber;
|
|
3386
|
+
this.showInputClearBtn = true;
|
|
3387
|
+
this.numberDialed.emit(this.dialedNumber);
|
|
3388
|
+
}
|
|
3389
|
+
getUserCallSetting() {
|
|
3390
|
+
const tkn = localStorage.getItem('ext_token');
|
|
3391
|
+
this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
|
|
3392
|
+
if (resp.status == 200) {
|
|
3393
|
+
//this.callPrefernce = resp.userSetting;
|
|
3394
|
+
this.callPreference = resp.callerid;
|
|
3395
|
+
this.getCallerIdList();
|
|
3396
|
+
}
|
|
3397
|
+
});
|
|
1271
3398
|
}
|
|
1272
|
-
|
|
1273
|
-
this.
|
|
3399
|
+
onDedicatedNumSelect(id) {
|
|
3400
|
+
this.selectedCallerId = id;
|
|
3401
|
+
this.isCallerIdHidden = true;
|
|
3402
|
+
this.extService.setCallerId(id);
|
|
3403
|
+
}
|
|
3404
|
+
cancelDialNumber() {
|
|
3405
|
+
this.terminateCall = true;
|
|
3406
|
+
this.callNumberToast.show = false;
|
|
3407
|
+
}
|
|
3408
|
+
handleDivKeydown(ev) {
|
|
3409
|
+
if (this.dialedNumber.length == 0) {
|
|
3410
|
+
this.dialInputElement.nativeElement.focus();
|
|
3411
|
+
}
|
|
3412
|
+
if (ev.key === 'Enter') {
|
|
3413
|
+
// Check if the dialpad is open
|
|
3414
|
+
if (!this.isDialpadHidden) {
|
|
3415
|
+
if (this.dialedNumber.length > 2 && this.selectedCallerId) {
|
|
3416
|
+
this.initiateCall();
|
|
3417
|
+
}
|
|
3418
|
+
if (!this.selectedCallerId) {
|
|
3419
|
+
this.shakeDedicatedBtn = true;
|
|
3420
|
+
setTimeout(() => {
|
|
3421
|
+
this.shakeDedicatedBtn = false;
|
|
3422
|
+
}, 10000);
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
onCallBtnMouseEnter(ev) {
|
|
3428
|
+
if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
|
|
3429
|
+
this.shakeDedicatedBtn = true;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
onCallBtnMouseLeave(ev) {
|
|
3433
|
+
if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
|
|
3434
|
+
this.shakeDedicatedBtn = false;
|
|
3435
|
+
}
|
|
1274
3436
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
3437
|
+
acceptNewIncomingCall(call) {
|
|
3438
|
+
//first cut the current call
|
|
3439
|
+
//this.callData = call;
|
|
3440
|
+
this.newIncomingCallData = call;
|
|
3441
|
+
}
|
|
3442
|
+
rejectNewIncomingCall(call) {
|
|
3443
|
+
call.reject();
|
|
3444
|
+
this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
|
|
3445
|
+
this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
|
|
3446
|
+
}
|
|
3447
|
+
newIncomingCallInitiated() {
|
|
3448
|
+
this.isCallInProgress = true;
|
|
3449
|
+
this.newIncomingCalls = [];
|
|
3450
|
+
this.incomingCallInitiated.emit();
|
|
3451
|
+
}
|
|
3452
|
+
incomingCallsNewInfo(data) {
|
|
3453
|
+
this.incomingCallsList = data;
|
|
3454
|
+
this.incomingCallsNewInfoEvent.emit(data);
|
|
3455
|
+
}
|
|
3456
|
+
ngOnDestroy() {
|
|
3457
|
+
try {
|
|
3458
|
+
console.log('Cleaning up C2cDialpadComponent');
|
|
3459
|
+
// Unsubscribe from all subscriptions
|
|
3460
|
+
if (this.subscriptions) {
|
|
3461
|
+
this.subscriptions.unsubscribe();
|
|
3462
|
+
}
|
|
3463
|
+
// Clean up Twilio device when component is destroyed
|
|
3464
|
+
if (this.twilioService['device']) {
|
|
3465
|
+
this.twilioService['device'].destroy();
|
|
3466
|
+
}
|
|
3467
|
+
// End any active call
|
|
3468
|
+
if (this.isCallInProgress) {
|
|
3469
|
+
this.endCall();
|
|
3470
|
+
}
|
|
3471
|
+
// Clear any timeouts or intervals if they exist
|
|
3472
|
+
if (this.toastTimeout) {
|
|
3473
|
+
clearTimeout(this.toastTimeout);
|
|
3474
|
+
}
|
|
3475
|
+
console.log('C2cDialpadComponent cleanup complete');
|
|
3476
|
+
}
|
|
3477
|
+
catch (error) {
|
|
3478
|
+
console.error('Error during component cleanup:', error);
|
|
3479
|
+
}
|
|
1277
3480
|
}
|
|
1278
3481
|
}
|
|
1279
|
-
DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1280
|
-
DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden", contactInfo: "contactInfo", deviceId: "deviceId" }, outputs: { closeDialpadEvent: "closeDialpadEvent", minimiseEvent: "minimiseEvent" }, ngImport: i0, template: `
|
|
1281
|
-
<div *ngIf="!isDialpadHidden">
|
|
1282
|
-
<lib-call-progress
|
|
1283
|
-
[callData]="contactInfo"
|
|
1284
|
-
[deviceId]="deviceId"
|
|
1285
|
-
(endCallEvent)="onEndCall()"
|
|
1286
|
-
(minimiseEvent)="onMinimise($event)">
|
|
1287
|
-
</lib-call-progress>
|
|
1288
|
-
</div>
|
|
1289
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CallProgressComponent, selector: "lib-call-progress", inputs: ["callData", "newIncomingCallData", "newIncomingCallsList", "deviceId"], outputs: ["endCallEvent", "incomingCallsNewInfo", "minimiseEvent", "incomingCallInitiated"] }] });
|
|
3482
|
+
DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: i3$1.MatDialog }, { token: IpAddressService }, { token: ExtensionService }, { token: i0.ChangeDetectorRef }, { token: i5.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
3483
|
+
DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { autoOpenOnIncoming: "autoOpenOnIncoming", contactInfo: "contactInfo", deviceId: "deviceId", isDialpadHidden: "isDialpadHidden", incomingCallData: "incomingCallData" }, outputs: { closeDialpadEvent: "closeDialpadEvent", callInitiated: "callInitiated", endCallEvent: "endCallEvent", minimiseEvent: "minimiseEvent", incomingCallsNewInfoEvent: "incomingCallsNewInfoEvent", incomingCallInitiated: "incomingCallInitiated", numberDialed: "numberDialed" }, viewQueries: [{ propertyName: "dialInputElement", first: true, predicate: ["dialInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [deviceId]=\"deviceId\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" *ngIf=\"!isCallInProgress\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : ' '}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div> -->\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px!important;height:600px!important;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: CallProgressComponent, selector: "lib-call-progress", inputs: ["callData", "newIncomingCallData", "newIncomingCallsList", "deviceId"], outputs: ["endCallEvent", "incomingCallsNewInfo", "minimiseEvent", "incomingCallInitiated"] }] });
|
|
1290
3484
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
|
|
1291
3485
|
type: Component,
|
|
1292
|
-
args: [{ selector: 'lib-dialbox', template: `
|
|
1293
|
-
|
|
1294
|
-
<lib-call-progress
|
|
1295
|
-
[callData]="contactInfo"
|
|
1296
|
-
[deviceId]="deviceId"
|
|
1297
|
-
(endCallEvent)="onEndCall()"
|
|
1298
|
-
(minimiseEvent)="onMinimise($event)">
|
|
1299
|
-
</lib-call-progress>
|
|
1300
|
-
</div>
|
|
1301
|
-
` }]
|
|
1302
|
-
}], propDecorators: { isDialpadHidden: [{
|
|
3486
|
+
args: [{ selector: 'lib-dialbox', template: "<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [deviceId]=\"deviceId\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" *ngIf=\"!isCallInProgress\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : ' '}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div> -->\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px!important;height:600px!important;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"] }]
|
|
3487
|
+
}], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: i3$1.MatDialog }, { type: IpAddressService }, { type: ExtensionService }, { type: i0.ChangeDetectorRef }, { type: i5.Router }]; }, propDecorators: { autoOpenOnIncoming: [{
|
|
1303
3488
|
type: Input
|
|
1304
3489
|
}], contactInfo: [{
|
|
1305
3490
|
type: Input
|
|
1306
3491
|
}], deviceId: [{
|
|
1307
3492
|
type: Input
|
|
3493
|
+
}], isDialpadHidden: [{
|
|
3494
|
+
type: Input
|
|
3495
|
+
}], incomingCallData: [{
|
|
3496
|
+
type: Input
|
|
1308
3497
|
}], closeDialpadEvent: [{
|
|
1309
3498
|
type: Output
|
|
3499
|
+
}], callInitiated: [{
|
|
3500
|
+
type: Output
|
|
3501
|
+
}], endCallEvent: [{
|
|
3502
|
+
type: Output
|
|
1310
3503
|
}], minimiseEvent: [{
|
|
1311
3504
|
type: Output
|
|
3505
|
+
}], incomingCallsNewInfoEvent: [{
|
|
3506
|
+
type: Output
|
|
3507
|
+
}], incomingCallInitiated: [{
|
|
3508
|
+
type: Output
|
|
3509
|
+
}], dialInputElement: [{
|
|
3510
|
+
type: ViewChild,
|
|
3511
|
+
args: ['dialInput']
|
|
3512
|
+
}], numberDialed: [{
|
|
3513
|
+
type: Output
|
|
1312
3514
|
}] } });
|
|
1313
3515
|
|
|
1314
3516
|
class CallerIdDialogComponent {
|
|
1315
|
-
constructor(router, twilServ) {
|
|
3517
|
+
constructor(router, twilServ, dialogRef, data) {
|
|
1316
3518
|
this.router = router;
|
|
1317
3519
|
this.twilServ = twilServ;
|
|
3520
|
+
this.dialogRef = dialogRef;
|
|
3521
|
+
this.data = data;
|
|
1318
3522
|
this.storedTheme = localStorage.getItem('theme-color') || 'blue';
|
|
1319
3523
|
this.alertToggle = true;
|
|
1320
3524
|
this.token = '';
|
|
@@ -1324,20 +3528,20 @@ class CallerIdDialogComponent {
|
|
|
1324
3528
|
this.token = localStorage.getItem('ext_token') || '';
|
|
1325
3529
|
}
|
|
1326
3530
|
onConfirm() {
|
|
1327
|
-
|
|
3531
|
+
this.dialogRef.close(true);
|
|
1328
3532
|
}
|
|
1329
3533
|
onCancel() {
|
|
1330
|
-
|
|
3534
|
+
this.dialogRef.close(false);
|
|
1331
3535
|
}
|
|
1332
3536
|
redirectToCallingPreference() {
|
|
1333
3537
|
this.router.navigateByUrl('/extension/caller-id/' + this.token);
|
|
1334
|
-
|
|
3538
|
+
this.dialogRef.close({ event: 'redirect', alertToggle: this.alertToggle });
|
|
1335
3539
|
}
|
|
1336
3540
|
proceed() {
|
|
1337
|
-
|
|
3541
|
+
this.dialogRef.close({ event: 'proceed', alertToggle: this.alertToggle });
|
|
1338
3542
|
}
|
|
1339
3543
|
closeModal() {
|
|
1340
|
-
|
|
3544
|
+
this.dialogRef.close();
|
|
1341
3545
|
}
|
|
1342
3546
|
hideMessage(ev) {
|
|
1343
3547
|
this.twilServ.toggleCallerIdAlert.next(ev.target.checked);
|
|
@@ -1348,12 +3552,17 @@ class CallerIdDialogComponent {
|
|
|
1348
3552
|
console.log('doNotShowAgain');
|
|
1349
3553
|
}
|
|
1350
3554
|
}
|
|
1351
|
-
CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token:
|
|
1352
|
-
CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<div class=\"main-theme {{storedTheme}}\">\
|
|
3555
|
+
CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i5.Router }, { token: TwilioService }, { token: i3$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3556
|
+
CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>", styles: ["::ng-deep .mat-dialog-container{padding:0!important;border-radius:8px;box-shadow:0 4px 10px #0003;text-align:center}::ng-deep .cus-dialog{z-index:111111!important}.btn-black-outline{border:1px solid #000000;border-radius:10px}.btn-blue{background-color:#234de8;color:#fff!important;margin-left:8px}::ng-deep .cdk-overlay-container{z-index:111111}\n"], dependencies: [{ kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
1353
3557
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, decorators: [{
|
|
1354
3558
|
type: Component,
|
|
1355
|
-
args: [{ selector: 'lib-caller-id-dialog', template: "<div class=\"main-theme {{storedTheme}}\">\
|
|
1356
|
-
}], ctorParameters: function () {
|
|
3559
|
+
args: [{ selector: 'lib-caller-id-dialog', template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>", styles: ["::ng-deep .mat-dialog-container{padding:0!important;border-radius:8px;box-shadow:0 4px 10px #0003;text-align:center}::ng-deep .cus-dialog{z-index:111111!important}.btn-black-outline{border:1px solid #000000;border-radius:10px}.btn-blue{background-color:#234de8;color:#fff!important;margin-left:8px}::ng-deep .cdk-overlay-container{z-index:111111}\n"] }]
|
|
3560
|
+
}], ctorParameters: function () {
|
|
3561
|
+
return [{ type: i5.Router }, { type: TwilioService }, { type: i3$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
3562
|
+
type: Inject,
|
|
3563
|
+
args: [MAT_DIALOG_DATA]
|
|
3564
|
+
}] }];
|
|
3565
|
+
} });
|
|
1357
3566
|
|
|
1358
3567
|
class DialboxModule {
|
|
1359
3568
|
}
|
|
@@ -1364,14 +3573,19 @@ DialboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version:
|
|
|
1364
3573
|
IncomingCallComponent], imports: [CommonModule,
|
|
1365
3574
|
FormsModule,
|
|
1366
3575
|
ReactiveFormsModule,
|
|
1367
|
-
HttpClientModule
|
|
3576
|
+
HttpClientModule,
|
|
3577
|
+
RouterLink,
|
|
3578
|
+
RouterModule,
|
|
3579
|
+
BrowserModule], exports: [DialboxComponent,
|
|
1368
3580
|
IncomingCallComponent,
|
|
1369
3581
|
CallProgressComponent,
|
|
1370
3582
|
CallerIdDialogComponent] });
|
|
1371
3583
|
DialboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, imports: [CommonModule,
|
|
1372
3584
|
FormsModule,
|
|
1373
3585
|
ReactiveFormsModule,
|
|
1374
|
-
HttpClientModule
|
|
3586
|
+
HttpClientModule,
|
|
3587
|
+
RouterModule,
|
|
3588
|
+
BrowserModule] });
|
|
1375
3589
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxModule, decorators: [{
|
|
1376
3590
|
type: NgModule,
|
|
1377
3591
|
args: [{
|
|
@@ -1379,19 +3593,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1379
3593
|
DialboxComponent,
|
|
1380
3594
|
CallProgressComponent,
|
|
1381
3595
|
CallerIdDialogComponent,
|
|
1382
|
-
IncomingCallComponent
|
|
3596
|
+
IncomingCallComponent,
|
|
1383
3597
|
],
|
|
1384
3598
|
imports: [
|
|
1385
3599
|
CommonModule,
|
|
1386
3600
|
FormsModule,
|
|
1387
3601
|
ReactiveFormsModule,
|
|
1388
|
-
HttpClientModule
|
|
3602
|
+
HttpClientModule,
|
|
3603
|
+
RouterLink,
|
|
3604
|
+
RouterModule,
|
|
3605
|
+
BrowserModule
|
|
1389
3606
|
],
|
|
1390
3607
|
exports: [
|
|
1391
3608
|
DialboxComponent,
|
|
1392
3609
|
IncomingCallComponent,
|
|
1393
3610
|
CallProgressComponent,
|
|
1394
|
-
CallerIdDialogComponent
|
|
3611
|
+
CallerIdDialogComponent,
|
|
1395
3612
|
]
|
|
1396
3613
|
}]
|
|
1397
3614
|
}] });
|
|
@@ -1404,5 +3621,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1404
3621
|
* Generated bundle index. Do not edit.
|
|
1405
3622
|
*/
|
|
1406
3623
|
|
|
1407
|
-
export { CallProgressComponent, CallerIdDialogComponent, DialboxComponent, DialboxModule,
|
|
3624
|
+
export { CallProgressComponent, CallerIdDialogComponent, DialboxComponent, DialboxModule, IncomingCallComponent };
|
|
1408
3625
|
//# sourceMappingURL=vgroup-dialbox.mjs.map
|