@ipcom/asterisk-ari 0.0.141 → 0.0.142
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
|
@@ -1489,6 +1489,27 @@ var Channels = class {
|
|
|
1489
1489
|
throw new Error(`Failed to manage channel instance: ${message}`);
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Retrieves the details of a specific channel.
|
|
1494
|
+
*
|
|
1495
|
+
* @param {string} id - The unique identifier of the channel to retrieve.
|
|
1496
|
+
* @returns {Promise<Channel>} A promise that resolves to the Channel object containing the channel details.
|
|
1497
|
+
* @throws {Error} If no channel ID is associated with this instance or if there's an error retrieving the channel details.
|
|
1498
|
+
*/
|
|
1499
|
+
async get(id) {
|
|
1500
|
+
try {
|
|
1501
|
+
if (id) {
|
|
1502
|
+
throw new Error("No channel ID associated with this instance");
|
|
1503
|
+
}
|
|
1504
|
+
const details = await this.baseClient.get(`/channels/${id}`);
|
|
1505
|
+
console.log(`Retrieved channel details for ${id}`);
|
|
1506
|
+
return details;
|
|
1507
|
+
} catch (error) {
|
|
1508
|
+
const message = getErrorMessage(error);
|
|
1509
|
+
console.error(`Error retrieving channel details for ${id}:`, message);
|
|
1510
|
+
throw new Error(`Failed to get channel details: ${message}`);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1492
1513
|
/**
|
|
1493
1514
|
* Removes a channel instance from the collection.
|
|
1494
1515
|
*/
|