@vgroup/dialbox 0.0.6 → 0.0.8

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.
@@ -1,19 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
3
3
  import { AsYouType } from 'libphonenumber-js';
4
- import { BehaviorSubject, throwError, Subscription, interval } from 'rxjs';
4
+ import { BehaviorSubject, throwError, interval, Subscription } from 'rxjs';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
7
7
  import { catchError, switchMap, map } from 'rxjs/operators';
8
8
  import * as i4 from '@angular/router';
9
9
  import { RouterLink } from '@angular/router';
10
- import * as i5 from '@angular/common';
10
+ import * as i3 from '@angular/common';
11
11
  import { CommonModule } from '@angular/common';
12
- import * as i6 from '@angular/forms';
12
+ import * as i3$1 from '@angular/forms';
13
13
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
14
14
  import { Device } from '@twilio/voice-sdk';
15
15
  import swal from 'sweetalert2';
16
- import * as i3 from '@angular/material/dialog';
16
+ import * as i3$2 from '@angular/material/dialog';
17
17
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
18
18
 
19
19
  const keypad = [
@@ -1417,1576 +1417,1578 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1417
1417
  }]
1418
1418
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: IpAddressService }]; } });
1419
1419
 
1420
- class DialboxComponent {
1421
- constructor(twilioService, extService,
1422
- // private dialog: MatDialog,
1423
- ipService, extensionService, router) {
1424
- this.twilioService = twilioService;
1425
- this.extService = extService;
1426
- this.ipService = ipService;
1420
+ const GlobalConstant = {
1421
+ ErrorMsg500: "Unable to process request. Please try again later.",
1422
+ isSMSVisible: true,
1423
+ dedicatedNumText: 'C2C Number'
1424
+ };
1425
+
1426
+ class IncomingCallComponent {
1427
+ constructor(extensionService, twilioService) {
1427
1428
  this.extensionService = extensionService;
1428
- this.router = router;
1429
- this.isDialpadHidden = false;
1430
- this.closeDialpadEvent = new EventEmitter();
1431
- this.callInitiated = new EventEmitter();
1432
- this.endCallEvent = new EventEmitter();
1433
- this.minimiseEvent = new EventEmitter();
1434
- this.incomingCallsNewInfoEvent = new EventEmitter();
1435
- this.incomingCallInitiated = new EventEmitter();
1436
- this.numberDialed = new EventEmitter();
1437
- this.isCallInProgress = false;
1438
- this.keypadVal = keypad;
1439
- this.showInputClearBtn = false;
1440
- this.dialedNumber = '';
1441
- this.contactList = [];
1442
- this.filteredContactList = [];
1443
- this.callerIdList = [];
1444
- this.isCallerIdHidden = true;
1445
- this.isTrialPeriodOver = false;
1446
- this.isPaymentDue = false;
1447
- this.terminateCall = false;
1448
- this.toastTimeout = 7000;
1449
- this.callNumberToast = {
1450
- show: false,
1451
- type: 'alert-success',
1452
- number: '',
1453
- displayNum: ''
1454
- };
1455
- this.callData = {
1456
- phone: '',
1457
- displayNum: '',
1458
- dial: false,
1459
- name: '',
1460
- img: 'assets/images/user.jpg',
1461
- isIncomingCall: false,
1462
- extNum: ''
1463
- };
1464
- this.lastDialed = null;
1465
- this.dialAlert = {
1466
- msg: '',
1467
- show: false
1468
- };
1469
- this.showDedicatedPopup = false;
1470
- this.newIncomingCalls = [];
1471
- this.incomingCallsList = [];
1472
- this.subscriptions = new Subscription();
1473
- this.shakeDedicatedBtn = false;
1474
- this.isSmartDialCall = false;
1475
- this.isMinimised = false;
1429
+ this.twilioService = twilioService;
1430
+ this.showRingAnimation = true;
1431
+ this.selectedIncomingCall = {};
1432
+ this.twilioAuthId = '';
1433
+ this.dedicatedNum = '';
1434
+ this.recordCall = false;
1435
+ this.shouldRecordCall = false;
1436
+ this.isClickExpand = false;
1437
+ this.disbaleEndCallBtn = true;
1438
+ this.closeIncomingCallDiv = new EventEmitter();
1439
+ this.incomingCallsNewList = new EventEmitter();
1440
+ this.selectedIncomingCallInfo = new EventEmitter();
1441
+ this.isMute = false;
1476
1442
  }
1477
1443
  ngOnInit() {
1478
1444
  try {
1479
- this.token = localStorage.getItem('ext_token');
1480
- //this.isCallInProgress = true;
1481
- this.getContactList();
1482
- // this.getUserCallSetting();
1483
- const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
1484
- if (contact.number) {
1485
- this.isSmartDialCall = false;
1486
- if (contact.isDialFromHistory) {
1487
- //handle dialing from history page
1488
- if (contact.callerId == 'smartDialing') {
1489
- this.selectedCallerId = { number: contact.from };
1490
- this.isSmartDialCall = true;
1491
- setTimeout(() => {
1492
- this.isDialpadHidden = false;
1493
- }, 2000);
1494
- this.callData.phone = contact.number;
1495
- this.callData.name = contact.name;
1496
- this.callData.img = contact.img;
1497
- this.callData.from = contact.from;
1498
- this.sanitizedNum = contact.number;
1499
- // this.getUserInformation(contact);
1500
- // this.incomingCallsList.push(contact)
1501
- this.initiateCall();
1502
- }
1503
- else {
1504
- // this.getUserCallSetting();
1505
- setTimeout(() => {
1506
- this.isDialpadHidden = false;
1507
- }, 1000);
1508
- // this.getUserInformation(contact);
1509
- // this.incomingCallsList.push(contact)
1510
- this.dialedNumber = contact.number;
1511
- this.sanitizedNum = contact.number;
1512
- }
1513
- }
1514
- else {
1515
- if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
1516
- // this.getUserCallSetting();
1517
- setTimeout(() => {
1518
- this.isDialpadHidden = false;
1519
- }, 1000);
1520
- this.dialedNumber = contact.number;
1521
- this.sanitizedNum = contact.number;
1522
- }
1523
- else {
1524
- setTimeout(() => {
1525
- this.isDialpadHidden = false;
1526
- }, 2000);
1527
- this.callData.phone = contact.number;
1528
- this.callData.name = contact.name;
1529
- this.callData.img = contact.img;
1530
- this.sanitizedNum = contact.number;
1531
- this.initiateCall();
1532
- }
1533
- }
1534
- }
1535
- });
1536
- // handle incoming call
1537
- const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
1538
- // if (incomingCallData) {
1539
- // this.isCallInProgress = true;
1540
- // this.isDialpadHidden = false;
1541
- // this.callData.phone = incomingCallData.parameters.From;
1542
- // this.callData.name = incomingCallData.customParameters.get('name');
1543
- // this.callData.img = incomingCallData.customParameters.get('image');
1544
- // this.callData.isIncomingCall = true;
1545
- // }
1546
- if (incomingCallData) {
1547
- if (this.isCallInProgress) {
1548
- this.newIncomingCalls.push(incomingCallData);
1549
- // this.getUserInformation(incomingCallData);
1550
- }
1551
- else {
1552
- this.isCallInProgress = true;
1553
- this.isDialpadHidden = false;
1554
- this.callData.phone = incomingCallData.parameters['From'];
1555
- // this.getUserInformation(incomingCallData);
1556
- this.callData.name = incomingCallData.customParameters.get('name');
1557
- this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
1558
- this.callData.isIncomingCall = true;
1445
+ this.twilioService.currentCall.subscribe(call => {
1446
+ if (call) {
1447
+ this.twilioCallData = call;
1448
+ this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
1449
+ if (!call.parameters) {
1450
+ call.parameters = {};
1559
1451
  }
1560
- incomingCallData.on('cancel', () => {
1561
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1562
- if (this.incomingCallsList.length == 0) {
1563
- this.isCallInProgress = false;
1452
+ this.sendIPforIncomingCall(this.twilioAuthId, '');
1453
+ call.on('cancel', () => {
1454
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1455
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1564
1456
  }
1457
+ this.rejectCallFromList(call);
1565
1458
  });
1566
- incomingCallData.on('disconnect', () => {
1567
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1568
- if (this.incomingCallsList.length == 0) {
1569
- this.isCallInProgress = false;
1459
+ call.on('disconnect', () => {
1460
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1461
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1570
1462
  }
1463
+ this.rejectCallFromList(call);
1571
1464
  });
1572
1465
  }
1573
1466
  });
1574
- this.subscriptions.add(sub1);
1575
- this.subscriptions.add(sub2);
1576
1467
  }
1577
1468
  catch (e) {
1578
1469
  console.log(e);
1579
1470
  }
1580
1471
  }
1581
- // getUserInformation(incomingCallData: any) {
1582
- // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1583
- // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
1584
- // response => {
1585
- // incomingCallData['userInfo']=response
1586
- // this.incomingCallsList.push(incomingCallData);
1587
- // }, error => {
1588
- // console.error('Error starting recording', error);
1589
- // });
1590
- // }
1591
- fromEntries(entries) {
1592
- return entries.reduce((acc, [key, value]) => {
1593
- acc[key] = value;
1594
- return acc;
1595
- }, {});
1596
- }
1597
- ngAfterViewInit() {
1598
- this.registerDragElement();
1472
+ acceptCallFromList(data) {
1473
+ console.log(data, 'checking dii');
1474
+ data.accept();
1475
+ // data.parameters['isCallConnected'] = true;
1476
+ data.isCallConnected = true;
1477
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
1478
+ if (this.shouldRecordCall) { // default recording
1479
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1480
+ this.closeIncomingCallWrapper(1);
1481
+ }
1482
+ else { // manual recording
1483
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1484
+ this.closeIncomingCallWrapper(1);
1485
+ }
1486
+ });
1599
1487
  }
1600
- ngOnChanges(changes) {
1601
- if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
1602
- this.getContactList();
1603
- // this.getUserCallSetting();
1604
- setTimeout(() => {
1605
- this.dialInputElement.nativeElement.focus();
1606
- }, 0);
1488
+ rejectCallFromList(data) {
1489
+ if (!data)
1490
+ return;
1491
+ if (data.reject)
1492
+ data.reject();
1493
+ if (data.disconnect)
1494
+ data.disconnect();
1495
+ if (data.parameters) {
1496
+ data.parameters['isCallConnected'] = false; // Should be false when rejecting
1497
+ }
1498
+ if (data.customParameters) {
1499
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
1500
+ }
1501
+ if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
1502
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
1503
+ this.incomingCallsNewList.emit(this.newIncomingCallsList);
1504
+ if (this.newIncomingCallsList.length == 0) {
1505
+ this.closeIncomingCallDiv.emit({ show: 0, call: data });
1506
+ }
1607
1507
  }
1608
1508
  }
1609
- registerDragElement() {
1610
- try {
1611
- const elmnt = document.getElementById('dragparent1');
1612
- let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
1613
- const dragMouseDown = (e) => {
1614
- // If the target is an input, return and don't initiate dragging
1615
- if (e.target.tagName.toLowerCase() === 'input') {
1616
- return;
1617
- }
1618
- e = e || window.event;
1619
- // get the mouse cursor position at startup:
1620
- pos3 = e.clientX;
1621
- pos4 = e.clientY;
1622
- document.onmouseup = closeDragElement;
1623
- // call a function whenever the cursor moves:
1624
- document.onmousemove = elementDrag;
1625
- };
1626
- const elementDrag = (e) => {
1627
- e = e || window.event;
1628
- // calculate the new cursor position:
1629
- pos1 = pos3 - e.clientX;
1630
- pos2 = pos4 - e.clientY;
1631
- pos3 = e.clientX;
1632
- pos4 = e.clientY;
1633
- // set the element's new position:
1634
- // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
1635
- // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
1636
- };
1637
- const closeDragElement = () => {
1638
- /* stop moving when mouse button is released:*/
1639
- document.onmouseup = null;
1640
- document.onmousemove = null;
1641
- };
1642
- // if (document.getElementById(elmnt.id + 'header')) {
1643
- // /* if present, the header is where you move the DIV from:*/
1644
- // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
1645
- // } else {
1646
- // /* otherwise, move the DIV from anywhere inside the DIV:*/
1647
- // elmnt.onmousedown = dragMouseDown;
1648
- // }
1649
- }
1650
- catch (e) {
1651
- console.log(e);
1652
- }
1509
+ closeIncomingCallWrapper(val) {
1510
+ this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
1653
1511
  }
1654
- addNumber(num) {
1655
- if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
1656
- if (num == '#') {
1657
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1658
- }
1659
- else if (num == '*') {
1660
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1661
- }
1662
- else {
1663
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1664
- }
1665
- this.dialedNumber += num;
1666
- this.showInputClearBtn = true;
1667
- this.numberDialed.emit(this.dialedNumber);
1668
- this.onDialInputChange(this.dialedNumber);
1669
- // this.dialInputRef.nativeElement.focus();
1670
- }
1671
- else if (num === 'voicemail') {
1672
- // this.showDedicatedPopup = true;
1673
- this.router.navigate(['extension/voicemail/' + this.token]);
1674
- }
1512
+ toggleMute(data) {
1513
+ this.isMute = !this.isMute;
1514
+ data.mute(this.isMute);
1675
1515
  }
1676
- hideDialpad() {
1677
- this.isDialpadHidden = true;
1678
- this.closeDialpadEvent.emit();
1679
- this.clearAllDialed();
1680
- this.filteredContactList = [];
1516
+ sendIPforIncomingCall(recordId, callstatus) {
1517
+ return new Promise((resolve, reject) => {
1518
+ this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
1519
+ const resp = res;
1520
+ if (res.status == 200) {
1521
+ if (resp.callAuth) {
1522
+ this.CallSid = resp.callAuth.callSid;
1523
+ this.recordCall = resp.callAuth.recordCall;
1524
+ // Handle the recordCall flag
1525
+ if (resp.callAuth.recordCall) {
1526
+ this.shouldRecordCall = true;
1527
+ }
1528
+ else {
1529
+ this.shouldRecordCall = false;
1530
+ }
1531
+ }
1532
+ else {
1533
+ // swal("Error", "Missing call authentication details.", "error");
1534
+ }
1535
+ resolve();
1536
+ }
1537
+ else {
1538
+ swal("Error", resp.message.join("<br/>"), "error");
1539
+ resolve();
1540
+ }
1541
+ }, (error) => {
1542
+ swal("Error", GlobalConstant.ErrorMsg500, "error");
1543
+ resolve();
1544
+ });
1545
+ });
1681
1546
  }
1682
- onDialInputChange(inputVal) {
1683
- try {
1684
- // Updated regex to include x, X, ext., Ext., and ,
1685
- const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
1686
- let mainNumber = inputVal;
1687
- // Check for extension indicators and split the input
1688
- const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
1689
- if (extMatch) {
1690
- mainNumber = inputVal.substring(0, extMatch.index).trim();
1691
- this.callData.extNum = extMatch[2].trim();
1692
- }
1693
- this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
1694
- this.callData.phone = isNumericInput ? this.sanitizedNum : '';
1695
- this.showInputClearBtn = inputVal.length > 0;
1696
- if (isNumericInput) {
1697
- this.dialedNumber = new AsYouType().input(this.sanitizedNum);
1698
- }
1699
- // emit current number whenever input changes
1700
- this.numberDialed.emit(this.dialedNumber);
1701
- if (inputVal.length > 2) {
1702
- this.filteredContactList = this.contactList.filter(contact => {
1703
- const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
1704
- // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
1705
- }).slice(0, 2);
1547
+ onUserInfoByCallSid() {
1548
+ if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
1549
+ }
1550
+ return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
1551
+ }
1552
+ onClickExpand(data) {
1553
+ if (this.selectedIncomingCall === data && this.isClickExpand) {
1554
+ this.isClickExpand = false;
1555
+ this.selectedIncomingCall = null;
1556
+ this.selectedIncomingCallInfo.emit({});
1557
+ return;
1558
+ }
1559
+ this.isClickExpand = true;
1560
+ this.selectedIncomingCall = data;
1561
+ if (this.selectedIncomingCall) {
1562
+ this.selectedIncomingCall['isClickExpand'] = true;
1563
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
1564
+ this.newIncomingCallsList.forEach((call) => {
1565
+ if (call !== this.selectedIncomingCall) {
1566
+ call['isClickExpand'] = false;
1567
+ }
1568
+ });
1706
1569
  }
1707
- else {
1708
- this.filteredContactList = [];
1570
+ this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
1571
+ if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
1572
+ this.getUserInformation(this.selectedIncomingCall);
1709
1573
  }
1710
1574
  }
1711
- catch (e) {
1712
- console.log(e);
1713
- }
1714
1575
  }
1715
- getFirstLetter(name) {
1716
- return name ? name.charAt(0).toUpperCase() : '';
1576
+ getUserInformation(incomingCallData) {
1577
+ let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1578
+ this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
1579
+ setTimeout(() => {
1580
+ incomingCallData['userInfo'] = response;
1581
+ }, 5000);
1582
+ }, error => {
1583
+ console.error('Error starting recording', error);
1584
+ });
1717
1585
  }
1718
- clearInput() {
1719
- if (this.dialedNumber.length > 0) {
1720
- this.dialedNumber = this.dialedNumber.slice(0, -1);
1721
- this.showInputClearBtn = this.dialedNumber.length !== 0;
1722
- this.onDialInputChange(this.dialedNumber);
1723
- }
1586
+ fromEntries(entries) {
1587
+ return entries.reduce((acc, [key, value]) => {
1588
+ acc[key] = value;
1589
+ return acc;
1590
+ }, {});
1724
1591
  }
1725
- clearAllDialed() {
1726
- this.dialedNumber = '';
1727
- this.sanitizedNum = '';
1728
- this.showInputClearBtn = false;
1592
+ }
1593
+ IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
1594
+ IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *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]=\"incomingCallData.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\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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 <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?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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:385px;height:646px;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:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
1596
+ type: Component,
1597
+ args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *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]=\"incomingCallData.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\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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 <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?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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:385px;height:646px;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:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.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"] }]
1598
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
1599
+ type: Input
1600
+ }], newIncomingCallsList: [{
1601
+ type: Input
1602
+ }], closeIncomingCallDiv: [{
1603
+ type: Output
1604
+ }], incomingCallsNewList: [{
1605
+ type: Output
1606
+ }], selectedIncomingCallInfo: [{
1607
+ type: Output
1608
+ }] } });
1609
+
1610
+ class CallProgressComponent {
1611
+ constructor(extensionService, cdr) {
1612
+ this.extensionService = extensionService;
1613
+ this.cdr = cdr;
1614
+ this.endCallEvent = new EventEmitter();
1615
+ this.incomingCallsNewInfo = new EventEmitter();
1616
+ this.minimiseEvent = new EventEmitter();
1617
+ this.showRingAnimation = false;
1618
+ this.timer = '00:00';
1619
+ this.showKeypad = false;
1620
+ this.keypadVal = keypad;
1621
+ this.callInput = '';
1622
+ this.isMute = false;
1623
+ this.disbaleEndCallBtn = true;
1624
+ this.showClearBtn = false;
1625
+ this.isCollops = false;
1626
+ // Incoming call variables
1627
+ this.incomingCallDiv = false;
1628
+ this.showCallProgressEvent = new EventEmitter();
1629
+ this.incomingCallInitiated = new EventEmitter();
1630
+ this.isRecording = false;
1631
+ this.isPaused = false;
1632
+ this.timeElapsed = 0; // in seconds
1633
+ this.recordCall = false;
1634
+ this.callStatus = 'ringing';
1635
+ this.isMinimised = false;
1729
1636
  }
1730
- getCallerIdList() {
1731
- this.extService.displayID(this.token || '').subscribe((res) => {
1732
- //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
1733
- this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
1734
- // this.callerIdList = res.callerIdList;
1735
- if (this.callerIdList.length == 1) {
1736
- this.selectedCallerId = this.callerIdList[0];
1637
+ ngOnInit() {
1638
+ console.log('Call Progress Component');
1639
+ }
1640
+ ngOnChanges(changes) {
1641
+ console.log('Call Progress Component ngOnChanges');
1642
+ if (changes['callData']) {
1643
+ console.log('Call Progress Component ngOnChanges callData', changes['callData']);
1644
+ if (changes['callData'].currentValue.isIncomingCall) {
1645
+ this.incomingCallDiv = true;
1737
1646
  }
1738
1647
  else {
1739
- if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
1740
- this.selectedCallerId = null;
1741
- }
1742
- else {
1743
- this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
1648
+ //for outgoing call
1649
+ this.startCall(changes['callData'].currentValue);
1650
+ }
1651
+ }
1652
+ if (changes['newIncomingCallData']) {
1653
+ try {
1654
+ if (changes['newIncomingCallData'].currentValue) {
1655
+ if (this.call && (this.call.status() == 'open')) {
1656
+ this.call.disconnect();
1657
+ this.call = changes['newIncomingCallData'].currentValue;
1658
+ this.call?.accept();
1659
+ this.callData.phone = this.call?.parameters['From'];
1660
+ this.callData.name = this.call?.customParameters.get('name');
1661
+ this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
1662
+ this.incomingCallInitiated.emit();
1663
+ this.startTimer();
1664
+ }
1744
1665
  }
1745
1666
  }
1746
- });
1667
+ catch (e) {
1668
+ console.log(e);
1669
+ }
1670
+ }
1747
1671
  }
1748
- getContactList() {
1749
- this.twilioService.getContactList().subscribe((resp) => {
1750
- if (resp.response == 'Success') {
1751
- this.contactList = resp.phoneBook;
1672
+ ngAfterViewInit() { }
1673
+ async startCall(callData) {
1674
+ try {
1675
+ this.showRingAnimation = true;
1676
+ const payload = {
1677
+ channelId: environment.channelId,
1678
+ userId: localStorage.getItem('userId'),
1679
+ to: callData.phone,
1680
+ scope: 'local',
1681
+ fromNumber: callData.from
1682
+ };
1683
+ const response = await this.initiateCall(payload);
1684
+ if (response.status == 200) {
1685
+ const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
1686
+ this.getUserInformation(callAuthId);
1687
+ this.recordCall = recordCall; // Store the recordCall value
1688
+ const tokenData = await this.getOutgoingCallToken(callAuthId);
1689
+ await this.connectToDevice(tokenData.token, callData);
1690
+ // Poll the status for 30-45 seconds
1691
+ this.pollCallStatus(callAuthId);
1752
1692
  }
1753
- }, err => {
1693
+ else if (response.status == 201) {
1694
+ swal("Error", response.message.join("<br/>"), "error");
1695
+ this.endCall();
1696
+ }
1697
+ }
1698
+ catch (error) {
1699
+ this.showRingAnimation = false;
1700
+ this.handleError(error);
1701
+ this.endCall();
1702
+ }
1703
+ }
1704
+ async initiateCall(payload) {
1705
+ return await this.extensionService.initiateCall(payload).toPromise();
1706
+ }
1707
+ async getCallAuthId(response) {
1708
+ return {
1709
+ id: response.callauth.id,
1710
+ recordCall: response.callauth.recordCall
1711
+ };
1712
+ }
1713
+ async getOutgoingCallToken(callAuthId) {
1714
+ return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
1715
+ }
1716
+ async connectToDevice(token, callData) {
1717
+ const options = {
1718
+ codecPreferences: ['opus', 'pcmu'],
1719
+ closeProtection: true,
1720
+ };
1721
+ this.device = new Device(token.value, options);
1722
+ this.call = await this.device.connect({
1723
+ params: {
1724
+ From: callData.from,
1725
+ To: callData.phone,
1726
+ Env: environment.abb,
1727
+ Token: token.id,
1728
+ Ext: callData.extNum
1729
+ },
1730
+ rtcConstraints: { audio: { deviceId: 'default' } },
1731
+ });
1732
+ this.setupEventListeners();
1733
+ }
1734
+ setupEventListeners() {
1735
+ this.startTimer();
1736
+ this.device?.on('error', (err) => {
1754
1737
  console.log(err);
1738
+ this.showRingAnimation = false;
1739
+ this.stopTimer();
1740
+ });
1741
+ this.call?.on('error', (error) => {
1742
+ this.showRingAnimation = false;
1743
+ this.stopTimer();
1744
+ });
1745
+ this.call?.on('disconnect', () => {
1746
+ this.endCall();
1747
+ });
1748
+ this.call?.on('ringing', () => {
1749
+ });
1750
+ this.call?.on('reject', () => {
1751
+ this.endCall();
1752
+ });
1753
+ this.call?.on('accept', () => {
1754
+ this.showRingAnimation = false;
1755
+ this.disbaleEndCallBtn = false;
1756
+ // Start recording if recordCall is true and call is accepted for 30 seconds
1757
+ // if (this.recordCall) {
1758
+ // setTimeout(() => {
1759
+ // if (this.isRecording) return; // If already recording, skip
1760
+ // this.startRecording();
1761
+ // }, 30000);
1762
+ // } else {
1763
+ // this.stopRecording();
1764
+ // }
1765
+ });
1766
+ this.call?.on('messageReceived', (message) => {
1755
1767
  });
1756
1768
  }
1757
- getFullName(contact) {
1758
- let fullName = contact.firstName || '';
1759
- if (contact.middleName) {
1760
- fullName += ` ${contact.middleName}`;
1761
- }
1762
- if (contact.lastName) {
1763
- fullName += ` ${contact.lastName}`;
1764
- }
1765
- return fullName.trim();
1769
+ startTimer() {
1770
+ let seconds = 0;
1771
+ this.intervalId = setInterval(() => {
1772
+ seconds++;
1773
+ this.timer = this.formatTime(seconds);
1774
+ }, 1000);
1766
1775
  }
1767
- toggleCallerIdDiv() {
1768
- this.isCallerIdHidden = !this.isCallerIdHidden;
1776
+ stopTimer() {
1777
+ clearInterval(this.intervalId);
1778
+ this.timer = '00:00';
1769
1779
  }
1770
- onContactSelect(contact) {
1771
- this.dialedNumber = contact.numbersList[0].number;
1772
- this.callData.name = this.getFullName(contact);
1773
- this.callData.img = contact.image || 'assets/images/user.jpg';
1774
- this.onDialInputChange(this.dialedNumber);
1775
- this.filteredContactList = [];
1780
+ formatTime(totalSeconds) {
1781
+ const minutes = Math.floor(totalSeconds / 60);
1782
+ const seconds = totalSeconds % 60;
1783
+ return `${this.pad(minutes)}:${this.pad(seconds)}`;
1784
+ }
1785
+ pad(value) {
1786
+ return value < 10 ? `0${value}` : `${value}`;
1787
+ }
1788
+ handleError(error) {
1789
+ swal("Error", error, "error");
1776
1790
  }
1777
1791
  endCall() {
1792
+ this.endCallEvent.emit();
1793
+ if (this.call) {
1794
+ this.call.disconnect();
1795
+ }
1796
+ this.showRingAnimation = false;
1797
+ this.stopTimer();
1798
+ this.maximiseDialpad();
1799
+ }
1800
+ toggleMute() {
1801
+ this.isMute = !this.isMute;
1802
+ this.call?.mute(this.isMute);
1803
+ }
1804
+ toggleKeypad() {
1805
+ this.showKeypad = !this.showKeypad;
1806
+ this.callInput = '';
1807
+ }
1808
+ onCallInputs(num) {
1778
1809
  try {
1779
- console.log('Ending call');
1780
- this.isCallInProgress = false;
1781
- this.filteredContactList = [];
1782
- // Reset call data
1783
- this.callData = {
1784
- phone: '',
1785
- name: '',
1786
- img: 'assets/images/user.jpg',
1787
- isIncomingCall: false,
1788
- dial: false,
1789
- displayNum: '',
1790
- extNum: ''
1791
- };
1792
- // Reset dialed number
1793
- this.dialedNumber = '';
1794
- this.sanitizedNum = '';
1795
- // Emit end call event
1796
- this.endCallEvent.emit();
1797
- console.log('Call ended successfully');
1810
+ if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
1811
+ if (num == '#') {
1812
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1813
+ }
1814
+ else if (num == '*') {
1815
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1816
+ }
1817
+ else {
1818
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1819
+ }
1820
+ this.callInput = this.callInput + String(num);
1821
+ this.showClearBtn = true;
1822
+ }
1823
+ let str = String(num);
1824
+ this.call?.sendDigits(str);
1798
1825
  }
1799
- catch (error) {
1800
- console.error('Error in endCall:', error);
1801
- // Even if there's an error, try to reset the state
1802
- this.isCallInProgress = false;
1803
- this.callData = {
1804
- phone: '',
1805
- name: '',
1806
- img: 'assets/images/user.jpg',
1807
- isIncomingCall: false,
1808
- dial: false,
1809
- displayNum: '',
1810
- extNum: ''
1811
- };
1826
+ catch (e) {
1827
+ console.log(e);
1828
+ }
1829
+ }
1830
+ onCallInputEnter(ev) {
1831
+ try {
1832
+ this.call?.sendDigits(String(ev.key));
1833
+ }
1834
+ catch (e) {
1835
+ console.log(e);
1836
+ }
1837
+ }
1838
+ closeIncomingCall(data) {
1839
+ // this.incomingCallDiv = false;
1840
+ if (data.show) {
1841
+ //this.showCallProgressEvent.emit()
1842
+ // handle incoming call accepted
1843
+ this.startTimer();
1844
+ this.disbaleEndCallBtn = false;
1845
+ this.call = data.call;
1846
+ const incomingDetail = this.extensionService.getCallSid();
1847
+ this.incomingRecordCall = incomingDetail.recordCall;
1848
+ // Start recording if the call is answered and recording is enabled
1849
+ if (this.incomingRecordCall) {
1850
+ this.startRecording();
1851
+ }
1852
+ else {
1853
+ this.isRecording = false;
1854
+ }
1855
+ this.cdr.detectChanges();
1856
+ }
1857
+ else {
1858
+ // incoming call rejected
1812
1859
  this.endCallEvent.emit();
1813
1860
  }
1814
1861
  }
1815
- // async initiateCall() {
1816
- // try {
1817
- // console.log('Initiating call with number:', this.dialedNumber);
1818
- // if (!this.dialedNumber && this.lastDialed) {
1819
- // console.log('Using last dialed number:', this.lastDialed.number);
1820
- // this.sanitizedNum = this.lastDialed.number;
1821
- // }
1822
- // const isInvalid = await this.isInvalidNumber();
1823
- // if (isInvalid) {
1824
- // console.error('Invalid number format');
1825
- // return false;
1826
- // }
1827
- // this.saveLastDialed();
1828
- // this.isSavedContactDialled();
1829
- // // Check payment status
1830
- // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
1831
- // if (this.isPaymentDue) {
1832
- // console.warn('Payment is due');
1833
- // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
1834
- // return false;
1835
- // }
1836
- // // Check if dialing own number
1837
- // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
1838
- // console.error('Attempted to dial own number');
1839
- // swal('Error', 'You cannot dial your own number');
1840
- // return false;
1841
- // }
1842
- // // Check microphone permissions
1843
- // const hasPermission = await this.checkMicrophonePermission();
1844
- // if (!hasPermission) {
1845
- // console.warn('Microphone permission not granted');
1846
- // await this.askForMicrophonePermission();
1847
- // return false;
1848
- // }
1849
- // if (!this.selectedCallerId) {
1850
- // console.error('No caller ID selected');
1851
- // this.shakeDedicatedBtn = true;
1852
- // this.showDialAlert('Please select a C2C number to call from');
1853
- // setTimeout(() => {
1854
- // this.shakeDedicatedBtn = false;
1855
- // }, 3000);
1856
- // return false;
1857
- // }
1858
- // console.log('Getting number with country code...');
1859
- // this.callData.displayNum = '';
1860
- // try {
1861
- // await this.getToNumber(this.sanitizedNum);
1862
- // } catch (error) {
1863
- // console.error('Error getting number with country code:', error);
1864
- // this.showDialAlert('Error processing number. Please try again.');
1865
- // return false;
1866
- // }
1867
- // if (this.terminateCall) {
1868
- // console.log('Call terminated by user');
1869
- // this.terminateCall = false;
1870
- // return false;
1871
- // }
1872
- // // Prepare call data
1873
- // this.callData = {
1874
- // ...this.callData,
1875
- // phone: this.sanitizedNum,
1876
- // isIncomingCall: false,
1877
- // dial: true,
1878
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1879
- // timestamp: new Date().toISOString()
1880
- // };
1881
- // console.log('Initiating call with data:', this.callData);
1882
- // this.isCallInProgress = true;
1883
- // this.callInitiated.emit({ ...this.callData });
1884
- // return true;
1885
- // } catch (error) {
1886
- // console.error('Error in initiateCall:', error);
1887
- // this.showDialAlert('Failed to initiate call. Please try again.');
1888
- // this.isCallInProgress = false;
1889
- // return false;
1890
- // }
1891
- // //this.clearAllDialed();
1892
- // // } else {
1893
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1894
- // // }
1895
- // }
1896
- // async initiateCall() {
1897
- // if (!this.dialedNumber && this.lastDialed) {
1898
- // this.sanitizedNum = this.lastDialed.number;
1899
- // }
1900
- // const isInvalid = await this.isInvalidNumber();
1901
- // if (isInvalid) {
1902
- // return false;
1903
- // }
1904
- // this.saveLastDialed();
1905
- // this.isSavedContactDialled();
1906
- // //let isCallerIdSet = await this.isCallerIdSet();
1907
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1908
- // if (this.isPaymentDue) {
1909
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1910
- // return;
1911
- // }
1912
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1913
- // // if (!this.isTrialPeriodOver) {
1914
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1915
- // swal('Error', 'You can not dial this number');
1916
- // return;
1917
- // }
1918
- // const hasPermission = await this.checkMicrophonePermission();
1919
- // if (hasPermission) {
1920
- // if (this.selectedCallerId) {
1921
- // //clear displayNum if value is binded from previous call
1922
- // this.callData.displayNum = '';
1923
- // // get number to be dialled from backend
1924
- // await this.getToNumber(this.sanitizedNum);
1925
- // if (this.terminateCall) {
1926
- // this.terminateCall = false;
1927
- // return;
1928
- // }
1929
- // this.callData.phone = this.sanitizedNum;
1930
- // this.callData.isIncomingCall = false;
1931
- // this.callData.dial = true;
1932
- // if (!this.isSmartDialCall) {
1933
- // this.callData.from = this.selectedCallerId.number;
1934
- // }
1935
- // this.isCallInProgress = true;
1936
- // this.callData = {
1937
- // ...this.callData,
1938
- // phone: this.sanitizedNum,
1939
- // isIncomingCall: false,
1940
- // dial: true,
1941
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1942
- // timestamp: new Date().toISOString()
1943
- // };
1944
- // console.log('Initiating call with data:', this.callData);
1945
- // this.isCallInProgress = true;
1946
- // this.callInitiated.emit({ ...this.callData });
1947
- // return true;
1948
- // } else {
1949
- // this.shakeDedicatedBtn = true;
1950
- // this.showDialAlert('Select a C2C number to call');
1951
- // setTimeout(() => {
1952
- // this.shakeDedicatedBtn = false;
1953
- // }, 3000);
1954
- // return false;
1955
- // }
1956
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
1957
- // } else {
1958
- // await this.askForMicrophonePermission();
1959
- // }
1960
- // //this.clearAllDialed();
1961
- // // } else {
1962
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1963
- // // }
1964
- // }
1965
- // async initiateCall() {
1966
- // try{
1967
- // if (!this.dialedNumber && this.lastDialed) {
1968
- // this.sanitizedNum = this.lastDialed.number;
1969
- // }
1970
- // const isInvalid = await this.isInvalidNumber();
1971
- // if (isInvalid) {
1972
- // return false;
1973
- // }
1974
- // this.saveLastDialed();
1975
- // this.isSavedContactDialled();
1976
- // //let isCallerIdSet = await this.isCallerIdSet();
1977
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1978
- // if (this.isPaymentDue) {
1979
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1980
- // return false;
1981
- // }
1982
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1983
- // // if (!this.isTrialPeriodOver) {
1984
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1985
- // swal('Error', 'You can not dial this number');
1986
- // return false;
1987
- // }
1988
- // const hasPermission = await this.checkMicrophonePermission();
1989
- // if (hasPermission) {
1990
- // if (this.selectedCallerId) {
1991
- // //clear displayNum if value is binded from previous call
1992
- // this.callData.displayNum = '';
1993
- // // get number to be dialled from backend
1994
- // await this.getToNumber(this.sanitizedNum);
1995
- // if (this.terminateCall) {
1996
- // this.terminateCall = false;
1997
- // return;
1998
- // }
1999
- // this.callData.phone = this.sanitizedNum;
2000
- // this.callData.isIncomingCall = false;
2001
- // this.callData.dial = true;
2002
- // if (!this.isSmartDialCall) {
2003
- // this.callData.from = this.selectedCallerId.number;
2004
- // }
2005
- // this.isCallInProgress = true;
2006
- // this.callData = {
2007
- // ...this.callData,
2008
- // phone: this.sanitizedNum,
2009
- // isIncomingCall: false,
2010
- // dial: true,
2011
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2012
- // timestamp: new Date().toISOString()
2013
- // };
2014
- // console.log('Initiating call with data:', this.callData);
2015
- // this.isCallInProgress = true;
2016
- // this.callInitiated.emit({ ...this.callData });
2017
- // return true;
2018
- // } else {
2019
- // this.shakeDedicatedBtn = true;
2020
- // this.showDialAlert('Select a C2C number to call');
2021
- // setTimeout(() => {
2022
- // this.shakeDedicatedBtn = false;
2023
- // }, 3000);
2024
- // return false;
2025
- // }
2026
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2027
- // } else {
2028
- // await this.askForMicrophonePermission();
2029
- // }
2030
- // //this.clearAllDialed();
2031
- // // } else {
2032
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2033
- // // }
2034
- // }catch(e){
2035
- // console.error('Error in initiateCall:', e);
2036
- // this.showDialAlert('Failed to initiate call. Please try again.');
2037
- // this.isCallInProgress = false;
2038
- // return false;
2039
- // }
2040
- // }
2041
- async initiateCall() {
2042
- try {
2043
- if (!this.dialedNumber && this.lastDialed) {
2044
- this.sanitizedNum = this.lastDialed.number;
2045
- }
2046
- const isInvalid = await this.isInvalidNumber();
2047
- if (isInvalid) {
2048
- return false;
2049
- }
2050
- // this.saveLastDialed();
2051
- this.isSavedContactDialled();
2052
- this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2053
- if (this.isPaymentDue) {
2054
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2055
- return false;
2056
- }
2057
- this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2058
- if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2059
- // swal('Error', 'You can not dial this number');
2060
- return false;
1862
+ clearInputs() {
1863
+ this.callInput = this.callInput.slice(0, -1);
1864
+ }
1865
+ minimiseDialpad() {
1866
+ this.minimiseEvent.emit(true);
1867
+ this.isMinimised = true;
1868
+ }
1869
+ maximiseDialpad() {
1870
+ this.minimiseEvent.emit(false);
1871
+ this.isMinimised = false;
1872
+ }
1873
+ toggleRecording() {
1874
+ if (this.isRecording) {
1875
+ this.stopRecording();
1876
+ }
1877
+ else {
1878
+ this.startRecording();
1879
+ }
1880
+ }
1881
+ startRecording() {
1882
+ let sid;
1883
+ const details = this.extensionService.getCallSid();
1884
+ this.incomingCallSid = details.callSid;
1885
+ this.incomingRecordCall = details.recordCall;
1886
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1887
+ // if (!this.incomingRecordCall && !this.recordCall) {
1888
+ // return;
1889
+ // }
1890
+ this.extensionService.getCallRecording(sid).subscribe(response => {
1891
+ this.isRecording = true;
1892
+ this.isPaused = false;
1893
+ this.timeElapsed = 0;
1894
+ this.startTimer1();
1895
+ }, error => {
1896
+ console.error('Error starting recording', error);
1897
+ });
1898
+ }
1899
+ stopRecording() {
1900
+ // if (!this.incomingRecordCall && !this.recordCall) {
1901
+ // return;
1902
+ // }
1903
+ this.isRecording = false;
1904
+ this.isPaused = false;
1905
+ if (this.timerSubscription) {
1906
+ this.timerSubscription.unsubscribe();
1907
+ }
1908
+ }
1909
+ pauseRecording() {
1910
+ const details = this.extensionService.getCallSid();
1911
+ this.incomingCallSid = details.callSid;
1912
+ this.incomingRecordCall = details.recordCall;
1913
+ const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1914
+ // if (!this.incomingRecordCall && !this.recordCall) {
1915
+ // return;
1916
+ // }
1917
+ this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
1918
+ this.stopRecordingTimer();
1919
+ this.isPaused = true;
1920
+ }, error => {
1921
+ console.error('Error pausing recording:', error);
1922
+ // Consider updating the UI to show the error state
1923
+ });
1924
+ }
1925
+ resumeRecording() {
1926
+ let sid;
1927
+ const details = this.extensionService.getCallSid();
1928
+ this.incomingCallSid = details.callSid;
1929
+ this.incomingRecordCall = details.recordCall;
1930
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1931
+ // if (!this.incomingRecordCall && !this.recordCall) {
1932
+ // return; // Skip if recording is not enabled
1933
+ // }
1934
+ this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
1935
+ this.isPaused = false;
1936
+ this.startTimer1();
1937
+ }, error => {
1938
+ console.error('Error resuming recording', error);
1939
+ });
1940
+ }
1941
+ startTimer1() {
1942
+ this.timerSubscription = interval(1000).subscribe(() => {
1943
+ this.timeElapsed++;
1944
+ });
1945
+ }
1946
+ stopRecordingTimer() {
1947
+ if (this.timerSubscription) {
1948
+ this.timerSubscription.unsubscribe(); // Pause the timer
1949
+ this.timerSubscription = undefined; // Optionally reset the subscription
1950
+ }
1951
+ }
1952
+ getFormattedTime() {
1953
+ const minutes = Math.floor(this.timeElapsed / 60);
1954
+ const seconds = this.timeElapsed % 60;
1955
+ return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
1956
+ }
1957
+ pollCallStatus(callAuthId) {
1958
+ const maxTime = 30000; // Poll for up to 30 seconds
1959
+ const pollInterval = 3000; // Poll every 3 seconds
1960
+ let elapsedTime = 0;
1961
+ const intervalId = setInterval(async () => {
1962
+ elapsedTime += pollInterval;
1963
+ try {
1964
+ const statusResponse = await this.extensionService.getCallStatus(callAuthId).toPromise();
1965
+ if (statusResponse && statusResponse.callDetails) {
1966
+ this.callStatus = statusResponse.callDetails.callStatus;
1967
+ if (this.callStatus === 'in-progress') {
1968
+ this.callSid = statusResponse.callDetails.callSid;
1969
+ if (this.recordCall && !this.isRecording) {
1970
+ this.startRecording();
1971
+ }
1972
+ clearInterval(intervalId);
1973
+ }
1974
+ else if (this.callStatus === 'completed') {
1975
+ clearInterval(intervalId);
1976
+ this.endCall();
1977
+ this.stopRecording();
1978
+ }
1979
+ else if (this.callStatus === 'ringing') {
1980
+ // Continue polling; do not clear the interval yet
1981
+ }
1982
+ }
2061
1983
  }
2062
- // const hasPermission = await this.checkMicrophonePermission();
2063
- // if (!hasPermission) {
2064
- // await this.askForMicrophonePermission();
2065
- // return false;
2066
- // }
2067
- if (!this.selectedCallerId) {
2068
- this.shakeDedicatedBtn = true;
2069
- this.showDialAlert('Select a C2C number to call');
2070
- setTimeout(() => {
2071
- this.shakeDedicatedBtn = false;
2072
- }, 3000);
2073
- return false;
1984
+ catch (error) {
1985
+ clearInterval(intervalId);
2074
1986
  }
2075
- // Clear displayNum if value is bound from previous call
2076
- this.callData.displayNum = '';
2077
- // Get number to be dialed from backend
2078
- // await this.getToNumber(this.sanitizedNum);
2079
- if (this.terminateCall) {
2080
- this.terminateCall = false;
2081
- return;
1987
+ if (elapsedTime >= maxTime) {
1988
+ // console.log('Max polling time reached. Stopping poll.');
1989
+ clearInterval(intervalId);
2082
1990
  }
2083
- // Update call data in a single operation
2084
- this.callData = {
2085
- ...this.callData,
2086
- phone: this.sanitizedNum,
2087
- isIncomingCall: false,
2088
- dial: true,
2089
- from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2090
- timestamp: new Date().toISOString()
2091
- };
2092
- console.log('Initiating call with data:', this.callData);
2093
- this.isCallInProgress = true;
2094
- this.callInitiated.emit({ ...this.callData });
2095
- return true;
1991
+ }, pollInterval);
1992
+ }
1993
+ getUserInformation(id) {
1994
+ this.extensionService.getUserInformation(id).subscribe(response => {
1995
+ console.log(response);
1996
+ }, error => {
1997
+ console.error('Error starting recording', error);
1998
+ });
1999
+ }
2000
+ incomingCallsNewList(data) {
2001
+ this.newIncomingCallsList = data;
2002
+ this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2003
+ }
2004
+ selectedIncomingCallInfo(data) {
2005
+ this.selectedIncomingCall = data;
2006
+ }
2007
+ ngOnDestroy() {
2008
+ this.callData.dial = false;
2009
+ if (this.timerSubscription) {
2010
+ this.timerSubscription.unsubscribe();
2011
+ }
2012
+ }
2013
+ }
2014
+ 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 });
2015
+ 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" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", showCallProgressEvent: "showCallProgressEvent", 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\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\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 : '&nbsp;'}}</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;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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.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"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
2016
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2017
+ type: Component,
2018
+ 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\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\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 : '&nbsp;'}}</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;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"] }]
2019
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2020
+ type: Input
2021
+ }], newIncomingCallData: [{
2022
+ type: Input
2023
+ }], newIncomingCallsList: [{
2024
+ type: Input
2025
+ }], endCallEvent: [{
2026
+ type: Output
2027
+ }], incomingCallsNewInfo: [{
2028
+ type: Output
2029
+ }], minimiseEvent: [{
2030
+ type: Output
2031
+ }], showCallProgressEvent: [{
2032
+ type: Output
2033
+ }], incomingCallInitiated: [{
2034
+ type: Output
2035
+ }] } });
2036
+
2037
+ class DialboxComponent {
2038
+ constructor(twilioService, extService,
2039
+ // private dialog: MatDialog,
2040
+ ipService, extensionService, router) {
2041
+ this.twilioService = twilioService;
2042
+ this.extService = extService;
2043
+ this.ipService = ipService;
2044
+ this.extensionService = extensionService;
2045
+ this.router = router;
2046
+ this.isDialpadHidden = false;
2047
+ this.closeDialpadEvent = new EventEmitter();
2048
+ this.callInitiated = new EventEmitter();
2049
+ this.endCallEvent = new EventEmitter();
2050
+ this.minimiseEvent = new EventEmitter();
2051
+ this.incomingCallsNewInfoEvent = new EventEmitter();
2052
+ this.incomingCallInitiated = new EventEmitter();
2053
+ this.numberDialed = new EventEmitter();
2054
+ this.isCallInProgress = false;
2055
+ this.keypadVal = keypad;
2056
+ this.showInputClearBtn = false;
2057
+ this.dialedNumber = '';
2058
+ this.contactList = [];
2059
+ this.filteredContactList = [];
2060
+ this.callerIdList = [];
2061
+ this.isCallerIdHidden = true;
2062
+ this.isTrialPeriodOver = false;
2063
+ this.isPaymentDue = false;
2064
+ this.terminateCall = false;
2065
+ this.toastTimeout = 7000;
2066
+ this.callNumberToast = {
2067
+ show: false,
2068
+ type: 'alert-success',
2069
+ number: '',
2070
+ displayNum: ''
2071
+ };
2072
+ this.callData = {
2073
+ phone: '',
2074
+ displayNum: '',
2075
+ dial: false,
2076
+ name: '',
2077
+ img: 'assets/images/user.jpg',
2078
+ isIncomingCall: false,
2079
+ extNum: ''
2080
+ };
2081
+ this.lastDialed = null;
2082
+ this.dialAlert = {
2083
+ msg: '',
2084
+ show: false
2085
+ };
2086
+ this.showDedicatedPopup = false;
2087
+ this.newIncomingCalls = [];
2088
+ this.incomingCallsList = [];
2089
+ this.subscriptions = new Subscription();
2090
+ this.shakeDedicatedBtn = false;
2091
+ this.isSmartDialCall = false;
2092
+ this.isMinimised = false;
2093
+ }
2094
+ ngOnInit() {
2095
+ try {
2096
+ this.token = localStorage.getItem('ext_token');
2097
+ //this.isCallInProgress = true;
2098
+ this.getContactList();
2099
+ // this.getUserCallSetting();
2100
+ const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
2101
+ if (contact.number) {
2102
+ this.isSmartDialCall = false;
2103
+ if (contact.isDialFromHistory) {
2104
+ //handle dialing from history page
2105
+ if (contact.callerId == 'smartDialing') {
2106
+ this.selectedCallerId = { number: contact.from };
2107
+ this.isSmartDialCall = true;
2108
+ setTimeout(() => {
2109
+ this.isDialpadHidden = false;
2110
+ }, 2000);
2111
+ this.callData.phone = contact.number;
2112
+ this.callData.name = contact.name;
2113
+ this.callData.img = contact.img;
2114
+ this.callData.from = contact.from;
2115
+ this.sanitizedNum = contact.number;
2116
+ // this.getUserInformation(contact);
2117
+ // this.incomingCallsList.push(contact)
2118
+ this.initiateCall();
2119
+ }
2120
+ else {
2121
+ // this.getUserCallSetting();
2122
+ setTimeout(() => {
2123
+ this.isDialpadHidden = false;
2124
+ }, 1000);
2125
+ // this.getUserInformation(contact);
2126
+ // this.incomingCallsList.push(contact)
2127
+ this.dialedNumber = contact.number;
2128
+ this.sanitizedNum = contact.number;
2129
+ }
2130
+ }
2131
+ else {
2132
+ if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
2133
+ // this.getUserCallSetting();
2134
+ setTimeout(() => {
2135
+ this.isDialpadHidden = false;
2136
+ }, 1000);
2137
+ this.dialedNumber = contact.number;
2138
+ this.sanitizedNum = contact.number;
2139
+ }
2140
+ else {
2141
+ setTimeout(() => {
2142
+ this.isDialpadHidden = false;
2143
+ }, 2000);
2144
+ this.callData.phone = contact.number;
2145
+ this.callData.name = contact.name;
2146
+ this.callData.img = contact.img;
2147
+ this.sanitizedNum = contact.number;
2148
+ this.initiateCall();
2149
+ }
2150
+ }
2151
+ }
2152
+ });
2153
+ // handle incoming call
2154
+ const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
2155
+ // if (incomingCallData) {
2156
+ // this.isCallInProgress = true;
2157
+ // this.isDialpadHidden = false;
2158
+ // this.callData.phone = incomingCallData.parameters.From;
2159
+ // this.callData.name = incomingCallData.customParameters.get('name');
2160
+ // this.callData.img = incomingCallData.customParameters.get('image');
2161
+ // this.callData.isIncomingCall = true;
2162
+ // }
2163
+ if (incomingCallData) {
2164
+ if (this.isCallInProgress) {
2165
+ this.newIncomingCalls.push(incomingCallData);
2166
+ // this.getUserInformation(incomingCallData);
2167
+ }
2168
+ else {
2169
+ this.isCallInProgress = true;
2170
+ this.isDialpadHidden = false;
2171
+ this.callData.phone = incomingCallData.parameters['From'];
2172
+ // this.getUserInformation(incomingCallData);
2173
+ this.callData.name = incomingCallData.customParameters.get('name');
2174
+ this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
2175
+ this.callData.isIncomingCall = true;
2176
+ }
2177
+ incomingCallData.on('cancel', () => {
2178
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2179
+ if (this.incomingCallsList.length == 0) {
2180
+ this.isCallInProgress = false;
2181
+ }
2182
+ });
2183
+ incomingCallData.on('disconnect', () => {
2184
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2185
+ if (this.incomingCallsList.length == 0) {
2186
+ this.isCallInProgress = false;
2187
+ }
2188
+ });
2189
+ }
2190
+ });
2191
+ this.subscriptions.add(sub1);
2192
+ this.subscriptions.add(sub2);
2096
2193
  }
