@ipcom/asterisk-ari 0.0.65 → 0.0.67

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/dist/esm/index.js CHANGED
@@ -868,6 +868,7 @@ var ChannelInstance = class extends EventEmitter2 {
868
868
  this.client = client;
869
869
  this.baseClient = baseClient;
870
870
  this.channelId = channelId;
871
+ this.id = channelId || `channel-${Date.now()}`;
871
872
  this.baseClient.onWebSocketEvent((event) => {
872
873
  if (this.isChannelEvent(event) && event.channel?.id === this.channelId) {
873
874
  this.emit(event.type, event);
@@ -875,6 +876,8 @@ var ChannelInstance = class extends EventEmitter2 {
875
876
  });
876
877
  }
877
878
  channelData = null;
879
+ id;
880
+ // ID do canal
878
881
  /**
879
882
  * Verifica se o evento possui a propriedade `channel`.
880
883
  * @param event Evento recebido.
@@ -903,12 +906,6 @@ var ChannelInstance = class extends EventEmitter2 {
903
906
  super.off(event, callback);
904
907
  return this;
905
908
  }
906
- /**
907
- * Getter para o ID do canal.
908
- */
909
- get id() {
910
- return this.channelId;
911
- }
912
909
  async answer() {
913
910
  await this.baseClient.post(`/channels/${this.id}/answer`);
914
911
  }
@@ -1416,7 +1413,7 @@ var Playbacks = class extends EventEmitter3 {
1416
1413
  * Verifica se o evento é relacionado a um playback.
1417
1414
  */
1418
1415
  isPlaybackEvent(event) {
1419
- console.log(event);
1416
+ console.log({ eventAri: event });
1420
1417
  return event && typeof event === "object" && "playbackId" in event;
1421
1418
  }
1422
1419
  /**