@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.
package/dist/esm/index.js CHANGED
@@ -626,8 +626,8 @@ var Applications = class {
626
626
  }
627
627
  /**
628
628
  * Lists all applications.
629
- *
630
- * @returns A promise that resolves to an array of Application objects representing all registered applications.
629
+ *
630
+ * @returns A promise that resolves to an array of Application objects.
631
631
  * @throws {Error} If the API response is not an array.
632
632
  */
633
633
  async list() {
@@ -639,27 +639,98 @@ var Applications = class {
639
639
  }
640
640
  /**
641
641
  * Retrieves details of a specific application.
642
- *
643
- * @param appName - The unique name of the application.
644
- * @returns A promise that resolves to an ApplicationDetails object containing the details of the specified application.
642
+ *
643
+ * @param appName - The name of the application to retrieve details for.
644
+ * @returns A promise that resolves to an ApplicationDetails object.
645
+ * @throws {Error} If there's an error fetching the application details.
645
646
  */
646
647
  async getDetails(appName) {
647
- return this.client.get(`/applications/${appName}`);
648
+ try {
649
+ return await this.client.get(
650
+ `/applications/${appName}`
651
+ );
652
+ } catch (error) {
653
+ console.error(`Erro ao obter detalhes do aplicativo ${appName}:`, error);
654
+ throw error;
655
+ }
648
656
  }
649
657
  /**
650
658
  * Sends a message to a specific application.
651
- *
652
- * @param appName - The unique name of the application.
653
- * @param body - The message body to send.
654
- * @returns A promise that resolves when the message is sent successfully.
659
+ *
660
+ * @param appName - The name of the application to send the message to.
661
+ * @param body - The message to be sent, containing an event and optional data.
662
+ * @returns A promise that resolves when the message is successfully sent.
655
663
  */
656
664
  async sendMessage(appName, body) {
657
665
  await this.client.post(`/applications/${appName}/messages`, body);
658
666
  }
659
667
  };
660
668
 
