@ipcom/asterisk-ari 0.0.18 → 0.0.20

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.
@@ -644,8 +644,8 @@ var Applications = class {
644
644
  }
645
645
  /**
646
646
  * Lists all applications.
647
- *
648
- * @returns A promise that resolves to an array of Application objects representing all registered applications.
647
+ *
648
+ * @returns A promise that resolves to an array of Application objects.
649
649
  * @throws {Error} If the API response is not an array.
650
650
  */
651
651
  async list() {
@@ -657,27 +657,98 @@ var Applications = class {
657
657
  }
658
658
  /**
659
659
  * Retrieves details of a specific application.
660
- *
661
- * @param appName - The unique name of the application.
662
- * @returns A promise that resolves to an ApplicationDetails object containing the details of the specified application.
660
+ *
661
+ * @param appName - The name of the application to retrieve details for.
662
+ * @returns A promise that resolves to an ApplicationDetails object.
663
+ * @throws {Error} If there's an error fetching the application details.
663
664
  */
664
665
  async getDetails(appName) {
665
- return this.client.get(`/applications/${appName}`);
666
+ try {
667
+ return await this.client.get(
668
+ `/applications/${appName}`
669
+ );
670
+ } catch (error) {
671
+ console.error(`Erro ao obter detalhes do aplicativo ${appName}:`, error);
672
+ throw error;
673
+ }
666
674
  }
667
675
  /**
668
676
  * Sends a message to a specific application.
669
- *
670
- * @param appName - The unique name of the application.
671
- * @param body - The message body to send.
672
- * @returns A promise that resolves when the message is sent successfully.
677
+ *
678
+ * @param appName - The name of the application to send the message to.
679
+ * @param body - The message to be sent, containing an event and optional data.
680
+ * @returns A promise that resolves when the message is successfully sent.
673
681
  */
674
682
  async sendMessage(appName, body) {
675
683
  await this.client.post(`/applications/${appName}/messages`, body);
676
684
  }
677
685
  };
678
686
 
679
- // src/ari-client/resources/channels.ts
687
+ // src/ari-client/resources/asterisk.ts
680
688
  function toQueryParams(options) {
689
+ return new URLSearchParams(
690
+ Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
691
+ ).toString();
692
+ }
693
+ var Asterisk = class {
694
+ constructor(client) {
695
+ this.client = client;
696
+ }
697
+ /**
698
+ * Retrieves information about the Asterisk server.
699
+ */
700
+ async getInfo() {
701
+ return this.client.get("/asterisk/info");
702
+ }
703
+ /**
704
+ * Lists all loaded modules in the Asterisk server.
705
+ */
706
+ async listModules() {
707
+ return this.client.get("/asterisk/modules");
708
+ }
709
+ /**
710
+ * Manages a specific module in the Asterisk server.
711
+ */
712
+ async manageModule(moduleName, action) {
713
+ return this.client.post(
714
+ `/asterisk/modules/${moduleName}?action=${encodeURIComponent(action)}`
715
+ );
716
+ }
717
+ /**
718
+ * Retrieves all configured logging channels.
719
+ */
720
+ async listLoggingChannels() {
721
+ return this.client.get("/asterisk/logging");
722
+ }
723
+ /**
724
+ * Adds or removes a log channel in the Asterisk server.
725
+ */
726
+ async manageLogChannel(logChannelName, action, configuration) {
727
+ const queryParams = toQueryParams(configuration || {});
728
+ return this.client.post(
729
+ `/asterisk/logging/${logChannelName}?action=${encodeURIComponent(action)}&${queryParams}`
730
+ );
731
+ }
732
+ /**
733
+ * Retrieves the value of a global variable.
734
+ */
735
+ async getGlobalVariable(variableName) {
736
+ return this.client.get(
737
+ `/asterisk/variables?variable=${encodeURIComponent(variableName)}`
738
+ );
739
+ }
740
+ /**
741
+ * Sets a global variable.
742
+ */
743
+ async setGlobalVariable(variableName, value) {
744
+ return this.client.post(
745
+ `/asterisk/variables?variable=${encodeURIComponent(variableName)}&value=${encodeURIComponent(value)}`
746
+ );
747
+ }
748
+ };
749
+
750
+ // src/ari-client/resources/channels.ts
751
+ function toQueryParams2(options) {
681
752
  return new URLSearchParams(
682
753
  Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, value])
