jfinstrom / ari-js-client

js client for ARI generated from swagger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

asterisk_ari

AsteriskAri - JavaScript client for asterisk_ari No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) This SDK is automatically generated by the Swagger Codegen project:

  • API version: 6.0.0
  • Package version: 6.0.0
  • Build package: io.swagger.codegen.v3.generators.javascript.JavaScriptClientCodegen

Installation

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install asterisk_ari --save

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var AsteriskAri = require('asterisk_ari');

var api = new AsteriskAri.ApplicationsApi()
var applicationName = "applicationName_example"; // {String} Application's name
var opts = { 
  'body': null // {Object} Specify which event types to allow/disallow
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.filter(applicationName, opts, callback);

Documentation for API Endpoints

All URIs are relative to http://localhost:8088/ari

Class Method HTTP request Description
AsteriskAri.ApplicationsApi filter PUT /applications/{applicationName}/eventFilter Filter application events types.
AsteriskAri.ApplicationsApi get GET /applications/{applicationName} Get details of an application.
AsteriskAri.ApplicationsApi list GET /applications List all applications.
AsteriskAri.ApplicationsApi subscribe POST /applications/{applicationName}/subscription Subscribe an application to a event source.
AsteriskAri.ApplicationsApi unsubscribe DELETE /applications/{applicationName}/subscription Unsubscribe an application from an event source.
AsteriskAri.AsteriskApi addLog POST /asterisk/logging/{logChannelName} Adds a log channel.
AsteriskAri.AsteriskApi deleteLog DELETE /asterisk/logging/{logChannelName} Deletes a log channel.
AsteriskAri.AsteriskApi deleteObject DELETE /asterisk/config/dynamic/{configClass}/{objectType}/{id} Delete a dynamic configuration object.
AsteriskAri.AsteriskApi getGlobalVar GET /asterisk/variable Get the value of a global variable.
AsteriskAri.AsteriskApi getInfo GET /asterisk/info Gets Asterisk system information.
AsteriskAri.AsteriskApi getModule GET /asterisk/modules/{moduleName} Get Asterisk module information.
AsteriskAri.AsteriskApi getObject GET /asterisk/config/dynamic/{configClass}/{objectType}/{id} Retrieve a dynamic configuration object.
AsteriskAri.AsteriskApi listLogChannels GET /asterisk/logging Gets Asterisk log channel information.
AsteriskAri.AsteriskApi listModules GET /asterisk/modules List Asterisk modules.
AsteriskAri.AsteriskApi loadModule POST /asterisk/modules/{moduleName} Load an Asterisk module.
AsteriskAri.AsteriskApi ping GET /asterisk/ping Response pong message.
AsteriskAri.AsteriskApi reloadModule PUT /asterisk/modules/{moduleName} Reload an Asterisk module.
AsteriskAri.AsteriskApi rotateLog PUT /asterisk/logging/{logChannelName}/rotate Rotates a log channel.
AsteriskAri.AsteriskApi setGlobalVar POST /asterisk/variable Set the value of a global variable.
AsteriskAri.AsteriskApi unloadModule DELETE /asterisk/modules/{moduleName} Unload an Asterisk module.
AsteriskAri.AsteriskApi updateObject PUT /asterisk/config/dynamic/{configClass}/{objectType}/{id} Create or update a dynamic configuration object.
AsteriskAri.BridgesApi addChannel POST /bridges/{bridgeId}/addChannel Add a channel to a bridge.
AsteriskAri.BridgesApi clearVideoSource DELETE /bridges/{bridgeId}/videoSource Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.
AsteriskAri.BridgesApi create POST /bridges Create a new bridge.
AsteriskAri.BridgesApi createWithId POST /bridges/{bridgeId} Create a new bridge or updates an existing one.
AsteriskAri.BridgesApi destroy DELETE /bridges/{bridgeId} Shut down a bridge.
AsteriskAri.BridgesApi getbridge GET /bridges/{bridgeId} Get bridge details.
AsteriskAri.BridgesApi listbridges GET /bridges List all active bridges in Asterisk.
AsteriskAri.BridgesApi play POST /bridges/{bridgeId}/play Start playback of media on a bridge.
AsteriskAri.BridgesApi playWithId POST /bridges/{bridgeId}/play/{playbackId} Start playback of media on a bridge.
AsteriskAri.BridgesApi record POST /bridges/{bridgeId}/record Start a recording.
AsteriskAri.BridgesApi removeChannel POST /bridges/{bridgeId}/removeChannel Remove a channel from a bridge.
AsteriskAri.BridgesApi setVideoSource POST /bridges/{bridgeId}/videoSource/{channelId} Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.
AsteriskAri.BridgesApi startMoh POST /bridges/{bridgeId}/moh Play music on hold to a bridge or change the MOH class that is playing.
AsteriskAri.BridgesApi stopMoh DELETE /bridges/{bridgeId}/moh Stop playing music on hold to a bridge.
AsteriskAri.ChannelsApi addMoh POST /channels/{channelId}/moh Play music on hold to a channel.
AsteriskAri.ChannelsApi answer POST /channels/{channelId}/answer Answer a channel.
AsteriskAri.ChannelsApi continueInDialplan POST /channels/{channelId}/continue Exit application; continue execution in the dialplan.
AsteriskAri.ChannelsApi createchannel POST /channels/create Create channel.
AsteriskAri.ChannelsApi deletemoh DELETE /channels/{channelId}/moh Stop playing music on hold to a channel.
AsteriskAri.ChannelsApi dial POST /channels/{channelId}/dial Dial a created channel.
AsteriskAri.ChannelsApi externalMedia POST /channels/externalMedia Start an External Media session.
AsteriskAri.ChannelsApi getChannelVar GET /channels/{channelId}/variable Get the value of a channel variable or function.
AsteriskAri.ChannelsApi getchannel GET /channels/{channelId} Channel details.
AsteriskAri.ChannelsApi hangup DELETE /channels/{channelId} Delete (i.e. hangup) a channel.
AsteriskAri.ChannelsApi hold POST /channels/{channelId}/hold Hold a channel.
AsteriskAri.ChannelsApi listchannels GET /channels List all active channels in Asterisk.
AsteriskAri.ChannelsApi move POST /channels/{channelId}/move Move the channel from one Stasis application to another.
AsteriskAri.ChannelsApi mute POST /channels/{channelId}/mute Mute a channel.
AsteriskAri.ChannelsApi originate POST /channels Create a new channel (originate).
AsteriskAri.ChannelsApi originateWithId POST /channels/{channelId} Create a new channel (originate with id).
AsteriskAri.ChannelsApi playSoundWithId POST /channels/{channelId}/play/{playbackId} Start playback of media and specify the playbackId.
AsteriskAri.ChannelsApi playsound POST /channels/{channelId}/play Start playback of media.
AsteriskAri.ChannelsApi recordchannel POST /channels/{channelId}/record Start a recording.
AsteriskAri.ChannelsApi redirect POST /channels/{channelId}/redirect Redirect the channel to a different location.
AsteriskAri.ChannelsApi ring POST /channels/{channelId}/ring Indicate ringing to a channel.
AsteriskAri.ChannelsApi ringStop DELETE /channels/{channelId}/ring Stop ringing indication on a channel if locally generated.
AsteriskAri.ChannelsApi rtpstatistics GET /channels/{channelId}/rtp_statistics RTP stats on a channel.
AsteriskAri.ChannelsApi sendDTMF POST /channels/{channelId}/dtmf Send provided DTMF to a given channel.
AsteriskAri.ChannelsApi setChannelVar POST /channels/{channelId}/variable Set the value of a channel variable or function.
AsteriskAri.ChannelsApi snoopChannel POST /channels/{channelId}/snoop Start snooping.
AsteriskAri.ChannelsApi snoopChannelWithId POST /channels/{channelId}/snoop/{snoopId} Start snooping.
AsteriskAri.ChannelsApi startSilence POST /channels/{channelId}/silence Play silence to a channel.
AsteriskAri.ChannelsApi stopSilence DELETE /channels/{channelId}/silence Stop playing silence to a channel.
AsteriskAri.ChannelsApi unhold DELETE /channels/{channelId}/hold Remove a channel from hold.
AsteriskAri.ChannelsApi unmute DELETE /channels/{channelId}/mute Unmute a channel.
AsteriskAri.DeviceStatesApi callDelete DELETE /deviceStates/{deviceName} Destroy a device-state controlled by ARI.
AsteriskAri.DeviceStatesApi getdevicestate GET /deviceStates/{deviceName} Retrieve the current state of a device.
AsteriskAri.DeviceStatesApi listDeviceStates GET /deviceStates List all ARI controlled device states.
AsteriskAri.DeviceStatesApi update PUT /deviceStates/{deviceName} Change the state of a device controlled by ARI. (Note - implicitly creates the device state).
AsteriskAri.EndpointsApi getendpoint GET /endpoints/{tech}/{resource} Details for an endpoint.
AsteriskAri.EndpointsApi listByTech GET /endpoints/{tech} List available endoints for a given endpoint technology.
AsteriskAri.EndpointsApi listendpoints GET /endpoints List all endpoints.
AsteriskAri.EndpointsApi sendMessage PUT /endpoints/sendMessage Send a message to some technology URI or endpoint.
AsteriskAri.EndpointsApi sendMessageToEndpoint PUT /endpoints/{tech}/{resource}/sendMessage Send a message to some endpoint in a technology.
AsteriskAri.EventsApi eventWebsocket GET /events WebSocket connection for events.
AsteriskAri.EventsApi userEvent POST /events/user/{eventName} Generate a user event.
AsteriskAri.MailboxesApi deletemailbox DELETE /mailboxes/{mailboxName} Destroy a mailbox.
AsteriskAri.MailboxesApi getmailbox GET /mailboxes/{mailboxName} Retrieve the current state of a mailbox.
AsteriskAri.MailboxesApi listmailboxes GET /mailboxes List all mailboxes.
AsteriskAri.MailboxesApi updatemailbox PUT /mailboxes/{mailboxName} Change the state of a mailbox. (Note - implicitly creates the mailbox).
AsteriskAri.PlaybacksApi control POST /playbacks/{playbackId}/control Control a playback.
AsteriskAri.PlaybacksApi getplayback GET /playbacks/{playbackId} Get a playback's details.
AsteriskAri.PlaybacksApi stop DELETE /playbacks/{playbackId} Stop a playback.
AsteriskAri.RecordingsApi cancel DELETE /recordings/live/{recordingName} Stop a live recording and discard it.
AsteriskAri.RecordingsApi copyStored POST /recordings/stored/{recordingName}/copy Copy a stored recording.
AsteriskAri.RecordingsApi deleteStored DELETE /recordings/stored/{recordingName} Delete a stored recording.
AsteriskAri.RecordingsApi getLive GET /recordings/live/{recordingName} List live recordings.
AsteriskAri.RecordingsApi getStored GET /recordings/stored/{recordingName} Get a stored recording's details.
AsteriskAri.RecordingsApi getStoredFile GET /recordings/stored/{recordingName}/file Get the file associated with the stored recording.
AsteriskAri.RecordingsApi listStored GET /recordings/stored List recordings that are complete.
AsteriskAri.RecordingsApi muterecording POST /recordings/live/{recordingName}/mute Mute a live recording.
AsteriskAri.RecordingsApi pause POST /recordings/live/{recordingName}/pause Pause a live recording.
AsteriskAri.RecordingsApi stoprecording POST /recordings/live/{recordingName}/stop Stop a live recording and store it.
AsteriskAri.RecordingsApi unmuterecording DELETE /recordings/live/{recordingName}/mute Unmute a live recording.
AsteriskAri.RecordingsApi unpause DELETE /recordings/live/{recordingName}/pause Unpause a live recording.
AsteriskAri.SoundsApi getsound GET /sounds/{soundId} Get a sound's details.
AsteriskAri.SoundsApi listsounds GET /sounds List all sounds.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

About

js client for ARI generated from swagger


Languages

Language:JavaScript 99.7%Language:Shell 0.3%