@ipcom/asterisk-ari 0.0.55 → 0.0.57

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.
@@ -929,6 +929,9 @@ var ChannelInstance = class extends import_events2.EventEmitter {
929
929
  get id() {
930
930
  return this.channelId;
931
931
  }
932
+ async answer() {
933
+ await this.baseClient.post(`/channels/${this.id}/answer`);
934
+ }
932
935
  /**
933
936
  * Origina um canal físico no Asterisk.
934
937
  */
@@ -1131,6 +1134,18 @@ var Channels = class extends import_events2.EventEmitter {
1131
1134
  }
1132
1135
  return channels;
1133
1136
  }
1137
+ /**
1138
+ * Encerra um canal específico.
1139
+ */
1140
+ async hangup(channelId, options) {
1141
+ const queryParams = new URLSearchParams({
1142
+ ...options?.reason_code && { reason_code: options.reason_code },
1143
+ ...options?.reason && { reason: options.reason }
1144
+ });
1145
+ return this.baseClient.delete(
1146
+ `/channels/${channelId}?${queryParams.toString()}`
1147
+ );
1148
+ }
1134
1149
  /**
1135
1150
  * Inicia a escuta em um canal.
1136
1151
  */
@@ -1955,6 +1970,9 @@ var AriClient = class {
1955
1970
  async listChannels() {
1956
1971
  return this.channels.list();
1957
1972
  }
1973
+ async hangupChannel(channelId) {
1974
+ return this.channels.hangup(channelId);
1975
+ }
1958
1976
  /**
1959
1977
  * Creates a new channel.
1960
1978
  */