683
754
  // Garante que value é string
@@ -864,7 +935,7 @@ var Channels = class {
864
935
  * Starts snooping on a channel.
865
936
  */
866
937
  async snoopChannel(channelId, options) {
867
- const queryParams = toQueryParams(options);
938
+ const queryParams = toQueryParams2(options);
868
939
  return this.client.post(
869
940
  `/channels/${channelId}/snoop?${queryParams}`
870
941
  );
@@ -1143,13 +1214,17 @@ var WebSocketClient = class {
1143
1214
  throw new Error("WebSocket n\xE3o est\xE1 conectado.");
1144
1215
  }
1145
1216
  if (event === "message") {
1146
- this.ws.on(event, (data) => {
1217
+ this.ws.on(event, (rawData) => {
1147
1218
  try {
1148
- const decodedData = JSON.parse(data.toString());
1149
- callback(decodedData);
1219
+ const decodedData = JSON.parse(rawData.toString());
1220
+ if (decodedData?.type) {
1221
+ const matchedEvent = decodedData;
1222
+ callback(matchedEvent);
1223
+ } else {
1224
+ console.warn("Mensagem sem tipo:", decodedData);
1225
+ }
1150
1226
  } catch (err) {
1151
1227
  console.error("Erro ao decodificar mensagem do WebSocket:", err);
1152
- callback(data);
1153
1228
  }
1154
1229
  });
1155
1230
  } else {
@@ -1188,6 +1263,7 @@ var AriClient = class {
1188
1263
  this.applications = new Applications(this.baseClient);
1189
1264
  this.playbacks = new Playbacks(this.baseClient);
1190
1265
  this.sounds = new Sounds(this.baseClient);
1266
+ this.asterisk = new Asterisk(this.baseClient);
1191
1267
  }
1192
1268
  wsClient = null;
1193
1269
  baseClient;
@@ -1197,13 +1273,14 @@ var AriClient = class {
1197
1273
  applications;
1198
1274
  playbacks;
1199
1275
  sounds;
1276
+ asterisk;
1200
1277
  /**
1201
1278
  * Connects to the ARI WebSocket for a specific application.
1202
1279
  *
1203
1280
  * @param app - The application name to connect to.
1204
1281
  * @returns {Promise<void>} Resolves when the WebSocket connects successfully.
1205
1282
  */
1206
- async connectWebSocket(app) {
1283
+ async connectWebSocket(app, subscribedEvents) {
1207
1284
  if (!app) {
1208
1285
  throw new Error(
1209
1286
  "The 'app' parameter is required to connect to the WebSocket."
@@ -1214,8 +1291,9 @@ var AriClient = class {
1214
1291
  return;
1215
1292
  }
1216
1293
  this.isReconnecting = true;
1294
+ const eventsParam = subscribedEvents && subscribedEvents.length > 0 ? `&event=${subscribedEvents.join(",")}` : "&subscribeAll=true";
1217
1295
  const protocol = this.config.secure ? "wss" : "ws";
1218
- const wsUrl = `${protocol}://${encodeURIComponent(this.config.username)}:${encodeURIComponent(this.config.password)}@${this.config.host}:${this.config.port}/ari/events?app=${app}`;
1296
+ const wsUrl = `${protocol}://${encodeURIComponent(this.config.username)}:${encodeURIComponent(this.config.password)}@${this.config.host}:${this.config.port}/ari/events?app=${app}${eventsParam}`;
1219
1297
  const backoffOptions = {
1220
1298
  delayFirstAttempt: false,
1221
1299
  startingDelay: 1e3,
@@ -1279,16 +1357,22 @@ var AriClient = class {
1279
1357
  return this.wsClient ? this.wsClient.isConnected() : false;
1280
1358
  }
1281
1359
  /**
1282
- * Registers a callback for a specific WebSocket event.
1360
+ * Registers a callback function for WebSocket events.
1361
+ * This method allows you to listen for and respond to WebSocket messages
1362
+ * and process specific event types.
1283
1363
  *
1284
- * @param event - The WebSocket event to listen for.
1285
- * @param callback - The callback function to execute when the event occurs.
1364
+ * @param callback - The callback function to execute when a WebSocket message is received.
1365
+ * The function will receive the parsed event data as its parameter.
1366
+ * @throws {Error} Throws an error if the WebSocket is not connected when trying to register the event.
1367
+ * @returns {void}
1286
1368
  */
1287
- onWebSocketEvent(event, callback) {
1369
+ onWebSocketEvent(callback) {
1288
1370
  if (!this.wsClient) {
1289
1371
  throw new Error("WebSocket is not connected.");
1290
1372
  }
1291
- this.wsClient.on(event, callback);
1373
+ this.wsClient.on("message", (data) => {
1374
+ callback(data);
1375
+ });
1292
1376
  }
1293
1377
  /**
1294
1378
  * Closes the WebSocket connection.
@@ -1431,7 +1515,14 @@ var AriClient = class {
1431
1515
  return this.channels.snoopChannelWithId(channelId, snoopId, options);
1432
1516
  }
1433
1517
  /**
1434
- * Dials a created channel.
1518
+ * Initiates a dial operation on a previously created channel.
1519
+ * This function attempts to connect the specified channel to its configured destination.
1520
+ *
1521
+ * @param channelId - The unique identifier of the channel to dial.
1522
+ * @param caller - Optional. The caller ID to use for the outgoing call. If not provided, the default caller ID for the channel will be used.
1523
+ * @param timeout - Optional. The maximum time in seconds to wait for the dial operation to complete. If not specified, the system's default timeout will be used.
1524
+ * @returns A Promise that resolves when the dial operation has been initiated successfully. Note that this does not guarantee that the call was answered, only that dialing has begun.
1525
+ * @throws Will throw an error if the dial operation fails, e.g., if the channel doesn't exist or is in an invalid state.
1435
1526
  */
1436
1527
  async dialChannel(channelId, caller, timeout) {
1437
1528
  return this.channels.dial(channelId, caller, timeout);
@@ -1467,53 +1558,146 @@ var AriClient = class {
1467
1558
  return this.channels.ringChannel(channelId);
1468
1559
  }
1469
1560
  /**
1470
- * Stops ringing indication on a channel.
1561
+ * Stops the ringing indication on a specified channel in the Asterisk system.
1562
+ *
1563
+ * This function sends a request to the Asterisk server to cease the ringing
1564
+ * indication on a particular channel. This is typically used when you want to
1565
+ * stop the ringing sound on a channel without answering or hanging up the call.
1566
+ *
1567
+ * @param channelId - The unique identifier of the channel on which to stop the ringing.
1568
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1569
+ *
1570
+ * @returns A Promise that resolves when the ringing has been successfully stopped on the specified channel.
1571
+ * The promise resolves to void, indicating no specific return value.
1572
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1471
1573
  */
1472
1574
  async stopRingChannel(channelId) {
1473
1575
  return this.channels.stopRingChannel(channelId);
1474
1576
  }
1475
1577
  /**
1476
- * Sends DTMF to a channel.
1578
+ * Sends DTMF (Dual-Tone Multi-Frequency) tones to a specified channel.
1579
+ *
1580
+ * This function allows sending DTMF tones to a channel, which can be used for various purposes
1581
+ * such as interacting with IVR systems or sending signals during a call.
1582
+ *
1583
+ * @param channelId - The unique identifier of the channel to send DTMF tones to.
1584
+ * @param dtmf - A string representing the DTMF tones to send (e.g., "123#").
1585
+ * @param options - Optional parameters to control the timing of DTMF tones.
1586
+ * @param options.before - The time (in milliseconds) to wait before sending DTMF.
1587
+ * @param options.between - The time (in milliseconds) to wait between each DTMF tone.
1588
+ * @param options.duration - The duration (in milliseconds) of each DTMF tone.
1589
+ * @param options.after - The time (in milliseconds) to wait after sending all DTMF tones.
1590
+ * @returns A Promise that resolves when the DTMF tones have been successfully sent.
1477
1591
  */
1478
1592
  async sendDTMF(channelId, dtmf, options) {
1479
1593
  return this.channels.sendDTMF(channelId, dtmf, options);
1480
1594
  }
1481
1595
  /**
1482
- * Mutes a channel.
1596
+ * Mutes a channel in the Asterisk system.
1597
+ *
1598
+ * This function initiates a mute operation on the specified channel, preventing
1599
+ * audio transmission in the specified direction(s).
1600
+ *
1601
+ * @param channelId - The unique identifier of the channel to be muted.
1602
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1603
+ * @param direction - The direction of audio to mute. Can be one of:
1604
+ * - "both": Mute both incoming and outgoing audio (default)
1605
+ * - "in": Mute only incoming audio
1606
+ * - "out": Mute only outgoing audio
1607
+ *
1608
+ * @returns A Promise that resolves when the mute operation has been successfully completed.
1609
+ * The promise resolves to void, indicating no specific return value.
1610
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1483
1611
  */
1484
1612
  async muteChannel(channelId, direction = "both") {
1485
1613
  return this.channels.muteChannel(channelId, direction);
1486
1614
  }
1487
1615
  /**
1488
- * Unmutes a channel.
1616
+ * Unmutes a channel in the Asterisk system.
1617
+ *
1618
+ * This function removes the mute status from a specified channel, allowing audio
1619
+ * transmission to resume in the specified direction(s).
1620
+ *
1621
+ * @param channelId - The unique identifier of the channel to be unmuted.
1622
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1623
+ * @param direction - The direction of audio to unmute. Can be one of:
1624
+ * - "both": Unmute both incoming and outgoing audio (default)
1625
+ * - "in": Unmute only incoming audio
1626
+ * - "out": Unmute only outgoing audio
1627
+ *
1628
+ * @returns A Promise that resolves when the unmute operation has been successfully completed.
1629
+ * The promise resolves to void, indicating no specific return value.
1630
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1489
1631
  */
1490
1632
  async unmuteChannel(channelId, direction = "both") {
1491
1633
  return this.channels.unmuteChannel(channelId, direction);
1492
1634
  }
1493
1635
  /**
1494
- * Puts a channel on hold.
1636
+ * Puts a specified channel on hold.
1637
+ *
1638
+ * This function initiates a hold operation on the specified channel in the Asterisk system.
1639
+ * When a channel is put on hold, typically the audio is muted or replaced with hold music,
1640
+ * depending on the system configuration.
1641
+ *
1642
+ * @param channelId - The unique identifier of the channel to be put on hold.
1643
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1644
+ *
1645
+ * @returns A Promise that resolves when the hold operation has been successfully initiated.
1646
+ * The promise resolves to void, indicating no specific return value.
1647
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1495
1648
  */
1496
1649
  async holdChannel(channelId) {
1497
1650
  return this.channels.holdChannel(channelId);
1498
1651
  }
1499
1652
  /**
1500
- * Removes a channel from hold.
1653
+ * Removes a specified channel from hold.
1654
+ *
1655
+ * This function initiates an unhold operation on the specified channel in the Asterisk system.
1656
+ * When a channel is taken off hold, it typically resumes normal audio transmission,
1657
+ * allowing the parties to continue their conversation.
1658
+ *
1659
+ * @param channelId - The unique identifier of the channel to be taken off hold.
1660
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1661
+ *
1662
+ * @returns A Promise that resolves when the unhold operation has been successfully initiated.
1663
+ * The promise resolves to void, indicating no specific return value.
1664
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1501
1665
  */
1502
1666
  async unholdChannel(channelId) {
1503
1667
  return this.channels.unholdChannel(channelId);
1504
1668
  }
1505
1669
  /**
1506
- * Creates a new channel using the provided originate request data.
1507
- *
1508
- * @param data - The originate request data containing channel creation parameters.
1509
- * @returns A promise that resolves to the created Channel object.
1510
- */
1670
+ * Creates a new channel in the Asterisk system using the provided originate request data.
1671
+ * This function initiates a new communication channel based on the specified parameters.
1672
+ *
1673
+ * @param data - An object containing the originate request data for channel creation.
1674
+ * This includes details such as the endpoint to call, the context to use,
1675
+ * and any variables to set on the new channel.
1676
+ * @param data.endpoint - The endpoint to call (e.g., "SIP/1234").
1677
+ * @param data.extension - The extension to dial after the channel is created.
1678
+ * @param data.context - The dialplan context to use for the new channel.
1679
+ * @param data.priority - The priority to start at in the dialplan.
1680
+ * @param data.app - The application to execute on the channel (alternative to extension/context/priority).
1681
+ * @param data.appArgs - The arguments to pass to the application, if 'app' is specified.
1682
+ * @param data.callerId - The caller ID to set on the new channel.
1683
+ * @param data.timeout - The timeout (in seconds) to wait for the channel to be answered.
1684
+ * @param data.variables - An object containing key-value pairs of channel variables to set.
1685
+ * @param data.channelId - An optional ID to assign to the new channel.
1686
+ * @param data.otherChannelId - The ID of another channel to bridge with after creation.
1687
+ *
1688
+ * @returns A Promise that resolves to the created Channel object.
1689
+ * The Channel object contains details about the newly created channel,
1690
+ * such as its unique identifier, state, and other relevant information.
1691
+ *
1692
+ * @throws Will throw an error if the channel creation fails for any reason,
1693
+ * such as invalid parameters or system issues.
1694
+ */
1511
1695
  async createChannel(data) {
1512
1696
  return this.channels.createChannel(data);
1513
1697
  }
1514
1698
  /**
1515
1699
  * Hangs up a specific channel.
1516
- *
1700
+ *
1517
1701
  * @param channelId - The unique identifier of the channel to hang up.
1518
1702
  * @param options - Optional parameters for the hangup operation.
1519
1703
  * @param options.reason_code - An optional reason code for the hangup.
@@ -1525,7 +1709,7 @@ var AriClient = class {
1525
1709
  }
1526
1710
  /**
1527
1711
  * Originates a new channel with a specified ID using the provided originate request data.
1528
- *
1712
+ *
1529
1713
  * @param channelId - The desired unique identifier for the new channel.
1530
1714
  * @param data - The originate request data containing channel creation parameters.
1531
1715
  * @returns A promise that resolves to the created Channel object.
@@ -1602,42 +1786,122 @@ var AriClient = class {
1602
1786
  return this.playbacks.getDetails(playbackId);
1603
1787
  }
1604
1788
  /**
1605
- * Controls a specific playback.
1789
+ * Controls a specific playback in the Asterisk server.
1606
1790
  *
1607
- * @param playbackId - The unique identifier of the playback.
1608
- * @param controlRequest - The PlaybackControlRequest containing the control operation.
1609
- * @returns {Promise<void>} A promise resolving when the control operation is successfully executed.
1791
+ * @param playbackId - The unique identifier of the playback to control.
1792
+ * @param controlRequest - An object containing the control operation details.
1793
+ * @returns A Promise that resolves when the control operation is successfully executed.
1610
1794
  */
1611
1795
  async controlPlayback(playbackId, controlRequest) {
1612
1796
  return this.playbacks.control(playbackId, controlRequest);
1613
1797
  }
1614
1798
  /**
1615
- * Stops a specific playback.
1799
+ * Stops a specific playback in the Asterisk server.
1616
1800
  *
1617
- * @param playbackId - The unique identifier of the playback.
1618
- * @returns {Promise<void>} A promise resolving when the playback is successfully stopped.
1801
+ * @param playbackId - The unique identifier of the playback to stop.
1802
+ * @returns A Promise that resolves when the playback is successfully stopped.
1619
1803
  */
1620
1804
  async stopPlayback(playbackId) {
1621
1805
  return this.playbacks.stop(playbackId);
1622
1806
  }
1623
1807
  /**
1624
- * Lists all available sounds.
1808
+ * Retrieves a list of all available sounds in the Asterisk server.
1625
1809
  *
1626
1810
  * @param params - Optional parameters to filter the list of sounds.
1627
- * @returns {Promise<Sound[]>} A promise resolving to the list of sounds.
1811
+ * @returns A Promise that resolves to an array of Sound objects representing the available sounds.
1628
1812
  */
1629
1813
  async listSounds(params) {
1630
1814
  return this.sounds.list(params);
1631
1815
  }
1632
1816
  /**
1633
- * Retrieves details of a specific sound.
1817
+ * Retrieves detailed information about a specific sound in the Asterisk server.
1634
1818
  *
1635
- * @param soundId - The unique identifier of the sound.
1636
- * @returns {Promise<Sound>} A promise resolving to the sound details.
1819
+ * @param soundId - The unique identifier of the sound to retrieve details for.
1820
+ * @returns A Promise that resolves to a Sound object containing the details of the specified sound.
1637
1821
  */
1638
1822
  async getSoundDetails(soundId) {
1639
1823
  return this.sounds.getDetails(soundId);
1640
1824
  }
1825
+ /**
1826
+ * Retrieves general information about the Asterisk server.
1827
+ *
1828
+ * @returns A Promise that resolves to an AsteriskInfo object containing server information.
1829
+ */
1830
+ async getAsteriskInfo() {
1831
+ return this.asterisk.getInfo();
1832
+ }
1833
+ /**
1834
+ * Retrieves a list of all loaded modules in the Asterisk server.
1835
+ *
1836
+ * @returns A Promise that resolves to an array of Module objects representing the loaded modules.
1837
+ */
1838
+ async listModules() {
1839
+ return this.asterisk.listModules();
1840
+ }
1841
+ /**
1842
+ * Manages a specific module in the Asterisk server by loading, unloading, or reloading it.
1843
+ *
1844
+ * @param moduleName - The name of the module to manage.
1845
+ * @param action - The action to perform on the module: "load", "unload", or "reload".
1846
+ * @returns A Promise that resolves when the module management action is completed successfully.
1847
+ */
1848
+ async manageModule(moduleName, action) {
1849
+ return this.asterisk.manageModule(moduleName, action);
1850
+ }
1851
+ /**
1852
+ * Retrieves a list of all configured logging channels in the Asterisk server.
1853
+ *
1854
+ * @returns A Promise that resolves to an array of Logging objects representing the configured logging channels.
1855
+ */
1856
+ async listLoggingChannels() {
1857
+ return this.asterisk.listLoggingChannels();
1858
+ }
1859
+ /**
1860
+ * Adds or removes a log channel in the Asterisk server.
1861
+ *
1862
+ * @param logChannelName - The name of the log channel to manage.
1863
+ * @param action - The action to perform: "add" to create a new log channel or "remove" to delete an existing one.
1864
+ * @param configuration - Optional configuration object for adding a log channel. Ignored when removing a channel.
1865
+ * @param configuration.type - The type of the log channel.
1866
+ * @param configuration.configuration - Additional configuration details for the log channel.
1867
+ * @returns A Promise that resolves when the log channel management action is completed successfully.
1868
+ */
1869
+ async manageLogChannel(logChannelName, action, configuration) {
1870
+ return this.asterisk.manageLogChannel(
1871
+ logChannelName,
1872
+ action,
1873
+ configuration
1874
+ );
1875
+ }
1876
+ /**
1877
+ * Retrieves the value of a global variable from the Asterisk server.
1878
+ *
1879
+ * @param variableName - The name of the global variable to retrieve.
1880
+ * @returns A Promise that resolves to a Variable object containing the name and value of the global variable.
1881
+ */
1882
+ async getGlobalVariable(variableName) {
1883
+ return this.asterisk.getGlobalVariable(variableName);
1884
+ }
1885
+ /**
1886
+ * Sets a global variable in the Asterisk server.
1887
+ *
1888
+ * This function allows you to set or update the value of a global variable
1889
+ * in the Asterisk server. Global variables are accessible throughout the
1890
+ * entire Asterisk system and can be used for various purposes such as
1891
+ * configuration settings or sharing data between different parts of the system.
1892
+ *
1893
+ * @param variableName - The name of the global variable to set or update.
1894
+ * This should be a string identifying the variable uniquely.
1895
+ * @param value - The value to assign to the global variable. This can be any
1896
+ * string value, including empty strings.
1897
+ * @returns A Promise that resolves when the global variable has been successfully
1898
+ * set. The promise resolves to void, indicating no specific return value.
1899
+ * If an error occurs during the operation, the promise will be rejected
1900
+ * with an error object.
1901
+ */
1902
+ async setGlobalVariable(variableName, value) {
1903
+ return this.asterisk.setGlobalVariable(variableName, value);
1904
+ }
1641
1905
  };
1642
1906
  // Annotate the CommonJS export names for ESM import in node:
1643
1907
  0 && (module.exports = {