2097
2194
  catch (e) {
2098
- console.error('Error in initiateCall:', e);
2099
- this.showDialAlert('Failed to initiate call. Please try again.');
2100
- this.isCallInProgress = false;
2101
- return false;
2102
- }
2103
- }
2104
- async isInvalidNumber() {
2105
- try {
2106
- if (this.sanitizedNum == '') {
2107
- this.showDialAlert('Invalid Number');
2108
- return true;
2109
- }
2110
- const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2111
- const phoneNumber = this.sanitizedNum;
2112
- if (!validNumberPattern.test(phoneNumber)) {
2113
- this.showDialAlert('Invalid Number');
2114
- return true;
2115
- }
2116
- return false;
2117
- }
2118
- catch (error) {
2119
- this.showDialAlert('Invalid Number');
2120
- return true; // Return true if an error occurred, meaning the number is invalid
2195
+ console.log(e);
2121
2196
  }
2122
2197
  }
2123
- // saveLastDialed() {
2124
- // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2125
- // if (contact) {
2126
- // this.lastDialed = {
2127
- // name: contact.name,
2128
- // image: contact.image,
2129
- // number: this.dialedNumber
2130
- // };
2131
- // } else {
2132
- // if(this.dialedNumber){
2133
- // this.lastDialed = { number: this.dialedNumber };
2134
- // }
2135
- // }
2198
+ // getUserInformation(incomingCallData: any) {
2199
+ // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2200
+ // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
2201
+ // response => {
2202
+ // incomingCallData['userInfo']=response
2203
+ // this.incomingCallsList.push(incomingCallData);
2204
+ // }, error => {
2205
+ // console.error('Error starting recording', error);
2206
+ // });
2136
2207
  // }