661
- // src/ari-client/resources/channels.ts
669
+ // src/ari-client/resources/asterisk.ts
662
670
  function toQueryParams(options) {
671
+ return new URLSearchParams(
672
+ Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)])
673
+ ).toString();
674
+ }
675
+ var Asterisk = class {
676
+ constructor(client) {
677
+ this.client = client;
678
+ }
679
+ /**
680
+ * Retrieves information about the Asterisk server.
681
+ */
682
+ async getInfo() {
683
+ return this.client.get("/asterisk/info");
684
+ }
685
+ /**
686
+ * Lists all loaded modules in the Asterisk server.
687
+ */
688
+ async listModules() {
689
+ return this.client.get("/asterisk/modules");
690
+ }
691
+ /**
692
+ * Manages a specific module in the Asterisk server.
693
+ */
694
+ async manageModule(moduleName, action) {
695
+ return this.client.post(
696
+ `/asterisk/modules/${moduleName}?action=${encodeURIComponent(action)}`
697
+ );
698
+ }
699
+ /**
700
+ * Retrieves all configured logging channels.
701
+ */
702
+ async listLoggingChannels() {
703
+ return this.client.get("/asterisk/logging");
704
+ }
705
+ /**
706
+ * Adds or removes a log channel in the Asterisk server.
707
+ */
708
+ async manageLogChannel(logChannelName, action, configuration) {
709
+ const queryParams = toQueryParams(configuration || {});
710
+ return this.client.post(
711
+ `/asterisk/logging/${logChannelName}?action=${encodeURIComponent(action)}&${queryParams}`
712
+ );
713
+ }
714
+ /**
715
+ * Retrieves the value of a global variable.
716
+ */
717
+ async getGlobalVariable(variableName) {
718
+ return this.client.get(
719
+ `/asterisk/variables?variable=${encodeURIComponent(variableName)}`
720
+ );
721
+ }
722
+ /**
723
+ * Sets a global variable.
724
+ */
725
+ async setGlobalVariable(variableName, value) {
726
+ return this.client.post(
727
+ `/asterisk/variables?variable=${encodeURIComponent(variableName)}&value=${encodeURIComponent(value)}`
728
+ );
729
+ }
730
+ };
731
+
732
+ // src/ari-client/resources/channels.ts
733
+ function toQueryParams2(options) {
663
734
  return new URLSearchParams(
664
735
  Object.entries(options).filter(([, value]) => value !== void 0).map(([key, value]) => [key, value])
665
736
  // Garante que value é string
@@ -846,7 +917,7 @@ var Channels = class {
846
917
  * Starts snooping on a channel.
847
918
  */
848
919
  async snoopChannel(channelId, options) {
849
- const queryParams = toQueryParams(options);
920
+ const queryParams = toQueryParams2(options);
850
921
  return this.client.post(
851
922
  `/channels/${channelId}/snoop?${queryParams}`
852
923
  );
@@ -1125,13 +1196,17 @@ var WebSocketClient = class {
1125
1196
  throw new Error("WebSocket n\xE3o est\xE1 conectado.");
1126
1197
  }
1127
1198
  if (event === "message") {
1128
- this.ws.on(event, (data) => {
1199
+ this.ws.on(event, (rawData) => {
1129
1200
  try {
1130
- const decodedData = JSON.parse(data.toString());
1131
- callback(decodedData);
1201
+ const decodedData = JSON.parse(rawData.toString());
1202
+ if (decodedData?.type) {
1203
+ const matchedEvent = decodedData;
1204
+ callback(matchedEvent);
1205
+ } else {
1206
+ console.warn("Mensagem sem tipo:", decodedData);
1207
+ }
1132
1208
  } catch (err) {
1133
1209
  console.error("Erro ao decodificar mensagem do WebSocket:", err);
1134
- callback(data);
1135
1210
  }
1136
1211
  });
1137
1212
  } else {
@@ -1170,6 +1245,7 @@ var AriClient = class {
1170
1245
  this.applications = new Applications(this.baseClient);
1171
1246
  this.playbacks = new Playbacks(this.baseClient);
1172
1247
  this.sounds = new Sounds(this.baseClient);
1248
+ this.asterisk = new Asterisk(this.baseClient);
1173
1249
  }
1174
1250
  wsClient = null;
1175
1251
  baseClient;
@@ -1179,13 +1255,14 @@ var AriClient = class {
1179
1255
  applications;
1180
1256
  playbacks;
1181
1257
  sounds;
1258
+ asterisk;
1182
1259
  /**
1183
1260
  * Connects to the ARI WebSocket for a specific application.
1184
1261
  *
1185
1262
  * @param app - The application name to connect to.
1186
1263
  * @returns {Promise<void>} Resolves when the WebSocket connects successfully.
1187
1264
  */
1188
- async connectWebSocket(app) {
1265
+ async connectWebSocket(app, subscribedEvents) {
1189
1266
  if (!app) {
1190
1267
  throw new Error(
1191
1268
  "The 'app' parameter is required to connect to the WebSocket."
@@ -1196,8 +1273,9 @@ var AriClient = class {
1196
1273
  return;
1197
1274
  }
1198
1275
  this.isReconnecting = true;
1276
+ const eventsParam = subscribedEvents && subscribedEvents.length > 0 ? `&event=${subscribedEvents.join(",")}` : "&subscribeAll=true";
1199
1277
  const protocol = this.config.secure ? "wss" : "ws";
1200
- const wsUrl = `${protocol}://${encodeURIComponent(this.config.username)}:${encodeURIComponent(this.config.password)}@${this.config.host}:${this.config.port}/ari/events?app=${app}`;
1278
+ const wsUrl = `${protocol}://${encodeURIComponent(this.config.username)}:${encodeURIComponent(this.config.password)}@${this.config.host}:${this.config.port}/ari/events?app=${app}${eventsParam}`;
1201
1279
  const backoffOptions = {
1202
1280
  delayFirstAttempt: false,
1203
1281
  startingDelay: 1e3,
@@ -1261,16 +1339,22 @@ var AriClient = class {
1261
1339
  return this.wsClient ? this.wsClient.isConnected() : false;
1262
1340
  }
1263
1341
  /**
1264
- * Registers a callback for a specific WebSocket event.
1342
+ * Registers a callback function for WebSocket events.
1343
+ * This method allows you to listen for and respond to WebSocket messages
1344
+ * and process specific event types.
1265
1345
  *
1266
- * @param event - The WebSocket event to listen for.
1267
- * @param callback - The callback function to execute when the event occurs.
1346
+ * @param callback - The callback function to execute when a WebSocket message is received.
1347
+ * The function will receive the parsed event data as its parameter.
1348
+ * @throws {Error} Throws an error if the WebSocket is not connected when trying to register the event.
1349
+ * @returns {void}
1268
1350
  */
1269
- onWebSocketEvent(event, callback) {
1351
+ onWebSocketEvent(callback) {
1270
1352
  if (!this.wsClient) {
1271
1353
  throw new Error("WebSocket is not connected.");
1272
1354
  }
1273
- this.wsClient.on(event, callback);
1355
+ this.wsClient.on("message", (data) => {
1356
+ callback(data);
1357
+ });
1274
1358
  }
1275
1359
  /**
1276
1360
  * Closes the WebSocket connection.
@@ -1413,7 +1497,14 @@ var AriClient = class {
1413
1497
  return this.channels.snoopChannelWithId(channelId, snoopId, options);
1414
1498
  }
1415
1499
  /**
1416
- * Dials a created channel.
1500
+ * Initiates a dial operation on a previously created channel.
1501
+ * This function attempts to connect the specified channel to its configured destination.
1502
+ *
1503
+ * @param channelId - The unique identifier of the channel to dial.
1504
+ * @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.
1505
+ * @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.
1506
+ * @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.
1507
+ * @throws Will throw an error if the dial operation fails, e.g., if the channel doesn't exist or is in an invalid state.
1417
1508
  */
1418
1509
  async dialChannel(channelId, caller, timeout) {
1419
1510
  return this.channels.dial(channelId, caller, timeout);
@@ -1449,53 +1540,146 @@ var AriClient = class {
1449
1540
  return this.channels.ringChannel(channelId);
1450
1541
  }
1451
1542
  /**
1452
- * Stops ringing indication on a channel.
1543
+ * Stops the ringing indication on a specified channel in the Asterisk system.
1544
+ *
1545
+ * This function sends a request to the Asterisk server to cease the ringing
1546
+ * indication on a particular channel. This is typically used when you want to
1547
+ * stop the ringing sound on a channel without answering or hanging up the call.
1548
+ *
1549
+ * @param channelId - The unique identifier of the channel on which to stop the ringing.
1550
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1551
+ *
1552
+ * @returns A Promise that resolves when the ringing has been successfully stopped on the specified channel.
1553
+ * The promise resolves to void, indicating no specific return value.
1554
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1453
1555
  */
1454
1556
  async stopRingChannel(channelId) {
1455
1557
  return this.channels.stopRingChannel(channelId);
1456
1558
  }
1457
1559
  /**
1458
- * Sends DTMF to a channel.
1560
+ * Sends DTMF (Dual-Tone Multi-Frequency) tones to a specified channel.
1561
+ *
1562
+ * This function allows sending DTMF tones to a channel, which can be used for various purposes
1563
+ * such as interacting with IVR systems or sending signals during a call.
1564
+ *
1565
+ * @param channelId - The unique identifier of the channel to send DTMF tones to.
1566
+ * @param dtmf - A string representing the DTMF tones to send (e.g., "123#").
1567
+ * @param options - Optional parameters to control the timing of DTMF tones.
1568
+ * @param options.before - The time (in milliseconds) to wait before sending DTMF.
1569
+ * @param options.between - The time (in milliseconds) to wait between each DTMF tone.
1570
+ * @param options.duration - The duration (in milliseconds) of each DTMF tone.
1571
+ * @param options.after - The time (in milliseconds) to wait after sending all DTMF tones.
1572
+ * @returns A Promise that resolves when the DTMF tones have been successfully sent.
1459
1573
  */
1460
1574
  async sendDTMF(channelId, dtmf, options) {
1461
1575
  return this.channels.sendDTMF(channelId, dtmf, options);
1462
1576
  }
1463
1577
  /**
1464
- * Mutes a channel.
1578
+ * Mutes a channel in the Asterisk system.
1579
+ *
1580
+ * This function initiates a mute operation on the specified channel, preventing
1581
+ * audio transmission in the specified direction(s).
1582
+ *
1583
+ * @param channelId - The unique identifier of the channel to be muted.
1584
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1585
+ * @param direction - The direction of audio to mute. Can be one of:
1586
+ * - "both": Mute both incoming and outgoing audio (default)
1587
+ * - "in": Mute only incoming audio
1588
+ * - "out": Mute only outgoing audio
1589
+ *
1590
+ * @returns A Promise that resolves when the mute operation has been successfully completed.
1591
+ * The promise resolves to void, indicating no specific return value.
1592
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1465
1593
  */
1466
1594
  async muteChannel(channelId, direction = "both") {
1467
1595
  return this.channels.muteChannel(channelId, direction);
1468
1596
  }
1469
1597
  /**
1470
- * Unmutes a channel.
1598
+ * Unmutes a channel in the Asterisk system.
1599
+ *
1600
+ * This function removes the mute status from a specified channel, allowing audio
1601
+ * transmission to resume in the specified direction(s).
1602
+ *
1603
+ * @param channelId - The unique identifier of the channel to be unmuted.
1604
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1605
+ * @param direction - The direction of audio to unmute. Can be one of:
1606
+ * - "both": Unmute both incoming and outgoing audio (default)
1607
+ * - "in": Unmute only incoming audio
1608
+ * - "out": Unmute only outgoing audio
1609
+ *
1610
+ * @returns A Promise that resolves when the unmute operation has been successfully completed.
1611
+ * The promise resolves to void, indicating no specific return value.
1612
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1471
1613
  */
1472
1614
  async unmuteChannel(channelId, direction = "both") {
1473
1615
  return this.channels.unmuteChannel(channelId, direction);
1474
1616
  }
1475
1617
  /**
1476
- * Puts a channel on hold.
1618
+ * Puts a specified channel on hold.
1619
+ *
1620
+ * This function initiates a hold operation on the specified channel in the Asterisk system.
1621
+ * When a channel is put on hold, typically the audio is muted or replaced with hold music,
1622
+ * depending on the system configuration.
1623
+ *
1624
+ * @param channelId - The unique identifier of the channel to be put on hold.
1625
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1626
+ *
1627
+ * @returns A Promise that resolves when the hold operation has been successfully initiated.
1628
+ * The promise resolves to void, indicating no specific return value.
1629
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1477
1630
  */
1478
1631
  async holdChannel(channelId) {
1479
1632
  return this.channels.holdChannel(channelId);
1480
1633
  }
1481
1634
  /**
1482
- * Removes a channel from hold.
1635
+ * Removes a specified channel from hold.
1636
+ *
1637
+ * This function initiates an unhold operation on the specified channel in the Asterisk system.
1638
+ * When a channel is taken off hold, it typically resumes normal audio transmission,
1639
+ * allowing the parties to continue their conversation.
1640
+ *
1641
+ * @param channelId - The unique identifier of the channel to be taken off hold.
1642
+ * This should be a string that uniquely identifies the channel in the Asterisk system.
1643
+ *
1644
+ * @returns A Promise that resolves when the unhold operation has been successfully initiated.
1645
+ * The promise resolves to void, indicating no specific return value.
1646
+ * If an error occurs during the operation, the promise will be rejected with an error object.
1483
1647
  */
1484
1648
  async unholdChannel(channelId) {
1485
1649
  return this.channels.unholdChannel(channelId);
1486
1650
  }
1487
1651
  /**
1488
- * Creates a new channel using the provided originate request data.
1489
- *
1490
- * @param data - The originate request data containing channel creation parameters.
1491
- * @returns A promise that resolves to the created Channel object.
1492
- */
1652
+ * Creates a new channel in the Asterisk system using the provided originate request data.
1653
+ * This function initiates a new communication channel based on the specified parameters.
1654
+ *
1655
+ * @param data - An object containing the originate request data for channel creation.
1656
+ * This includes details such as the endpoint to call, the context to use,
1657
+ * and any variables to set on the new channel.
1658
+ * @param data.endpoint - The endpoint to call (e.g., "SIP/1234").
1659
+ * @param data.extension - The extension to dial after the channel is created.
1660
+ * @param data.context - The dialplan context to use for the new channel.
1661
+ * @param data.priority - The priority to start at in the dialplan.
1662
+ * @param data.app - The application to execute on the channel (alternative to extension/context/priority).
1663
+ * @param data.appArgs - The arguments to pass to the application, if 'app' is specified.
1664
+ * @param data.callerId - The caller ID to set on the new channel.
1665
+ * @param data.timeout - The timeout (in seconds) to wait for the channel to be answered.
1666
+ * @param data.variables - An object containing key-value pairs of channel variables to set.
1667
+ * @param data.channelId - An optional ID to assign to the new channel.
1668
+ * @param data.otherChannelId - The ID of another channel to bridge with after creation.
1669
+ *
1670
+ * @returns A Promise that resolves to the created Channel object.
1671
+ * The Channel object contains details about the newly created channel,
1672
+ * such as its unique identifier, state, and other relevant information.
1673
+ *
1674
+ * @throws Will throw an error if the channel creation fails for any reason,
1675
+ * such as invalid parameters or system issues.
1676
+ */
1493
1677
  async createChannel(data) {
1494
1678
  return this.channels.createChannel(data);
1495
1679
  }
1496
1680
  /**
1497
1681
  * Hangs up a specific channel.
1498
- *
1682
+ *
1499
1683
  * @param channelId - The unique identifier of the channel to hang up.
1500
1684
  * @param options - Optional parameters for the hangup operation.
1501
1685
  * @param options.reason_code - An optional reason code for the hangup.
@@ -1507,7 +1691,7 @@ var AriClient = class {
1507
1691
  }
1508
1692
  /**
1509
1693
  * Originates a new channel with a specified ID using the provided originate request data.
1510
- *
1694
+ *
1511
1695
  * @param channelId - The desired unique identifier for the new channel.
1512
1696
  * @param data - The originate request data containing channel creation parameters.
1513
1697
  * @returns A promise that resolves to the created Channel object.
@@ -1584,42 +1768,122 @@ var AriClient = class {
1584
1768
  return this.playbacks.getDetails(playbackId);
1585
1769
  }
1586
1770
  /**
1587
- * Controls a specific playback.
1771
+ * Controls a specific playback in the Asterisk server.
1588
1772
  *
1589
- * @param playbackId - The unique identifier of the playback.
1590
- * @param controlRequest - The PlaybackControlRequest containing the control operation.
1591
- * @returns {Promise<void>} A promise resolving when the control operation is successfully executed.
1773
+ * @param playbackId - The unique identifier of the playback to control.
1774
+ * @param controlRequest - An object containing the control operation details.
1775
+ * @returns A Promise that resolves when the control operation is successfully executed.
1592
1776
  */
1593
1777
  async controlPlayback(playbackId, controlRequest) {
1594
1778
  return this.playbacks.control(playbackId, controlRequest);
1595
1779
  }
1596
1780
  /**
1597
- * Stops a specific playback.
1781
+ * Stops a specific playback in the Asterisk server.
1598
1782
  *
1599
- * @param playbackId - The unique identifier of the playback.
1600
- * @returns {Promise<void>} A promise resolving when the playback is successfully stopped.
1783
+ * @param playbackId - The unique identifier of the playback to stop.
1784
+ * @returns A Promise that resolves when the playback is successfully stopped.
1601
1785
  */
1602
1786
  async stopPlayback(playbackId) {
1603
1787
  return this.playbacks.stop(playbackId);
1604
1788
  }
1605
1789
  /**
1606
- * Lists all available sounds.
1790
+ * Retrieves a list of all available sounds in the Asterisk server.
1607
1791
  *
1608
1792
  * @param params - Optional parameters to filter the list of sounds.
1609
- * @returns {Promise<Sound[]>} A promise resolving to the list of sounds.
1793
+ * @returns A Promise that resolves to an array of Sound objects representing the available sounds.
1610
1794
  */
1611
1795
  async listSounds(params) {
1612
1796
  return this.sounds.list(params);
1613
1797
  }
1614
1798
  /**
1615
- * Retrieves details of a specific sound.
1799
+ * Retrieves detailed information about a specific sound in the Asterisk server.
1616
1800
  *
1617
- * @param soundId - The unique identifier of the sound.
1618
- * @returns {Promise<Sound>} A promise resolving to the sound details.
1801
+ * @param soundId - The unique identifier of the sound to retrieve details for.
1802
+ * @returns A Promise that resolves to a Sound object containing the details of the specified sound.
1619
1803
  */
1620
1804
  async getSoundDetails(soundId) {
1621
1805
  return this.sounds.getDetails(soundId);
1622
1806
  }
1807
+ /**
1808
+ * Retrieves general information about the Asterisk server.
1809
+ *
1810
+ * @returns A Promise that resolves to an AsteriskInfo object containing server information.
1811
+ */
1812
+ async getAsteriskInfo() {
1813
+ return this.asterisk.getInfo();
1814
+ }
1815
+ /**
1816
+ * Retrieves a list of all loaded modules in the Asterisk server.
1817
+ *
1818
+ * @returns A Promise that resolves to an array of Module objects representing the loaded modules.
1819
+ */
1820
+ async listModules() {
1821
+ return this.asterisk.listModules();
1822
+ }
1823
+ /**
1824
+ * Manages a specific module in the Asterisk server by loading, unloading, or reloading it.
1825
+ *
1826
+ * @param moduleName - The name of the module to manage.
1827
+ * @param action - The action to perform on the module: "load", "unload", or "reload".
1828
+ * @returns A Promise that resolves when the module management action is completed successfully.
1829
+ */
1830
+ async manageModule(moduleName, action) {
1831
+ return this.asterisk.manageModule(moduleName, action);
1832
+ }
1833
+ /**
1834
+ * Retrieves a list of all configured logging channels in the Asterisk server.
1835
+ *
1836
+ * @returns A Promise that resolves to an array of Logging objects representing the configured logging channels.
1837
+ */
1838
+ async listLoggingChannels() {
1839
+ return this.asterisk.listLoggingChannels();
1840
+ }
1841
+ /**
1842
+ * Adds or removes a log channel in the Asterisk server.
1843
+ *
1844
+ * @param logChannelName - The name of the log channel to manage.
1845
+ * @param action - The action to perform: "add" to create a new log channel or "remove" to delete an existing one.
1846
+ * @param configuration - Optional configuration object for adding a log channel. Ignored when removing a channel.
1847
+ * @param configuration.type - The type of the log channel.
1848
+ * @param configuration.configuration - Additional configuration details for the log channel.
1849
+ * @returns A Promise that resolves when the log channel management action is completed successfully.
1850
+ */
1851
+ async manageLogChannel(logChannelName, action, configuration) {
1852
+ return this.asterisk.manageLogChannel(
1853
+ logChannelName,
1854
+ action,
1855
+ configuration
1856
+ );
1857
+ }
1858
+ /**
1859
+ * Retrieves the value of a global variable from the Asterisk server.
1860
+ *
1861
+ * @param variableName - The name of the global variable to retrieve.
1862
+ * @returns A Promise that resolves to a Variable object containing the name and value of the global variable.
1863
+ */
1864
+ async getGlobalVariable(variableName) {
1865
+ return this.asterisk.getGlobalVariable(variableName);
1866
+ }
1867
+ /**
1868
+ * Sets a global variable in the Asterisk server.
1869
+ *
1870
+ * This function allows you to set or update the value of a global variable
1871
+ * in the Asterisk server. Global variables are accessible throughout the
1872
+ * entire Asterisk system and can be used for various purposes such as
1873
+ * configuration settings or sharing data between different parts of the system.
1874
+ *
1875
+ * @param variableName - The name of the global variable to set or update.
1876
+ * This should be a string identifying the variable uniquely.
1877
+ * @param value - The value to assign to the global variable. This can be any
1878
+ * string value, including empty strings.
1879
+ * @returns A Promise that resolves when the global variable has been successfully
1880
+ * set. The promise resolves to void, indicating no specific return value.
1881
+ * If an error occurs during the operation, the promise will be rejected
1882
+ * with an error object.
1883
+ */
1884
+ async setGlobalVariable(variableName, value) {
1885
+ return this.asterisk.setGlobalVariable(variableName, value);
1886
+ }
1623
1887
  };
1624
1888
  export {
1625
1889
  Applications,