@vgroup/dialbox 0.3.11 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/call-progress/call-progress.component.mjs +13 -13
- package/esm2020/lib/components/call-progress/incoming-call/incoming-call.component.mjs +6 -29
- package/esm2020/lib/dialbox.component.mjs +6 -2
- package/fesm2015/vgroup-dialbox.mjs +26 -42
- package/fesm2015/vgroup-dialbox.mjs.map +1 -1
- package/fesm2020/vgroup-dialbox.mjs +22 -40
- package/fesm2020/vgroup-dialbox.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1997,33 +1997,11 @@ class IncomingCallComponent {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
add() {
|
|
1999
1999
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
}).toPromise();
|
|
2006
|
-
console.log('Conference token received:', tokenResponse);
|
|
2007
|
-
// Step 2: Create a new device with conference token
|
|
2008
|
-
const conferenceDevice = new Device(tokenResponse.token.value, {
|
|
2009
|
-
codecPreferences: ['opus', 'pcmu'],
|
|
2010
|
-
closeProtection: true
|
|
2011
|
-
});
|
|
2012
|
-
// Step 3: Connect to the conference
|
|
2013
|
-
const call = yield conferenceDevice.connect({
|
|
2014
|
-
params: {
|
|
2015
|
-
conferenceName: this.twilioService.conferenceName
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2018
|
-
console.log('Conference call connected:', call);
|
|
2019
|
-
this.twilioCallData = call;
|
|
2020
|
-
// Step 4: Emit to parent component
|
|
2021
|
-
this.closeIncomingCallDiv.emit({ show: 1, call: call });
|
|
2022
|
-
}
|
|
2023
|
-
catch (error) {
|
|
2024
|
-
console.error('Error connecting to conference:', error);
|
|
2025
|
-
swal("Error", "Failed to join the conference. Please try again.", "error");
|
|
2026
|
-
}
|
|
2000
|
+
let device = yield this.twilioService.connect('');
|
|
2001
|
+
console.log(device, 'callConnect');
|
|
2002
|
+
// this.device = new Device();/
|
|
2003
|
+
// Device.connect({ conferenceName: 'my-conference-room' });
|
|
2004
|
+
// this.device = new Device({ conferenceName: 'my-conference-room' });
|
|
2027
2005
|
});
|
|
2028
2006
|
}
|
|
2029
2007
|
}
|
|
@@ -2546,18 +2524,7 @@ class CallProgressComponent {
|
|
|
2546
2524
|
const contactName = [contact === null || contact === void 0 ? void 0 : contact.firstName, contact === null || contact === void 0 ? void 0 : contact.middleName, contact === null || contact === void 0 ? void 0 : contact.lastName]
|
|
2547
2525
|
.filter(Boolean)
|
|
2548
2526
|
.join(' ');
|
|
2549
|
-
this.callData = {
|
|
2550
|
-
// ...this.callData,
|
|
2551
|
-
phone: phoneNumber,
|
|
2552
|
-
displayNum: phoneNumber,
|
|
2553
|
-
name: contactName || phoneNumber,
|
|
2554
|
-
img: (contact === null || contact === void 0 ? void 0 : contact.img) || 'assets/images/user.jpg',
|
|
2555
|
-
participantId: '',
|
|
2556
|
-
from: (_d = this.selectedCallerId) === null || _d === void 0 ? void 0 : _d.number,
|
|
2557
|
-
isIncomingCall: false,
|
|
2558
|
-
};
|
|
2559
2527
|
// this.call['callInfo'] = JSON.parse(JSON.stringify(this.callData));
|
|
2560
|
-
this.cdr.detectChanges();
|
|
2561
2528
|
// Get the conference ID from the current call or use the stored one
|
|
2562
2529
|
const conferenceId = this.conferenceId;
|
|
2563
2530
|
if (!conferenceId) {
|
|
@@ -2568,12 +2535,26 @@ class CallProgressComponent {
|
|
|
2568
2535
|
}
|
|
2569
2536
|
// Add participant to the conference
|
|
2570
2537
|
let data = yield this.addParticipantToCall({
|
|
2571
|
-
from: (
|
|
2538
|
+
from: (_d = this.callData) === null || _d === void 0 ? void 0 : _d.from,
|
|
2572
2539
|
route: "OUTGOING",
|
|
2573
2540
|
participantNumber: phoneNumber,
|
|
2574
2541
|
conferenceId: conferenceId
|
|
2575
2542
|
});
|
|
2576
|
-
this.callData =
|
|
2543
|
+
// this.callData = {
|
|
2544
|
+
// ...this.callData,
|
|
2545
|
+
// participantId: ,
|
|
2546
|
+
// }
|
|
2547
|
+
this.callData = {
|
|
2548
|
+
// ...this.callData,
|
|
2549
|
+
phone: phoneNumber,
|
|
2550
|
+
displayNum: phoneNumber,
|
|
2551
|
+
name: contactName || phoneNumber,
|
|
2552
|
+
img: (contact === null || contact === void 0 ? void 0 : contact.img) || 'assets/images/user.jpg',
|
|
2553
|
+
participantId: data === null || data === void 0 ? void 0 : data.participantId,
|
|
2554
|
+
from: (_e = this.selectedCallerId) === null || _e === void 0 ? void 0 : _e.number,
|
|
2555
|
+
isIncomingCall: false,
|
|
2556
|
+
};
|
|
2557
|
+
this.cdr.detectChanges();
|
|
2577
2558
|
console.log(this.callData, 'this.callData');
|
|
2578
2559
|
console.log('test111111');
|
|
2579
2560
|
this.currentCallList.push(this.callData);
|
|
@@ -3175,12 +3156,15 @@ class DialboxComponent {
|
|
|
3175
3156
|
this.incomeingCallSocketService.connect();
|
|
3176
3157
|
try {
|
|
3177
3158
|
this.incomeingCallSocketService.listen().subscribe((incomingCallData) => __awaiter(this, void 0, void 0, function* () {
|
|
3178
|
-
var _a;
|
|
3179
3159
|
// const data = JSON.parse(incomingCallData.data);
|
|
3180
3160
|
console.log("WS Event Received:", incomingCallData);
|
|
3181
3161
|
console.log("WS Event Received:", incomingCallData.data);
|
|
3182
3162
|
this.twilioService.conferenceName = incomingCallData.conferenceName;
|
|
3183
|
-
let participants =
|
|
3163
|
+
let participants = [];
|
|
3164
|
+
if (!!incomingCallData.participants) {
|
|
3165
|
+
participants = incomingCallData.participants.length > 0 ? incomingCallData.participants.filter((item) => !item.isLeft) : [];
|
|
3166
|
+
}
|
|
3167
|
+
// incomingCallData.participants.length ? incomingCallData.participants.filter((item: any) => !item.isLeft) : [];
|
|
3184
3168
|
if (participants.length > 0) {
|
|
3185
3169
|
// this.showIncomingCallPopup(incoming, data/
|
|
3186
3170
|
this.isCallInProgress = true;
|