2137
- isSavedContactDialled() {
2138
- let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2139
- let contact = this.contactList.filter(contact => {
2140
- // return contact.numbersList.some(num => num.number === phoneNum)
2141
- });
2142
- if (contact.length) {
2143
- this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2144
- this.callData.img = contact[0].image || 'assets/images/user.jpg';
2145
- this.callData.phone = this.sanitizedNum;
2146
- return true;
2147
- }
2148
- return false;
2149
- }
2150
- showDialAlert(message) {
2151
- this.dialAlert = {
2152
- msg: message,
2153
- show: true
2154
- };
2155
- setTimeout(() => {
2156
- this.dialAlert.show = false;
2157
- }, 3000);
2208
+ fromEntries(entries) {
2209
+ return entries.reduce((acc, [key, value]) => {
2210
+ acc[key] = value;
2211
+ return acc;
2212
+ }, {});
2158
2213
  }
2159
- async isCallerIdSet() {
2160
- try {
2161
- const tkn = localStorage.getItem('ext_token');
2162
- const res = await this.extService.fetchCallerId(tkn || '').toPromise();
2163
- if (res.status == 200) {
2164
- localStorage.setItem('trialOver', res.trialOver);
2165
- this.twilioService.isTrialOver.next(res.trialOver);
2166
- localStorage.setItem('paymentDue', res.paymentDue);
2167
- this.twilioService.isPaymentDue.next(res.paymentDue);
2168
- }
2169
- if (res.callerid) {
2170
- localStorage.setItem('callerID', res.callerid);
2171
- this.extService.changeMessage(res.callerid);
2172
- }
2173
- else {
2174
- localStorage.setItem('callerID', 'Not set');
2175
- this.extService.changeMessage('Not set');
2176
- }
2177
- return (localStorage.getItem('callerID') !== 'Not set');
2178
- }
2179
- catch (e) {
2180
- console.log(e);
2181
- return false;
2182
- }
2214
+ ngAfterViewInit() {
2215
+ this.registerDragElement();
2183
2216
  }
2184
- async checkMicrophonePermission() {
2185
- try {
2186
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2187
- stream.getTracks().forEach(track => track.stop());
2188
- return true;
2189
- }
2190
- catch (error) {
2191
- if (error instanceof DOMException && error.name === 'NotAllowedError') {
2192
- return false;
2193
- }
2194
- else {
2195
- return false;
2196
- }
2217
+ ngOnChanges(changes) {
2218
+ if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
2219
+ this.getContactList();
2220
+ // this.getUserCallSetting();
2221
+ setTimeout(() => {
2222
+ this.dialInputElement.nativeElement.focus();
2223
+ }, 0);
2197
2224
  }
2198
2225
  }
2199
- async askForMicrophonePermission() {
2226
+ registerDragElement() {
2200
2227
  try {
2201
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2202
- stream.getTracks().forEach(track => track.stop());
2203
- }
2204
- catch (error) {
2205
- console.error('User denied microphone permission:', error);
2206
- }
2207
- }
2208
- // below function is to get the country code with number from server
2209
- async getToNumber(dialedNumber) {
2210
- if (dialedNumber[0] !== '+') {
2211
- // this is case when user geolocation dial code is on
2212
- let ipAddress = await this.ipService.getIpAddressInfo().toPromise();
2213
- const res = await this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2214
- if (res.status == 200) {
2215
- this.toastTimeout = res.timeInterval * 1000;
2216
- await this.showNumberToast(res);
2217
- }
2218
- }
2219
- }
2220
- isAlertEnable() {
2221
- return localStorage.getItem('isAlertEnable');
2222
- }
2223
- async showNumberToast(data) {
2224
- const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2225
- if (isAlertOn == 'true') {
2226
- this.callNumberToast.show = true;
2227
- this.callNumberToast.number = data.toNumber;
2228
- this.callNumberToast.displayNum = data.displayNumber;
2229
- }
2230
- this.callData.displayNum = data.displayNumber;
2231
- //this.callData.phone = data.toNumber;
2232
- await this.delay(this.toastTimeout);
2233
- this.dialedNumber = data.toNumber;
2234
- this.sanitizedNum = data.toNumber;
2235
- this.callNumberToast.show = false;
2236
- this.callNumberToast.number = '';
2237
- this.callNumberToast.displayNum = '';
2238
- }
2239
- delay(ms) {
2240
- return new Promise(resolve => setTimeout(resolve, ms));
2241
- }
2242
- onMinimise(isMinimised) {
2243
- this.isMinimised = isMinimised;
2244
- this.minimiseEvent.emit(isMinimised);
2245
- }
2246
- handleNumberPaste(event) {
2247
- event.preventDefault();
2248
- const clipboardData = event.clipboardData || window.clipboardData;
2249
- const pastedData = clipboardData.getData('text');
2250
- // Log the pasted content to the console
2251
- if (pastedData) {
2252
- this.dialedNumber = pastedData;
2253
- this.sanitizedNum = pastedData;
2254
- }
2255
- }
2256
- onEnter(num) {
2257
- console.log(num, 'number fn');
2258
- this.dialedNumber = this.dialedNumber + num;
2259
- this.sanitizedNum = this.dialedNumber;
2260
- this.showInputClearBtn = true;
2261
- this.numberDialed.emit(this.dialedNumber);
2262
- }
2263
- getUserCallSetting() {
2264
- const tkn = localStorage.getItem('ext_token');
2265
- this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2266
- if (resp.status == 200) {
2267
- //this.callPrefernce = resp.userSetting;
2268
- this.callPreference = resp.callerid;
2269
- this.getCallerIdList();
2270
- }
2271
- });
2272
- }
2273
- onDedicatedNumSelect(id) {
2274
- this.selectedCallerId = id;
2275
- this.isCallerIdHidden = true;
2276
- this.extService.setCallerId(id);
2277
- }
2278
- cancelDialNumber() {
2279
- this.terminateCall = true;
2280
- this.callNumberToast.show = false;
2281
- }
2282
- handleDivKeydown(ev) {
2283
- if (this.dialedNumber.length == 0) {
2284
- this.dialInputElement.nativeElement.focus();
2285
- }
2286
- if (ev.key === 'Enter') {
2287
- // Check if the dialpad is open
2288
- if (!this.isDialpadHidden) {
2289
- if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2290
- this.initiateCall();
2291
- }
2292
- if (!this.selectedCallerId) {
2293
- this.shakeDedicatedBtn = true;
2294
- setTimeout(() => {
2295
- this.shakeDedicatedBtn = false;
2296
- }, 10000);
2228
+ const elmnt = document.getElementById('dragparent1');
2229
+ let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
2230
+ const dragMouseDown = (e) => {
2231
+ // If the target is an input, return and don't initiate dragging
2232
+ if (e.target.tagName.toLowerCase() === 'input') {
2233
+ return;
2297
2234
  }
2298
- }
2235
+ e = e || window.event;
2236
+ // get the mouse cursor position at startup:
2237
+ pos3 = e.clientX;
2238
+ pos4 = e.clientY;
2239
+ document.onmouseup = closeDragElement;
2240
+ // call a function whenever the cursor moves:
2241
+ document.onmousemove = elementDrag;
2242
+ };
2243
+ const elementDrag = (e) => {
2244
+ e = e || window.event;
2245
+ // calculate the new cursor position:
2246
+ pos1 = pos3 - e.clientX;
2247
+ pos2 = pos4 - e.clientY;
2248
+ pos3 = e.clientX;
2249
+ pos4 = e.clientY;
2250
+ // set the element's new position:
2251
+ // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
2252
+ // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
2253
+ };
2254
+ const closeDragElement = () => {
2255
+ /* stop moving when mouse button is released:*/
2256
+ document.onmouseup = null;
2257
+ document.onmousemove = null;
2258
+ };
2259
+ // if (document.getElementById(elmnt.id + 'header')) {
2260
+ // /* if present, the header is where you move the DIV from:*/
2261
+ // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
2262
+ // } else {
2263
+ // /* otherwise, move the DIV from anywhere inside the DIV:*/
2264
+ // elmnt.onmousedown = dragMouseDown;
2265
+ // }
2299
2266
  }
2300
- }
2301
- onCallBtnMouseEnter(ev) {
2302
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2303
- this.shakeDedicatedBtn = true;
2267
+ catch (e) {
2268
+ console.log(e);
2304
2269
  }
2305
2270
  }
2306
- onCallBtnMouseLeave(ev) {
2307
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2308
- this.shakeDedicatedBtn = false;
2271
+ addNumber(num) {
2272
+ if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
2273
+ if (num == '#') {
2274
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2275
+ }
2276
+ else if (num == '*') {
2277
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2278
+ }
2279
+ else {
2280
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2281
+ }
2282
+ this.dialedNumber += num;
2283
+ this.showInputClearBtn = true;
2284
+ this.numberDialed.emit(this.dialedNumber);
2285
+ this.onDialInputChange(this.dialedNumber);
2286
+ // this.dialInputRef.nativeElement.focus();
2287
+ }
2288
+ else if (num === 'voicemail') {
2289
+ // this.showDedicatedPopup = true;
2290
+ this.router.navigate(['extension/voicemail/' + this.token]);
2309
2291
  }
2310
2292
  }
2311
- acceptNewIncomingCall(call) {
2312
- //first cut the current call
2313
- //this.callData = call;
2314
- this.newIncomingCallData = call;
2315
- }
2316
- rejectNewIncomingCall(call) {
2317
- call.reject();
2318
- this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2319
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2320
- }
2321
- newIncomingCallInitiated() {
2322
- this.isCallInProgress = true;
2323
- this.newIncomingCalls = [];
2324
- this.incomingCallInitiated.emit();
2325
- }
2326
- incomingCallsNewInfo(data) {
2327
- this.incomingCallsList = data;
2328
- this.incomingCallsNewInfoEvent.emit(data);
2293
+ hideDialpad() {
2294
+ this.isDialpadHidden = true;
2295
+ this.closeDialpadEvent.emit();
2296
+ this.clearAllDialed();
2297
+ this.filteredContactList = [];
2329
2298
  }
2330
- ngOnDestroy() {
2299
+ onDialInputChange(inputVal) {
2331
2300
  try {
2332
- console.log('Cleaning up C2cDialpadComponent');
2333
- // Unsubscribe from all subscriptions
2334
- if (this.subscriptions) {
2335
- this.subscriptions.unsubscribe();
2301
+ // Updated regex to include x, X, ext., Ext., and ,
2302
+ const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
2303
+ let mainNumber = inputVal;
2304
+ // Check for extension indicators and split the input
2305
+ const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
2306
+ if (extMatch) {
2307
+ mainNumber = inputVal.substring(0, extMatch.index).trim();
2308
+ this.callData.extNum = extMatch[2].trim();
2336
2309
  }
2337
- // End any active call
2338
- if (this.isCallInProgress) {
2339
- this.endCall();
2310
+ this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
2311
+ this.callData.phone = isNumericInput ? this.sanitizedNum : '';
2312
+ this.showInputClearBtn = inputVal.length > 0;
2313
+ if (isNumericInput) {
2314
+ this.dialedNumber = new AsYouType().input(this.sanitizedNum);
2340
2315
  }
2341
- // Clear any timeouts or intervals if they exist
2342
- if (this.toastTimeout) {
2343
- clearTimeout(this.toastTimeout);
2316
+ // emit current number whenever input changes
2317
+ this.numberDialed.emit(this.dialedNumber);
2318
+ if (inputVal.length > 2) {
2319
+ this.filteredContactList = this.contactList.filter(contact => {
2320
+ const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
2321
+ // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
2322
+ }).slice(0, 2);
2323
+ }
2324
+ else {
2325
+ this.filteredContactList = [];
2344
2326
  }
2345
- console.log('C2cDialpadComponent cleanup complete');
2346
2327
  }
2347
- catch (error) {
2348
- console.error('Error during component cleanup:', error);
2328
+ catch (e) {
2329
+ console.log(e);
2349
2330
  }
2350
2331
  }
2351
- }
2352
- DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2353
- DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, 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 <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [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 : '&nbsp;'}}</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 <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n \r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n \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;height:600px;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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
2354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
2355
- type: Component,
2356
- args: [{ selector: 'lib-dialbox', template: "<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [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 : '&nbsp;'}}</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 <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n \r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n \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;height:600px;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"] }]
2357
- }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
2358
- type: Input
2359
- }], closeDialpadEvent: [{
2360
- type: Output
2361
- }], callInitiated: [{
2362
- type: Output
2363
- }], endCallEvent: [{
2364
- type: Output
2365
- }], minimiseEvent: [{
2366
- type: Output
2367
- }], incomingCallsNewInfoEvent: [{
2368
- type: Output
2369
- }], incomingCallInitiated: [{
2370
- type: Output
2371
- }], dialInputElement: [{
2372
- type: ViewChild,
2373
- args: ['dialInput']
2374
- }], numberDialed: [{
2375
- type: Output
2376
- }] } });
2377
-
2378
- class CallProgressComponent {
2379
- constructor(extensionService, cdr) {
2380
- this.extensionService = extensionService;
2381
- this.cdr = cdr;
2382
- this.endCallEvent = new EventEmitter();
2383
- this.incomingCallsNewInfo = new EventEmitter();
2384
- this.minimiseEvent = new EventEmitter();
2385
- this.showRingAnimation = false;
2386
- this.timer = '00:00';
2387
- this.showKeypad = false;
2388
- this.keypadVal = keypad;
2389
- this.callInput = '';
2390
- this.isMute = false;
2391
- this.disbaleEndCallBtn = true;
2392
- this.showClearBtn = false;
2393
- this.isCollops = false;
2394
- // Incoming call variables
2395
- this.incomingCallDiv = false;
2396
- //@Output() showCallProgressEvent: EventEmitter<void> = new EventEmitter<void>();
2397
- this.incomingCallInitiated = new EventEmitter();
2398
- this.isRecording = false;
2399
- this.isPaused = false;
2400
- this.timeElapsed = 0; // in seconds
2401
- this.recordCall = false;
2402
- this.callStatus = 'ringing';
2403
- this.isMinimised = false;
2332
+ getFirstLetter(name) {
2333
+ return name ? name.charAt(0).toUpperCase() : '';
2404
2334
  }
2405
- ngOnInit() {
2406
- console.log('Call Progress Component');
2335
+ clearInput() {
2336
+ if (this.dialedNumber.length > 0) {
2337
+ this.dialedNumber = this.dialedNumber.slice(0, -1);
2338
+ this.showInputClearBtn = this.dialedNumber.length !== 0;
2339
+ this.onDialInputChange(this.dialedNumber);
2340
+ }
2407
2341
  }
2408
- ngOnChanges(changes) {
2409
- console.log('Call Progress Component ngOnChanges');
2410
- if (changes['callData']) {
2411
- console.log('Call Progress Component ngOnChanges callData', changes['callData']);
2412
- if (changes['callData'].currentValue.isIncomingCall) {
2413
- this.incomingCallDiv = true;
2342
+ clearAllDialed() {
2343
+ this.dialedNumber = '';
2344
+ this.sanitizedNum = '';
2345
+ this.showInputClearBtn = false;
2346
+ }
2347
+ getCallerIdList() {
2348
+ this.extService.displayID(this.token || '').subscribe((res) => {
2349
+ //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
2350
+ this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
2351
+ // this.callerIdList = res.callerIdList;
2352
+ if (this.callerIdList.length == 1) {
2353
+ this.selectedCallerId = this.callerIdList[0];
2414
2354
  }
2415
2355
  else {
2416
- //for outgoing call
2417
- this.startCall(changes['callData'].currentValue);
2418
- }
2419
- }
2420
- if (changes['newIncomingCallData']) {
2421
- try {
2422
- if (changes['newIncomingCallData'].currentValue) {
2423
- if (this.call && (this.call.status() == 'open')) {
2424
- this.call.disconnect();
2425
- this.call = changes['newIncomingCallData'].currentValue;
2426
- this.call?.accept();
2427
- this.callData.phone = this.call?.parameters['From'];
2428
- this.callData.name = this.call?.customParameters.get('name');
2429
- this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
2430
- this.incomingCallInitiated.emit();
2431
- this.startTimer();
2432
- }
2356
+ if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
2357
+ this.selectedCallerId = null;
2358
+ }
2359
+ else {
2360
+ this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
2433
2361
  }
2434
2362
  }
2435
- catch (e) {
2436
- console.log(e);
2363
+ });
2364
+ }
2365
+ getContactList() {
2366
+ this.twilioService.getContactList().subscribe((resp) => {
2367
+ if (resp.response == 'Success') {
2368
+ this.contactList = resp.phoneBook;
2437
2369
  }
2370
+ }, err => {
2371
+ console.log(err);
2372
+ });
2373
+ }
2374
+ getFullName(contact) {
2375
+ let fullName = contact.firstName || '';
2376
+ if (contact.middleName) {
2377
+ fullName += ` ${contact.middleName}`;
2378
+ }
2379
+ if (contact.lastName) {
2380
+ fullName += ` ${contact.lastName}`;
2381
+ }
2382
+ return fullName.trim();
2383
+ }
2384
+ toggleCallerIdDiv() {
2385
+ this.isCallerIdHidden = !this.isCallerIdHidden;
2386
+ }
2387
+ onContactSelect(contact) {
2388
+ this.dialedNumber = contact.numbersList[0].number;
2389
+ this.callData.name = this.getFullName(contact);
2390
+ this.callData.img = contact.image || 'assets/images/user.jpg';
2391
+ this.onDialInputChange(this.dialedNumber);
2392
+ this.filteredContactList = [];
2393
+ }
2394
+ endCall() {
2395
+ try {
2396
+ console.log('Ending call');
2397
+ this.isCallInProgress = false;
2398
+ this.filteredContactList = [];
2399
+ // Reset call data
2400
+ this.callData = {
2401
+ phone: '',
2402
+ name: '',
2403
+ img: 'assets/images/user.jpg',
2404
+ isIncomingCall: false,
2405
+ dial: false,
2406
+ displayNum: '',
2407
+ extNum: ''
2408
+ };
2409
+ // Reset dialed number
2410
+ this.dialedNumber = '';
2411
+ this.sanitizedNum = '';
2412
+ // Emit end call event
2413
+ this.endCallEvent.emit();
2414
+ console.log('Call ended successfully');
2415
+ }
2416
+ catch (error) {
2417
+ console.error('Error in endCall:', error);
2418
+ // Even if there's an error, try to reset the state
2419
+ this.isCallInProgress = false;
2420
+ this.callData = {
2421
+ phone: '',
2422
+ name: '',
2423
+ img: 'assets/images/user.jpg',
2424
+ isIncomingCall: false,
2425
+ dial: false,
2426
+ displayNum: '',
2427
+ extNum: ''
2428
+ };
2429
+ this.endCallEvent.emit();
2438
2430
  }
2439
2431
  }
2440
- ngAfterViewInit() { }
2441
- async startCall(callData) {
2442
- try {
2443
- this.showRingAnimation = true;
2444
- const payload = {
2445
- channelId: environment.channelId,
2446
- userId: localStorage.getItem('userId'),
2447
- to: callData.phone,
2448
- scope: 'local',
2449
- fromNumber: callData.from
2450
- };
2451
- const response = await this.initiateCall(payload);
2452
- if (response.status == 200) {
2453
- const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
2454
- this.getUserInformation(callAuthId);
2455
- this.recordCall = recordCall; // Store the recordCall value
2456
- const tokenData = await this.getOutgoingCallToken(callAuthId);
2457
- await this.connectToDevice(tokenData.token, callData);
2458
- // Poll the status for 30-45 seconds
2459
- this.pollCallStatus(callAuthId);
2432
+ // async initiateCall() {
2433
+ // try {
2434
+ // console.log('Initiating call with number:', this.dialedNumber);
2435
+ // if (!this.dialedNumber && this.lastDialed) {
2436
+ // console.log('Using last dialed number:', this.lastDialed.number);
2437
+ // this.sanitizedNum = this.lastDialed.number;
2438
+ // }
2439
+ // const isInvalid = await this.isInvalidNumber();
2440
+ // if (isInvalid) {
2441
+ // console.error('Invalid number format');
2442
+ // return false;
2443
+ // }
2444
+ // this.saveLastDialed();
2445
+ // this.isSavedContactDialled();
2446
+ // // Check payment status
2447
+ // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
2448
+ // if (this.isPaymentDue) {
2449
+ // console.warn('Payment is due');
2450
+ // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
2451
+ // return false;
2452
+ // }
2453
+ // // Check if dialing own number
2454
+ // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2455
+ // console.error('Attempted to dial own number');
2456
+ // swal('Error', 'You cannot dial your own number');
2457
+ // return false;
2458
+ // }
2459
+ // // Check microphone permissions
2460
+ // const hasPermission = await this.checkMicrophonePermission();
2461
+ // if (!hasPermission) {
2462
+ // console.warn('Microphone permission not granted');
2463
+ // await this.askForMicrophonePermission();
2464
+ // return false;
2465
+ // }
2466
+ // if (!this.selectedCallerId) {
2467
+ // console.error('No caller ID selected');
2468
+ // this.shakeDedicatedBtn = true;
2469
+ // this.showDialAlert('Please select a C2C number to call from');
2470
+ // setTimeout(() => {
2471
+ // this.shakeDedicatedBtn = false;
2472
+ // }, 3000);
2473
+ // return false;
2474
+ // }
2475
+ // console.log('Getting number with country code...');
2476
+ // this.callData.displayNum = '';
2477
+ // try {
2478
+ // await this.getToNumber(this.sanitizedNum);
2479
+ // } catch (error) {
2480
+ // console.error('Error getting number with country code:', error);
2481
+ // this.showDialAlert('Error processing number. Please try again.');
2482
+ // return false;
2483
+ // }
2484
+ // if (this.terminateCall) {
2485
+ // console.log('Call terminated by user');
2486
+ // this.terminateCall = false;
2487
+ // return false;
2488
+ // }
2489
+ // // Prepare call data
2490
+ // this.callData = {
2491
+ // ...this.callData,
2492
+ // phone: this.sanitizedNum,
2493
+ // isIncomingCall: false,
2494
+ // dial: true,
2495
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2496
+ // timestamp: new Date().toISOString()
2497
+ // };
2498
+ // console.log('Initiating call with data:', this.callData);
2499
+ // this.isCallInProgress = true;
2500
+ // this.callInitiated.emit({ ...this.callData });
2501
+ // return true;
2502
+ // } catch (error) {
2503
+ // console.error('Error in initiateCall:', error);
2504
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2505
+ // this.isCallInProgress = false;
2506
+ // return false;
2507
+ // }
2508
+ // //this.clearAllDialed();
2509
+ // // } else {
2510
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2511
+ // // }
2512
+ // }
2513
+ // async initiateCall() {
2514
+ // if (!this.dialedNumber && this.lastDialed) {
2515
+ // this.sanitizedNum = this.lastDialed.number;
2516
+ // }
2517
+ // const isInvalid = await this.isInvalidNumber();
2518
+ // if (isInvalid) {
2519
+ // return false;
2520
+ // }
2521
+ // this.saveLastDialed();
2522
+ // this.isSavedContactDialled();
2523
+ // //let isCallerIdSet = await this.isCallerIdSet();
2524
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2525
+ // if (this.isPaymentDue) {
2526
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2527
+ // return;
2528
+ // }
2529
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2530
+ // // if (!this.isTrialPeriodOver) {
2531
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2532
+ // swal('Error', 'You can not dial this number');
2533
+ // return;
2534
+ // }
2535
+ // const hasPermission = await this.checkMicrophonePermission();
2536
+ // if (hasPermission) {
2537
+ // if (this.selectedCallerId) {
2538
+ // //clear displayNum if value is binded from previous call
2539
+ // this.callData.displayNum = '';
2540
+ // // get number to be dialled from backend
2541
+ // await this.getToNumber(this.sanitizedNum);
2542
+ // if (this.terminateCall) {
2543
+ // this.terminateCall = false;
2544
+ // return;
2545
+ // }
2546
+ // this.callData.phone = this.sanitizedNum;
2547
+ // this.callData.isIncomingCall = false;
2548
+ // this.callData.dial = true;
2549
+ // if (!this.isSmartDialCall) {
2550
+ // this.callData.from = this.selectedCallerId.number;
2551
+ // }
2552
+ // this.isCallInProgress = true;
2553
+ // this.callData = {
2554
+ // ...this.callData,
2555
+ // phone: this.sanitizedNum,
2556
+ // isIncomingCall: false,
2557
+ // dial: true,
2558
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2559
+ // timestamp: new Date().toISOString()
2560
+ // };
2561
+ // console.log('Initiating call with data:', this.callData);
2562
+ // this.isCallInProgress = true;
2563
+ // this.callInitiated.emit({ ...this.callData });
2564
+ // return true;
2565
+ // } else {
2566
+ // this.shakeDedicatedBtn = true;
2567
+ // this.showDialAlert('Select a C2C number to call');
2568
+ // setTimeout(() => {
2569
+ // this.shakeDedicatedBtn = false;
2570
+ // }, 3000);
2571
+ // return false;
2572
+ // }
2573
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2574
+ // } else {
2575
+ // await this.askForMicrophonePermission();
2576
+ // }
2577
+ // //this.clearAllDialed();
2578
+ // // } else {
2579
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2580
+ // // }
2581
+ // }
2582
+ // async initiateCall() {
2583
+ // try{
2584
+ // if (!this.dialedNumber && this.lastDialed) {
2585
+ // this.sanitizedNum = this.lastDialed.number;
2586
+ // }
2587
+ // const isInvalid = await this.isInvalidNumber();
2588
+ // if (isInvalid) {
2589
+ // return false;
2590
+ // }
2591
+ // this.saveLastDialed();
2592
+ // this.isSavedContactDialled();
2593
+ // //let isCallerIdSet = await this.isCallerIdSet();
2594
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2595
+ // if (this.isPaymentDue) {
2596
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2597
+ // return false;
2598
+ // }
2599
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2600
+ // // if (!this.isTrialPeriodOver) {
2601
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2602
+ // swal('Error', 'You can not dial this number');
2603
+ // return false;
2604
+ // }
2605
+ // const hasPermission = await this.checkMicrophonePermission();
2606
+ // if (hasPermission) {
2607
+ // if (this.selectedCallerId) {
2608
+ // //clear displayNum if value is binded from previous call
2609
+ // this.callData.displayNum = '';
2610
+ // // get number to be dialled from backend
2611
+ // await this.getToNumber(this.sanitizedNum);
2612
+ // if (this.terminateCall) {
2613
+ // this.terminateCall = false;
2614
+ // return;
2615
+ // }
2616
+ // this.callData.phone = this.sanitizedNum;
2617
+ // this.callData.isIncomingCall = false;
2618
+ // this.callData.dial = true;
2619
+ // if (!this.isSmartDialCall) {
2620
+ // this.callData.from = this.selectedCallerId.number;
2621
+ // }
2622
+ // this.isCallInProgress = true;
2623
+ // this.callData = {
2624
+ // ...this.callData,
2625
+ // phone: this.sanitizedNum,
2626
+ // isIncomingCall: false,
2627
+ // dial: true,
2628
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2629
+ // timestamp: new Date().toISOString()
2630
+ // };
2631
+ // console.log('Initiating call with data:', this.callData);
2632
+ // this.isCallInProgress = true;
2633
+ // this.callInitiated.emit({ ...this.callData });
2634
+ // return true;
2635
+ // } else {
2636
+ // this.shakeDedicatedBtn = true;
2637
+ // this.showDialAlert('Select a C2C number to call');
2638
+ // setTimeout(() => {
2639
+ // this.shakeDedicatedBtn = false;
2640
+ // }, 3000);
2641
+ // return false;
2642
+ // }
2643
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2644
+ // } else {
2645
+ // await this.askForMicrophonePermission();
2646
+ // }
2647
+ // //this.clearAllDialed();
2648
+ // // } else {
2649
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2650
+ // // }
2651
+ // }catch(e){
2652
+ // console.error('Error in initiateCall:', e);
2653
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2654
+ // this.isCallInProgress = false;
2655
+ // return false;
2656
+ // }
2657
+ // }
2658
+ async initiateCall() {
2659
+ try {
2660
+ if (!this.dialedNumber && this.lastDialed) {
2661
+ this.sanitizedNum = this.lastDialed.number;
2460
2662
  }
2461
- else if (response.status == 201) {
2462
- swal("Error", response.message.join("<br/>"), "error");
2463
- this.endCall();
2663
+ const isInvalid = await this.isInvalidNumber();
2664
+ if (isInvalid) {
2665
+ return false;
2464
2666
  }
2465
- }
2466
- catch (error) {
2467
- this.showRingAnimation = false;
2468
- this.handleError(error);
2469
- this.endCall();
2470
- }
2471
- }
2472
- async initiateCall(payload) {
2473
- return await this.extensionService.initiateCall(payload).toPromise();
2474
- }
2475
- async getCallAuthId(response) {
2476
- return {
2477
- id: response.callauth.id,
2478
- recordCall: response.callauth.recordCall
2479
- };
2480
- }
2481
- async getOutgoingCallToken(callAuthId) {
2482
- return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2483
- }
2484
- async connectToDevice(token, callData) {
2485
- const options = {
2486
- codecPreferences: ['opus', 'pcmu'],
2487
- closeProtection: true,
2488
- };
2489
- this.device = new Device(token.value, options);
2490
- this.call = await this.device.connect({
2491
- params: {
2492
- From: callData.from,
2493
- To: callData.phone,
2494
- Env: environment.abb,
2495
- Token: token.id,
2496
- Ext: callData.extNum
2497
- },
2498
- rtcConstraints: { audio: { deviceId: 'default' } },
2499
- });
2500
- this.setupEventListeners();
2501
- }
2502
- setupEventListeners() {
2503
- this.startTimer();
2504
- this.device?.on('error', (err) => {
2505
- console.log(err);
2506
- this.showRingAnimation = false;
2507
- this.stopTimer();
2508
- });
2509
- this.call?.on('error', (error) => {
2510
- this.showRingAnimation = false;
2511
- this.stopTimer();
2512
- });
2513
- this.call?.on('disconnect', () => {
2514
- this.endCall();
2515
- });
2516
- this.call?.on('ringing', () => {
2517
- });
2518
- this.call?.on('reject', () => {
2519
- this.endCall();
2520
- });
2521
- this.call?.on('accept', () => {
2522
- this.showRingAnimation = false;
2523
- this.disbaleEndCallBtn = false;
2524
- // Start recording if recordCall is true and call is accepted for 30 seconds
2525
- // if (this.recordCall) {
2526
- // setTimeout(() => {
2527
- // if (this.isRecording) return; // If already recording, skip
2528
- // this.startRecording();
2529
- // }, 30000);
2530
- // } else {
2531
- // this.stopRecording();
2532
- // }
2533
- });
2534
- this.call?.on('messageReceived', (message) => {
2535
- });
2536
- }
2537
- startTimer() {
2538
- let seconds = 0;
2539
- this.intervalId = setInterval(() => {
2540
- seconds++;
2541
- this.timer = this.formatTime(seconds);
2542
- }, 1000);
2543
- }
2544
- stopTimer() {
2545
- clearInterval(this.intervalId);
2546
- this.timer = '00:00';
2547
- }
2548
- formatTime(totalSeconds) {
2549
- const minutes = Math.floor(totalSeconds / 60);
2550
- const seconds = totalSeconds % 60;
2551
- return `${this.pad(minutes)}:${this.pad(seconds)}`;
2552
- }
2553
- pad(value) {
2554
- return value < 10 ? `0${value}` : `${value}`;
2555
- }
2556
- handleError(error) {
2557
- swal("Error", error, "error");
2558
- }
2559
- endCall() {
2560
- this.endCallEvent.emit();
2561
- if (this.call) {
2562
- this.call.disconnect();
2563
- }
2564
- this.showRingAnimation = false;
2565
- this.stopTimer();
2566
- this.maximiseDialpad();
2567
- }
2568
- toggleMute() {
2569
- this.isMute = !this.isMute;
2570
- this.call?.mute(this.isMute);
2571
- }
2572
- toggleKeypad() {
2573
- this.showKeypad = !this.showKeypad;
2574
- this.callInput = '';
2575
- }
2576
- onCallInputs(num) {
2577
- try {
2578
- if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
2579
- if (num == '#') {
2580
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2581
- }
2582
- else if (num == '*') {
2583
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2584
- }
2585
- else {
2586
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2587
- }
2588
- this.callInput = this.callInput + String(num);
2589
- this.showClearBtn = true;
2667
+ // this.saveLastDialed();
2668
+ this.isSavedContactDialled();
2669
+ this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2670
+ if (this.isPaymentDue) {
2671
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2672
+ return false;
2590
2673
  }
2591
- let str = String(num);
2592
- this.call?.sendDigits(str);
2593
- }
2594
- catch (e) {
2595
- console.log(e);
2596
- }
2597
- }
2598
- onCallInputEnter(ev) {
2599
- try {
2600
- this.call?.sendDigits(String(ev.key));
2601
- }
2602
- catch (e) {
2603
- console.log(e);
2604
- }
2605
- }
2606
- closeIncomingCall(data) {
2607
- // this.incomingCallDiv = false;
2608
- if (data.show) {
2609
- //this.showCallProgressEvent.emit()
2610
- // handle incoming call accepted
2611
- this.startTimer();
2612
- this.disbaleEndCallBtn = false;
2613
- this.call = data.call;
2614
- const incomingDetail = this.extensionService.getCallSid();
2615
- this.incomingRecordCall = incomingDetail.recordCall;
2616
- // Start recording if the call is answered and recording is enabled
2617
- if (this.incomingRecordCall) {
2618
- this.startRecording();
2674
+ this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2675
+ if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2676
+ // swal('Error', 'You can not dial this number');
2677
+ return false;
2619
2678
  }
2620
- else {
2621
- this.isRecording = false;
2679
+ // const hasPermission = await this.checkMicrophonePermission();
2680
+ // if (!hasPermission) {
2681
+ // await this.askForMicrophonePermission();
2682
+ // return false;
2683
+ // }
2684
+ if (!this.selectedCallerId) {
2685
+ this.shakeDedicatedBtn = true;
2686
+ this.showDialAlert('Select a C2C number to call');
2687
+ setTimeout(() => {
2688
+ this.shakeDedicatedBtn = false;
2689
+ }, 3000);
2690
+ return false;
2622
2691
  }
2623
- this.cdr.detectChanges();
2624
- }
2625
- else {
2626
- // incoming call rejected
2627
- this.endCallEvent.emit();
2628
- }
2629
- }
2630
- clearInputs() {
2631
- this.callInput = this.callInput.slice(0, -1);
2632
- }
2633
- minimiseDialpad() {
2634
- this.minimiseEvent.emit(true);
2635
- this.isMinimised = true;
2636
- }
2637
- maximiseDialpad() {
2638
- this.minimiseEvent.emit(false);
2639
- this.isMinimised = false;
2640
- }
2641
- toggleRecording() {
2642
- if (this.isRecording) {
2643
- this.stopRecording();
2644
- }
2645
- else {
2646
- this.startRecording();
2647
- }
2648
- }
2649
- startRecording() {
2650
- let sid;
2651
- const details = this.extensionService.getCallSid();
2652
- this.incomingCallSid = details.callSid;
2653
- this.incomingRecordCall = details.recordCall;
2654
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2655
- // if (!this.incomingRecordCall && !this.recordCall) {
2656
- // return;
2657
- // }
2658
- this.extensionService.getCallRecording(sid).subscribe(response => {
2659
- this.isRecording = true;
2660
- this.isPaused = false;
2661
- this.timeElapsed = 0;
2662
- this.startTimer1();
2663
- }, error => {
2664
- console.error('Error starting recording', error);
2665
- });
2666
- }
2667
- stopRecording() {
2668
- // if (!this.incomingRecordCall && !this.recordCall) {
2669
- // return;
2670
- // }
2671
- this.isRecording = false;
2672
- this.isPaused = false;
2673
- if (this.timerSubscription) {
2674
- this.timerSubscription.unsubscribe();
2692
+ // Clear displayNum if value is bound from previous call
2693
+ this.callData.displayNum = '';
2694
+ // Get number to be dialed from backend
2695
+ // await this.getToNumber(this.sanitizedNum);
2696
+ if (this.terminateCall) {
2697
+ this.terminateCall = false;
2698
+ return;
2699
+ }
2700
+ // Update call data in a single operation
2701
+ this.callData = {
2702
+ ...this.callData,
2703
+ phone: this.sanitizedNum,
2704
+ isIncomingCall: false,
2705
+ dial: true,
2706
+ from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2707
+ timestamp: new Date().toISOString()
2708
+ };
2709
+ console.log('Initiating call with data:', this.callData);
2710
+ this.isCallInProgress = true;
2711
+ this.callInitiated.emit({ ...this.callData });
2712
+ return true;
2675
2713
  }
2676
- }
2677
- pauseRecording() {
2678
- const details = this.extensionService.getCallSid();
2679
- this.incomingCallSid = details.callSid;
2680
- this.incomingRecordCall = details.recordCall;
2681
- const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2682
- // if (!this.incomingRecordCall && !this.recordCall) {
2683
- // return;
2684
- // }
2685
- this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
2686
- this.stopRecordingTimer();
2687
- this.isPaused = true;
2688
- }, error => {
2689
- console.error('Error pausing recording:', error);
2690
- // Consider updating the UI to show the error state
2691
- });
2692
- }
2693
- resumeRecording() {
2694
- let sid;
2695
- const details = this.extensionService.getCallSid();
2696
- this.incomingCallSid = details.callSid;
2697
- this.incomingRecordCall = details.recordCall;
2698
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2699
- // if (!this.incomingRecordCall && !this.recordCall) {
2700
- // return; // Skip if recording is not enabled
2701
- // }
2702
- this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
2703
- this.isPaused = false;
2704
- this.startTimer1();
2705
- }, error => {
2706
- console.error('Error resuming recording', error);
2707
- });
2708
- }
2709
- startTimer1() {
2710
- this.timerSubscription = interval(1000).subscribe(() => {
2711
- this.timeElapsed++;
2712
- });
2713
- }
2714
- stopRecordingTimer() {
2715
- if (this.timerSubscription) {
2716
- this.timerSubscription.unsubscribe(); // Pause the timer
2717
- this.timerSubscription = undefined; // Optionally reset the subscription
2714
+ catch (e) {
2715
+ console.error('Error in initiateCall:', e);
2716
+ this.showDialAlert('Failed to initiate call. Please try again.');
2717
+ this.isCallInProgress = false;
2718
+ return false;
2718
2719
  }
2719
2720
  }
2720
- getFormattedTime() {
2721
- const minutes = Math.floor(this.timeElapsed / 60);
2722
- const seconds = this.timeElapsed % 60;
2723
- return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
2724
- }
2725
- pollCallStatus(callAuthId) {
2726
- const maxTime = 30000; // Poll for up to 30 seconds
2727
- const pollInterval = 3000; // Poll every 3 seconds
2728
- let elapsedTime = 0;
2729
- const intervalId = setInterval(async () => {
2730
- elapsedTime += pollInterval;
2731
- try {
2732
- const statusResponse = await this.extensionService.getCallStatus(callAuthId).toPromise();
2733
- if (statusResponse && statusResponse.callDetails) {
2734
- this.callStatus = statusResponse.callDetails.callStatus;
2735
- if (this.callStatus === 'in-progress') {
2736
- this.callSid = statusResponse.callDetails.callSid;
2737
- if (this.recordCall && !this.isRecording) {
2738
- this.startRecording();
2739
- }
2740
- clearInterval(intervalId);
2741
- }
2742
- else if (this.callStatus === 'completed') {
2743
- clearInterval(intervalId);
2744
- this.endCall();
2745
- this.stopRecording();
2746
- }
2747
- else if (this.callStatus === 'ringing') {
2748
- // Continue polling; do not clear the interval yet
2749
- }
2750
- }
2751
- }
2752
- catch (error) {
2753
- clearInterval(intervalId);
2721
+ async isInvalidNumber() {
2722
+ try {
2723
+ if (this.sanitizedNum == '') {
2724
+ this.showDialAlert('Invalid Number');
2725
+ return true;
2754
2726
  }
2755
- if (elapsedTime >= maxTime) {
2756
- // console.log('Max polling time reached. Stopping poll.');
2757
- clearInterval(intervalId);
2727
+ const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2728
+ const phoneNumber = this.sanitizedNum;
2729
+ if (!validNumberPattern.test(phoneNumber)) {
2730
+ this.showDialAlert('Invalid Number');
2731
+ return true;
2758
2732
  }
2759
- }, pollInterval);
2733
+ return false;
2734
+ }
2735
+ catch (error) {
2736
+ this.showDialAlert('Invalid Number');
2737
+ return true; // Return true if an error occurred, meaning the number is invalid
2738
+ }
2760
2739
  }
2761
- getUserInformation(id) {
2762
- this.extensionService.getUserInformation(id).subscribe(response => {
2763
- console.log(response);
2764
- }, error => {
2765
- console.error('Error starting recording', error);
2740
+ // saveLastDialed() {
2741
+ // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2742
+ // if (contact) {
2743
+ // this.lastDialed = {
2744
+ // name: contact.name,
2745
+ // image: contact.image,
2746
+ // number: this.dialedNumber
2747
+ // };
2748
+ // } else {
2749
+ // if(this.dialedNumber){
2750
+ // this.lastDialed = { number: this.dialedNumber };
2751
+ // }
2752
+ // }
2753
+ // }
2754
+ isSavedContactDialled() {
2755
+ let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2756
+ let contact = this.contactList.filter(contact => {
2757
+ // return contact.numbersList.some(num => num.number === phoneNum)
2766
2758
  });
2767
- }
2768
- incomingCallsNewList(data) {
2769
- this.newIncomingCallsList = data;
2770
- this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2771
- }
2772
- selectedIncomingCallInfo(data) {
2773
- this.selectedIncomingCall = data;
2774
- }
2775
- ngOnDestroy() {
2776
- this.callData.dial = false;
2777
- if (this.timerSubscription) {
2778
- this.timerSubscription.unsubscribe();
2759
+ if (contact.length) {
2760
+ this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2761
+ this.callData.img = contact[0].image || 'assets/images/user.jpg';
2762
+ this.callData.phone = this.sanitizedNum;
2763
+ return true;
2779
2764
  }
2765
+ return false;
2780
2766
  }
2781
- }
2782
- 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 });
2783
- 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" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;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"] });
2784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2785
- type: Component,
2786
- args: [{ selector: 'lib-call-progress', template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;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"] }]
2787
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2788
- type: Input
2789
- }], newIncomingCallData: [{
2790
- type: Input
2791
- }], newIncomingCallsList: [{
2792
- type: Input
2793
- }], endCallEvent: [{
2794
- type: Output
2795
- }], incomingCallsNewInfo: [{
2796
- type: Output
2797
- }], minimiseEvent: [{
2798
- type: Output
2799
- }], incomingCallInitiated: [{
2800
- type: Output
2801
- }] } });
2802
-
2803
- const GlobalConstant = {
2804
- ErrorMsg500: "Unable to process request. Please try again later.",
2805
- isSMSVisible: true,
2806
- dedicatedNumText: 'C2C Number'
2807
- };
2808
-
2809
- class IncomingCallComponent {
2810
- constructor(extensionService, twilioService) {
2811
- this.extensionService = extensionService;
2812
- this.twilioService = twilioService;
2813
- this.showRingAnimation = true;
2814
- this.selectedIncomingCall = {};
2815
- this.twilioAuthId = '';
2816
- this.dedicatedNum = '';
2817
- this.recordCall = false;
2818
- this.shouldRecordCall = false;
2819
- this.isClickExpand = false;
2820
- this.disbaleEndCallBtn = true;
2821
- this.closeIncomingCallDiv = new EventEmitter();
2822
- this.incomingCallsNewList = new EventEmitter();
2823
- this.selectedIncomingCallInfo = new EventEmitter();
2824
- this.isMute = false;
2767
+ showDialAlert(message) {
2768
+ this.dialAlert = {
2769
+ msg: message,
2770
+ show: true
2771
+ };
2772
+ setTimeout(() => {
2773
+ this.dialAlert.show = false;
2774
+ }, 3000);
2825
2775
  }
2826
- ngOnInit() {
2776
+ async isCallerIdSet() {
2827
2777
  try {
2828
- this.twilioService.currentCall.subscribe(call => {
2829
- if (call) {
2830
- this.twilioCallData = call;
2831
- this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
2832
- if (!call.parameters) {
2833
- call.parameters = {};
2834
- }
2835
- this.sendIPforIncomingCall(this.twilioAuthId, '');
2836
- call.on('cancel', () => {
2837
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2838
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2839
- }
2840
- this.rejectCallFromList(call);
2841
- });
2842
- call.on('disconnect', () => {
2843
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2844
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2845
- }
2846
- this.rejectCallFromList(call);
2847
- });
2848
- }
2849
- });
2778
+ const tkn = localStorage.getItem('ext_token');
2779
+ const res = await this.extService.fetchCallerId(tkn || '').toPromise();
2780
+ if (res.status == 200) {
2781
+ localStorage.setItem('trialOver', res.trialOver);
2782
+ this.twilioService.isTrialOver.next(res.trialOver);
2783
+ localStorage.setItem('paymentDue', res.paymentDue);
2784
+ this.twilioService.isPaymentDue.next(res.paymentDue);
2785
+ }
2786
+ if (res.callerid) {
2787
+ localStorage.setItem('callerID', res.callerid);
2788
+ this.extService.changeMessage(res.callerid);
2789
+ }
2790
+ else {
2791
+ localStorage.setItem('callerID', 'Not set');
2792
+ this.extService.changeMessage('Not set');
2793
+ }
2794
+ return (localStorage.getItem('callerID') !== 'Not set');
2850
2795
  }
2851
2796
  catch (e) {
2852
2797
  console.log(e);
2798
+ return false;
2853
2799
  }
2854
2800
  }
2855
- acceptCallFromList(data) {
2856
- console.log(data, 'checking dii');
2857
- data.accept();
2858
- // data.parameters['isCallConnected'] = true;
2859
- data.isCallConnected = true;
2860
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
2861
- if (this.shouldRecordCall) { // default recording
2862
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2863
- this.closeIncomingCallWrapper(1);
2801
+ async checkMicrophonePermission() {
2802
+ try {
2803
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2804
+ stream.getTracks().forEach(track => track.stop());
2805
+ return true;
2806
+ }
2807
+ catch (error) {
2808
+ if (error instanceof DOMException && error.name === 'NotAllowedError') {
2809
+ return false;
2864
2810
  }
2865
- else { // manual recording
2866
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2867
- this.closeIncomingCallWrapper(1);
2811
+ else {
2812
+ return false;
2868
2813
  }
2869
- });
2814
+ }
2870
2815
  }
2871
- rejectCallFromList(data) {
2872
- if (!data)
2873
- return;
2874
- if (data.reject)
2875
- data.reject();
2876
- if (data.disconnect)
2877
- data.disconnect();
2878
- if (data.parameters) {
2879
- data.parameters['isCallConnected'] = false; // Should be false when rejecting
2816
+ async askForMicrophonePermission() {
2817
+ try {
2818
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2819
+ stream.getTracks().forEach(track => track.stop());
2880
2820
  }
2881
- if (data.customParameters) {
2882
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
2821
+ catch (error) {
2822
+ console.error('User denied microphone permission:', error);
2883
2823
  }
2884
- if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
2885
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
2886
- this.incomingCallsNewList.emit(this.newIncomingCallsList);
2887
- if (this.newIncomingCallsList.length == 0) {
2888
- this.closeIncomingCallDiv.emit({ show: 0, call: data });
2824
+ }
2825
+ // below function is to get the country code with number from server
2826
+ async getToNumber(dialedNumber) {
2827
+ if (dialedNumber[0] !== '+') {
2828
+ // this is case when user geolocation dial code is on
2829
+ let ipAddress = await this.ipService.getIpAddressInfo().toPromise();
2830
+ const res = await this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2831
+ if (res.status == 200) {
2832
+ this.toastTimeout = res.timeInterval * 1000;
2833
+ await this.showNumberToast(res);
2889
2834
  }
2890
2835
  }
2891
2836
  }
2892
- closeIncomingCallWrapper(val) {
2893
- this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
2837
+ isAlertEnable() {
2838
+ return localStorage.getItem('isAlertEnable');
2894
2839
  }
2895
- toggleMute(data) {
2896
- this.isMute = !this.isMute;
2897
- data.mute(this.isMute);
2840
+ async showNumberToast(data) {
2841
+ const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2842
+ if (isAlertOn == 'true') {
2843
+ this.callNumberToast.show = true;
2844
+ this.callNumberToast.number = data.toNumber;
2845
+ this.callNumberToast.displayNum = data.displayNumber;
2846
+ }
2847
+ this.callData.displayNum = data.displayNumber;
2848
+ //this.callData.phone = data.toNumber;
2849
+ await this.delay(this.toastTimeout);
2850
+ this.dialedNumber = data.toNumber;
2851
+ this.sanitizedNum = data.toNumber;
2852
+ this.callNumberToast.show = false;
2853
+ this.callNumberToast.number = '';
2854
+ this.callNumberToast.displayNum = '';
2898
2855
  }
2899
- sendIPforIncomingCall(recordId, callstatus) {
2900
- return new Promise((resolve, reject) => {
2901
- this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
2902
- const resp = res;
2903
- if (res.status == 200) {
2904
- if (resp.callAuth) {
2905
- this.CallSid = resp.callAuth.callSid;
2906
- this.recordCall = resp.callAuth.recordCall;
2907
- // Handle the recordCall flag
2908
- if (resp.callAuth.recordCall) {
2909
- this.shouldRecordCall = true;
2910
- }
2911
- else {
2912
- this.shouldRecordCall = false;
2913
- }
2914
- }
2915
- else {
2916
- // swal("Error", "Missing call authentication details.", "error");
2917
- }
2918
- resolve();
2856
+ delay(ms) {
2857
+ return new Promise(resolve => setTimeout(resolve, ms));
2858
+ }
2859
+ onMinimise(isMinimised) {
2860
+ this.isMinimised = isMinimised;
2861
+ this.minimiseEvent.emit(isMinimised);
2862
+ }
2863
+ handleNumberPaste(event) {
2864
+ event.preventDefault();
2865
+ const clipboardData = event.clipboardData || window.clipboardData;
2866
+ const pastedData = clipboardData.getData('text');
2867
+ // Log the pasted content to the console
2868
+ if (pastedData) {
2869
+ this.dialedNumber = pastedData;
2870
+ this.sanitizedNum = pastedData;
2871
+ }
2872
+ }
2873
+ onEnter(num) {
2874
+ console.log(num, 'number fn');
2875
+ this.dialedNumber = this.dialedNumber + num;
2876
+ this.sanitizedNum = this.dialedNumber;
2877
+ this.showInputClearBtn = true;
2878
+ this.numberDialed.emit(this.dialedNumber);
2879
+ }
2880
+ getUserCallSetting() {
2881
+ const tkn = localStorage.getItem('ext_token');
2882
+ this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2883
+ if (resp.status == 200) {
2884
+ //this.callPrefernce = resp.userSetting;
2885
+ this.callPreference = resp.callerid;
2886
+ this.getCallerIdList();
2887
+ }
2888
+ });
2889
+ }
2890
+ onDedicatedNumSelect(id) {
2891
+ this.selectedCallerId = id;
2892
+ this.isCallerIdHidden = true;
2893
+ this.extService.setCallerId(id);
2894
+ }
2895
+ cancelDialNumber() {
2896
+ this.terminateCall = true;
2897
+ this.callNumberToast.show = false;
2898
+ }
2899
+ handleDivKeydown(ev) {
2900
+ if (this.dialedNumber.length == 0) {
2901
+ this.dialInputElement.nativeElement.focus();
2902
+ }
2903
+ if (ev.key === 'Enter') {
2904
+ // Check if the dialpad is open
2905
+ if (!this.isDialpadHidden) {
2906
+ if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2907
+ this.initiateCall();
2919
2908
  }
2920
- else {
2921
- swal("Error", resp.message.join("<br/>"), "error");
2922
- resolve();
2909
+ if (!this.selectedCallerId) {
2910
+ this.shakeDedicatedBtn = true;
2911
+ setTimeout(() => {
2912
+ this.shakeDedicatedBtn = false;
2913
+ }, 10000);
2923
2914
  }
2924
- }, (error) => {
2925
- swal("Error", GlobalConstant.ErrorMsg500, "error");
2926
- resolve();
2927
- });
2928
- });
2915
+ }
2916
+ }
2929
2917
  }
2930
- onUserInfoByCallSid() {
2931
- if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
2918
+ onCallBtnMouseEnter(ev) {
2919
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2920
+ this.shakeDedicatedBtn = true;
2932
2921
  }
2933
- return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
2934
2922
  }
2935
- onClickExpand(data) {
2936
- if (this.selectedIncomingCall === data && this.isClickExpand) {
2937
- this.isClickExpand = false;
2938
- this.selectedIncomingCall = null;
2939
- this.selectedIncomingCallInfo.emit({});
2940
- return;
2923
+ onCallBtnMouseLeave(ev) {
2924
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2925
+ this.shakeDedicatedBtn = false;
2941
2926
  }
2942
- this.isClickExpand = true;
2943
- this.selectedIncomingCall = data;
2944
- if (this.selectedIncomingCall) {
2945
- this.selectedIncomingCall['isClickExpand'] = true;
2946
- if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2947
- this.newIncomingCallsList.forEach((call) => {
2948
- if (call !== this.selectedIncomingCall) {
2949
- call['isClickExpand'] = false;
2950
- }
2951
- });
2927
+ }
2928
+ acceptNewIncomingCall(call) {
2929
+ //first cut the current call
2930
+ //this.callData = call;
2931
+ this.newIncomingCallData = call;
2932
+ }
2933
+ rejectNewIncomingCall(call) {
2934
+ call.reject();
2935
+ this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2936
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2937
+ }
2938
+ newIncomingCallInitiated() {
2939
+ this.isCallInProgress = true;
2940
+ this.newIncomingCalls = [];
2941
+ this.incomingCallInitiated.emit();
2942
+ }
2943
+ incomingCallsNewInfo(data) {
2944
+ this.incomingCallsList = data;
2945
+ this.incomingCallsNewInfoEvent.emit(data);
2946
+ }
2947
+ ngOnDestroy() {
2948
+ try {
2949
+ console.log('Cleaning up C2cDialpadComponent');
2950
+ // Unsubscribe from all subscriptions
2951
+ if (this.subscriptions) {
2952
+ this.subscriptions.unsubscribe();
2952
2953
  }
2953
- this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
2954
- if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
2955
- this.getUserInformation(this.selectedIncomingCall);
2954
+ // End any active call
2955
+ if (this.isCallInProgress) {
2956
+ this.endCall();
2957
+ }
2958
+ // Clear any timeouts or intervals if they exist
2959
+ if (this.toastTimeout) {
2960
+ clearTimeout(this.toastTimeout);
2956
2961
  }
2962
+ console.log('C2cDialpadComponent cleanup complete');
2963
+ }
2964
+ catch (error) {
2965
+ console.error('Error during component cleanup:', error);
2957
2966
  }
2958
- }
2959
- getUserInformation(incomingCallData) {
2960
- let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2961
- this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
2962
- setTimeout(() => {
2963
- incomingCallData['userInfo'] = response;
2964
- }, 5000);
2965
- }, error => {
2966
- console.error('Error starting recording', error);
2967
- });
2968
- }
2969
- fromEntries(entries) {
2970
- return entries.reduce((acc, [key, value]) => {
2971
- acc[key] = value;
2972
- return acc;
2973
- }, {});
2974
2967
  }
2975
2968
  }
2976
- IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
2977
- IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *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]=\"incomingCallData.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\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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 <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?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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:385px;height:646px;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:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.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: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2978
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
2969
+ DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2970
+ DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, 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>\r\n msssmsm\r\n</div>\r\n<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 [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [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 : '&nbsp;'}}</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 <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\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;height:600px;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: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.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"], outputs: ["endCallEvent", "incomingCallsNewInfo", "minimiseEvent", "showCallProgressEvent", "incomingCallInitiated"] }] });
2971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
2979
2972
  type: Component,
2980
- args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *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]=\"incomingCallData.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\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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 <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?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (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:385px;height:646px;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:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.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"] }]
2981
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
2982
- type: Input
2983
- }], newIncomingCallsList: [{
2973
+ args: [{ selector: 'lib-dialbox', template: "<div>\r\n msssmsm\r\n</div>\r\n<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 [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [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 : '&nbsp;'}}</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 <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\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;height:600px;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"] }]
2974
+ }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
2984
2975
  type: Input
2985
- }], closeIncomingCallDiv: [{
2976
+ }], closeDialpadEvent: [{
2986
2977
  type: Output
2987
- }], incomingCallsNewList: [{
2978
+ }], callInitiated: [{
2988
2979
  type: Output
2989
- }], selectedIncomingCallInfo: [{
2980
+ }], endCallEvent: [{
2981
+ type: Output
2982
+ }], minimiseEvent: [{
2983
+ type: Output
2984
+ }], incomingCallsNewInfoEvent: [{
2985
+ type: Output
2986
+ }], incomingCallInitiated: [{
2987
+ type: Output
2988
+ }], dialInputElement: [{
2989
+ type: ViewChild,
2990
+ args: ['dialInput']
2991
+ }], numberDialed: [{
2990
2992
  type: Output
2991
2993
  }] } });
