@vgroup/dialbox 0.3.12 → 0.3.15

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.
@@ -1632,7 +1632,12 @@ class TwilioService {
1632
1632
  return this.http.get(environment.apiUrl + '/utilities/softphone/check/countryCode/' + dialledNo, httpOptions);
1633
1633
  }
1634
1634
  connect(data) {
1635
- return this.device.connect({ conferenceName: this.conferenceName });
1635
+ return this.device.connectdevice.connect({
1636
+ params: {
1637
+ Token: this.conferenceCallInfo.conferenceId,
1638
+ ConferenceName: this.conferenceCallInfo.conferenceName
1639
+ },
1640
+ });
1636
1641
  }
1637
1642
  }
1638
1643
  TwilioService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TwilioService, deps: [{ token: i1.HttpClient }, { token: ExtensionService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -1994,33 +1999,11 @@ class IncomingCallComponent {
1994
1999
  this.extensionService.getRemoveParticipants(this.incomingCallData.participantId, this.incomingCallData.conferenceId).toPromise();
1995
2000
  }
1996
2001
  async add() {
1997
- try {
1998
- console.log('Connecting to conference...', this.incomingCallData);
1999
- // Step 1: Get conference token
2000
- const tokenResponse = await this.extensionService.getConferenceCallToken({
2001
- authId: this.incomingCallData.conferenceId || this.incomingCallData.conferenceSid
2002
- }).toPromise();
2003
- console.log('Conference token received:', tokenResponse);
2004
- // Step 2: Create a new device with conference token
2005
- const conferenceDevice = new Device(tokenResponse.token.value, {
2006
- codecPreferences: ['opus', 'pcmu'],
2007
- closeProtection: true
2008
- });
2009
- // Step 3: Connect to the conference
2010
- const call = await conferenceDevice.connect({
2011
- params: {
2012
- conferenceName: this.twilioService.conferenceName
2013
- }
2014
- });
2015
- console.log('Conference call connected:', call);
2016
- this.twilioCallData = call;
2017
- // Step 4: Emit to parent component
2018
- this.closeIncomingCallDiv.emit({ show: 1, call: call });
2019
- }
2020
- catch (error) {
2021
- console.error('Error connecting to conference:', error);
2022
- swal("Error", "Failed to join the conference. Please try again.", "error");
2023
- }
2002
+ let device = await this.twilioService.connect('');
2003
+ console.log(device, 'callConnect');
2004
+ // this.device = new Device();/
2005
+ // Device.connect({ conferenceName: 'my-conference-room' });
2006
+ // this.device = new Device({ conferenceName: 'my-conference-room' });
2024
2007
  }
2025
2008
  }
2026
2009
  IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
@@ -3142,10 +3125,10 @@ class DialboxComponent {
3142
3125
  // const data = JSON.parse(incomingCallData.data);
3143
3126
  console.log("WS Event Received:", incomingCallData);
3144
3127
  console.log("WS Event Received:", incomingCallData.data);
3145
- this.twilioService.conferenceName = incomingCallData.conferenceName;
3128
+ this.twilioService.conferenceCallInfo = incomingCallData;
3146
3129
  let participants = [];
3147
- if (incomingCallData.participants.length && incomingCallData.participants) {
3148
- participants = incomingCallData.participants.filter((item) => !item.isLeft);
3130
+ if (!!incomingCallData.participants) {
3131
+ participants = incomingCallData.participants.length > 0 ? incomingCallData.participants.filter((item) => !item.isLeft) : [];
3149
3132
  }
3150
3133
  // incomingCallData.participants.length ? incomingCallData.participants.filter((item: any) => !item.isLeft) : [];
3151
3134
  if (participants.length > 0) {