@ipcom/asterisk-ari 0.0.54 → 0.0.56
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/cjs/index.cjs +21 -0
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/esm/index.js +21 -0
- package/dist/esm/index.js.map +2 -2
- package/dist/types/ari-client/ariClient.d.ts +1 -0
- package/dist/types/ari-client/ariClient.d.ts.map +1 -1
- package/dist/types/ari-client/resources/channels.d.ts +11 -0
- package/dist/types/ari-client/resources/channels.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1115,6 +1115,12 @@ var Channels = class extends import_events2.EventEmitter {
|
|
|
1115
1115
|
async originate(data) {
|
|
1116
1116
|
return this.baseClient.post("/channels", data);
|
|
1117
1117
|
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Obtém detalhes de um canal específico.
|
|
1120
|
+
*/
|
|
1121
|
+
async getDetails(channelId) {
|
|
1122
|
+
return this.baseClient.get(`/channels/${channelId}`);
|
|
1123
|
+
}
|
|
1118
1124
|
/**
|
|
1119
1125
|
* Lista todos os canais ativos.
|
|
1120
1126
|
*/
|
|
@@ -1125,6 +1131,18 @@ var Channels = class extends import_events2.EventEmitter {
|
|
|
1125
1131
|
}
|
|
1126
1132
|
return channels;
|
|
1127
1133
|
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Encerra um canal específico.
|
|
1136
|
+
*/
|
|
1137
|
+
async hangup(channelId, options) {
|
|
1138
|
+
const queryParams = new URLSearchParams({
|
|
1139
|
+
...options?.reason_code && { reason_code: options.reason_code },
|
|
1140
|
+
...options?.reason && { reason: options.reason }
|
|
1141
|
+
});
|
|
1142
|
+
return this.baseClient.delete(
|
|
1143
|
+
`/channels/${channelId}?${queryParams.toString()}`
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1128
1146
|
/**
|
|
1129
1147
|
* Inicia a escuta em um canal.
|
|
1130
1148
|
*/
|
|
@@ -1949,6 +1967,9 @@ var AriClient = class {
|
|
|
1949
1967
|
async listChannels() {
|
|
1950
1968
|
return this.channels.list();
|
|
1951
1969
|
}
|
|
1970
|
+
async hangupChannel(channelId) {
|
|
1971
|
+
return this.channels.hangup(channelId);
|
|
1972
|
+
}
|
|
1952
1973
|
/**
|
|
1953
1974
|
* Creates a new channel.
|
|
1954
1975
|
*/
|