2992
2994
 
@@ -3025,13 +3027,16 @@ class CallerIdDialogComponent {
3025
3027
  let val = ev.target.checked ? 'true' : 'false';
3026
3028
  localStorage.setItem('isAlertEnable', val);
3027
3029
  }
3030
+ doNotShowAgain() {
3031
+ console.log('doNotShowAgain');
3032
+ }
3028
3033
  }
3029
- CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3030
- 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: [""] });
3034
+ CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3035
+ 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: [""], dependencies: [{ kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
3031
3036
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, decorators: [{
3032
3037
  type: Component,
3033
- 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> -->" }]
3034
- }], ctorParameters: function () { return [{ type: i4.Router }, { type: TwilioService }, { type: i3.MatDialogRef }, { type: undefined, decorators: [{
3038
+ 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>" }]
3039
+ }], ctorParameters: function () { return [{ type: i4.Router }, { type: TwilioService }, { type: i3$2.MatDialogRef }, { type: undefined, decorators: [{
3035
3040
  type: Inject,
3036
3041
  args: [MAT_DIALOG_DATA]
3037
3042
  }] }]; } });
@@ -3061,20 +3066,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3061
3066
  DialboxComponent,
3062
3067
  CallProgressComponent,
3063
3068
  CallerIdDialogComponent,
3064
- IncomingCallComponent,
3069
+ IncomingCallComponent
3065
3070
  ],
3066
3071
  imports: [
3067
3072
  CommonModule,
3068
3073
  FormsModule,
3069
3074
  ReactiveFormsModule,
3070
3075
  HttpClientModule,
3071
- RouterLink,
3076
+ RouterLink
3072
3077
  ],
3073
3078
  exports: [
3074
3079
  DialboxComponent,
3075
3080
  CallProgressComponent,
3076
3081
  CallerIdDialogComponent,
3077
- IncomingCallComponent,
3082
+ IncomingCallComponent
3078
3083
  ]
3079
3084
  }]
3080
3085
  }] });