@vgroup/dialbox 0.0.76 → 0.0.77

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.
@@ -2241,11 +2241,110 @@ class DialboxComponent {
2241
2241
  // ngOnChange() {
2242
2242
  // this.initializeTwilio();
2243
2243
  // }
2244
+ // ngOnInit() {
2245
+ // try {
2246
+ // this.getContactList();
2247
+ // this.getUserCallSetting();
2248
+ // // Subscribe to dial number events
2249
+ // const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact: any) => {
2250
+ // if (contact.number) {
2251
+ // this.isSmartDialCall = false;
2252
+ // if (contact.isDialFromHistory) {
2253
+ // //handle dialing from history page
2254
+ // if(contact.callerId == 'smartDialing'){
2255
+ // this.selectedCallerId = { number: contact.from };
2256
+ // this.isSmartDialCall = true;
2257
+ // setTimeout(() => {
2258
+ // this.isDialpadHidden = false;
2259
+ // }, 2000);
2260
+ // this.callData.phone = contact.number;
2261
+ // this.callData.name = contact.name;
2262
+ // this.callData.img = contact.img;
2263
+ // this.callData.from = contact.from;
2264
+ // this.sanitizedNum = contact.number;
2265
+ // this.getUserInformation(contact);
2266
+ // // this.incomingCallsList.push(contact)
2267
+ // this.initiateCall();
2268
+ // }else{
2269
+ // this.getUserCallSetting();
2270
+ // setTimeout(() => {
2271
+ // this.isDialpadHidden = false;
2272
+ // }, 1000);
2273
+ // this.getUserInformation(contact);
2274
+ // // this.incomingCallsList.push(contact)
2275
+ // this.dialedNumber = contact.number;
2276
+ // this.sanitizedNum = contact.number;
2277
+ // }
2278
+ // } else {
2279
+ // if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
2280
+ // this.getUserCallSetting();
2281
+ // setTimeout(() => {
2282
+ // this.isDialpadHidden = false;
2283
+ // }, 1000);
2284
+ // this.dialedNumber = contact.number;
2285
+ // this.sanitizedNum = contact.number;
2286
+ // } else {
2287
+ // setTimeout(() => {
2288
+ // this.isDialpadHidden = false;
2289
+ // }, 2000);
2290
+ // this.callData.phone = contact.number;
2291
+ // this.callData.name = contact.name;
2292
+ // this.callData.img = contact.img;
2293
+ // this.sanitizedNum = contact.number;
2294
+ // this.initiateCall();
2295
+ // }
2296
+ // }
2297
+ // }
2298
+ // })
2299
+ // // handle incoming call
2300
+ // const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
2301
+ // // if (incomingCallData) {
2302
+ // // this.isCallInProgress = true;
2303
+ // // this.isDialpadHidden = false;
2304
+ // // this.callData.phone = incomingCallData.parameters.From;
2305
+ // // this.callData.name = incomingCallData.customParameters.get('name');
2306
+ // // this.callData.img = incomingCallData.customParameters.get('image');
2307
+ // // this.callData.isIncomingCall = true;
2308
+ // // }
2309
+ // if (incomingCallData) {
2310
+ // if (this.isCallInProgress) {
2311
+ // this.newIncomingCalls.push(incomingCallData);
2312
+ // this.getUserInformation(incomingCallData);
2313
+ // } else {
2314
+ // this.isCallInProgress = true;
2315
+ // this.isDialpadHidden = false;
2316
+ // this.callData.phone = incomingCallData.parameters['From'];
2317
+ // this.getUserInformation(incomingCallData);
2318
+ // this.callData.name = incomingCallData.customParameters.get('name');
2319
+ // this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
2320
+ // this.callData.isIncomingCall = true;
2321
+ // }
2322
+ // incomingCallData.on('cancel', () => {
2323
+ // this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
2324
+ // if(this.incomingCallsList.length == 0){
2325
+ // this.isCallInProgress = false;
2326
+ // }
2327
+ // });
2328
+ // incomingCallData.on('disconnect', () => {
2329
+ // this.incomingCallsList = this.incomingCallsList.filter((item: any) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
2330
+ // if(this.incomingCallsList.length == 0){
2331
+ // this.isCallInProgress = false;
2332
+ // }
2333
+ // });
2334
+ // }
2335
+ // });
2336
+ // this.subscriptions.add(sub1);
2337
+ // this.subscriptions.add(sub2);
2338
+ // }catch(e){
2339
+ // console.log(e)
2340
+ // }
2341
+ // }
2244
2342
  ngOnInit() {
2245
2343
  try {
2344
+ this.token = localStorage.getItem('ext_token') || '';
2345
+ //this.isCallInProgress = true;
2246
2346
  this.getContactList();
2247
2347
  this.getUserCallSetting();
2248
- // Subscribe to dial number events
2249
2348
  const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
2250
2349
  if (contact.number) {
2251
2350
  this.isSmartDialCall = false;
@@ -2316,7 +2415,7 @@ class DialboxComponent {
2316
2415
  }
2317
2416
  else {
2318
2417
  this.isCallInProgress = true;
2319
- this.isDialpadHidden = true;
2418
+ this.isDialpadHidden = false;
2320
2419
  this.callData.phone = incomingCallData.parameters['From'];
2321
2420
  this.getUserInformation(incomingCallData);
2322
2421
  this.callData.name = incomingCallData.customParameters.get('name');
@@ -2324,13 +2423,13 @@ class DialboxComponent {
2324
2423
  this.callData.isIncomingCall = true;
2325
2424
  }
2326
2425
  incomingCallData.on('cancel', () => {
2327
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
2426
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
2328
2427
  if (this.incomingCallsList.length == 0) {
2329
2428
  this.isCallInProgress = false;
2330
2429
  }
2331
2430
  });
2332
2431
  incomingCallData.on('disconnect', () => {
2333
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== incomingCallData.parameters['CallSid']);
2432
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== incomingCallData.parameters['CallSid']);
2334
2433
  if (this.incomingCallsList.length == 0) {
2335
2434
  this.isCallInProgress = false;
2336
2435
  }