# README
Go API client Asterisk 18.13.0 LTS
This is a production tested client for the Asterisk 18.13.0 LTS API from Quintex Software. This client is partly generated by swagger-codegen but also has gone through hand optimization and some manual changes to fit real world scenarios.
Installation
Note: Please try to use the latest version of Go.
go get -u github.com/quintex/go-asterisk-api-client
Usage
After installation, simply import this package and start using it:
import "https://github.com/quintex-dev/asterisk-ari-go"
Documentation for API Endpoints
All URIs are relative to http://xx.xx.xx.xx/ari of your Asterisk server.
Class | Method | HTTP request | Description |
---|---|---|---|
ApplicationsApi | Filter | Put /applications/{applicationName}/eventFilter | Filter application events types. |
ApplicationsApi | Get | Get /applications/{applicationName} | Get details of an application. |
ApplicationsApi | List | Get /applications | List all applications. |
ApplicationsApi | Subscribe | Post /applications/{applicationName}/subscription | Subscribe an application to a event source. |
ApplicationsApi | Unsubscribe | Delete /applications/{applicationName}/subscription | Unsubscribe an application from an event source. |
AsteriskApi | AddLog | Post /asterisk/logging/{logChannelName} | Adds a log channel. |
AsteriskApi | DeleteLog | Delete /asterisk/logging/{logChannelName} | Deletes a log channel. |
AsteriskApi | DeleteObject | Delete /asterisk/config/dynamic/{configClass}/{objectType}/{id} | Delete a dynamic configuration object. |
AsteriskApi | GetGlobalVar | Get /asterisk/variable | Get the value of a global variable. |
AsteriskApi | GetInfo | Get /asterisk/info | Gets Asterisk system information. |
AsteriskApi | GetModule | Get /asterisk/modules/{moduleName} | Get Asterisk module information. |
AsteriskApi | GetObject | Get /asterisk/config/dynamic/{configClass}/{objectType}/{id} | Retrieve a dynamic configuration object. |
AsteriskApi | ListLogChannels | Get /asterisk/logging | Gets Asterisk log channel information. |
AsteriskApi | ListModules | Get /asterisk/modules | List Asterisk modules. |
AsteriskApi | LoadModule | Post /asterisk/modules/{moduleName} | Load an Asterisk module. |
AsteriskApi | Ping | Get /asterisk/ping | Response pong message. |
AsteriskApi | ReloadModule | Put /asterisk/modules/{moduleName} | Reload an Asterisk module. |
AsteriskApi | RotateLog | Put /asterisk/logging/{logChannelName}/rotate | Rotates a log channel. |
AsteriskApi | SetGlobalVar | Post /asterisk/variable | Set the value of a global variable. |
AsteriskApi | UnloadModule | Delete /asterisk/modules/{moduleName} | Unload an Asterisk module. |
AsteriskApi | UpdateObject | Put /asterisk/config/dynamic/{configClass}/{objectType}/{id} | Create or update a dynamic configuration object. |
BridgesApi | AddChannel | Post /bridges/{bridgeId}/addChannel | Add a channel to a bridge. |
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. |
BridgesApi | Create | Post /bridges | Create a new bridge. |
BridgesApi | CreateWithId | Post /bridges/{bridgeId} | Create a new bridge or updates an existing one. |
BridgesApi | Destroy | Delete /bridges/{bridgeId} | Shut down a bridge. |
BridgesApi | Getbridge | Get /bridges/{bridgeId} | Get bridge details. |
BridgesApi | Listbridges | Get /bridges | List all active bridges in Asterisk. |
BridgesApi | Play | Post /bridges/{bridgeId}/play | Start playback of media on a bridge. |
BridgesApi | PlayWithId | Post /bridges/{bridgeId}/play/{playbackId} | Start playback of media on a bridge. |
BridgesApi | Record | Post /bridges/{bridgeId}/record | Start a recording. |
BridgesApi | RemoveChannel | Post /bridges/{bridgeId}/removeChannel | Remove a channel from a bridge. |
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. |
BridgesApi | StartMoh | Post /bridges/{bridgeId}/moh | Play music on hold to a bridge or change the MOH class that is playing. |
BridgesApi | StopMoh | Delete /bridges/{bridgeId}/moh | Stop playing music on hold to a bridge. |
ChannelsApi | AddMoh | Post /channels/{channelId}/moh | Play music on hold to a channel. |
ChannelsApi | Answer | Post /channels/{channelId}/answer | Answer a channel. |
ChannelsApi | ContinueInDialplan | Post /channels/{channelId}/continue | Exit application; continue execution in the dialplan. |
ChannelsApi | Createchannel | Post /channels/create | Create channel. |
ChannelsApi | Deletemoh | Delete /channels/{channelId}/moh | Stop playing music on hold to a channel. |
ChannelsApi | Dial | Post /channels/{channelId}/dial | Dial a created channel. |
ChannelsApi | ExternalMedia | Post /channels/externalMedia | Start an External Media session. |
ChannelsApi | GetChannelVar | Get /channels/{channelId}/variable | Get the value of a channel variable or function. |
ChannelsApi | Getchannel | Get /channels/{channelId} | Channel details. |
ChannelsApi | Hangup | Delete /channels/{channelId} | Delete (i.e. hangup) a channel. |
ChannelsApi | Hold | Post /channels/{channelId}/hold | Hold a channel. |
ChannelsApi | Listchannels | Get /channels | List all active channels in Asterisk. |
ChannelsApi | Move | Post /channels/{channelId}/move | Move the channel from one Stasis application to another. |
ChannelsApi | Mute | Post /channels/{channelId}/mute | Mute a channel. |
ChannelsApi | Originate | Post /channels | Create a new channel (originate). |
ChannelsApi | OriginateWithId | Post /channels/{channelId} | Create a new channel (originate with id). |
ChannelsApi | PlaySoundWithId | Post /channels/{channelId}/play/{playbackId} | Start playback of media and specify the playbackId. |
ChannelsApi | Playsound | Post /channels/{channelId}/play | Start playback of media. |
ChannelsApi | Recordchannel | Post /channels/{channelId}/record | Start a recording. |
ChannelsApi | Redirect | Post /channels/{channelId}/redirect | Redirect the channel to a different location. |
ChannelsApi | Ring | Post /channels/{channelId}/ring | Indicate ringing to a channel. |
ChannelsApi | RingStop | Delete /channels/{channelId}/ring | Stop ringing indication on a channel if locally generated. |
ChannelsApi | Rtpstatistics | Get /channels/{channelId}/rtp_statistics | RTP stats on a channel. |
ChannelsApi | SendDTMF | Post /channels/{channelId}/dtmf | Send provided DTMF to a given channel. |
ChannelsApi | SetChannelVar | Post /channels/{channelId}/variable | Set the value of a channel variable or function. |
ChannelsApi | SnoopChannel | Post /channels/{channelId}/snoop | Start snooping. |
ChannelsApi | SnoopChannelWithId | Post /channels/{channelId}/snoop/{snoopId} | Start snooping. |
ChannelsApi | StartSilence | Post /channels/{channelId}/silence | Play silence to a channel. |
ChannelsApi | StopSilence | Delete /channels/{channelId}/silence | Stop playing silence to a channel. |
ChannelsApi | Unhold | Delete /channels/{channelId}/hold | Remove a channel from hold. |
ChannelsApi | Unmute | Delete /channels/{channelId}/mute | Unmute a channel. |
DeviceStatesApi | Delete | Delete /deviceStates/{deviceName} | Destroy a device-state controlled by ARI. |
DeviceStatesApi | Getdevicestate | Get /deviceStates/{deviceName} | Retrieve the current state of a device. |
DeviceStatesApi | ListDeviceStates | Get /deviceStates | List all ARI controlled device states. |
DeviceStatesApi | Update | Put /deviceStates/{deviceName} | Change the state of a device controlled by ARI. (Note - implicitly creates the device state). |
EndpointsApi | Getendpoint | Get /endpoints/{tech}/{resource} | Details for an endpoint. |
EndpointsApi | ListByTech | Get /endpoints/{tech} | List available endoints for a given endpoint technology. |
EndpointsApi | Listendpoints | Get /endpoints | List all endpoints. |
EndpointsApi | SendMessage | Put /endpoints/sendMessage | Send a message to some technology URI or endpoint. |
EndpointsApi | SendMessageToEndpoint | Put /endpoints/{tech}/{resource}/sendMessage | Send a message to some endpoint in a technology. |
EventsApi | EventWebsocket | Get /events | WebSocket connection for events. |
EventsApi | UserEvent | Post /events/user/{eventName} | Generate a user event. |
MailboxesApi | Deletemailbox | Delete /mailboxes/{mailboxName} | Destroy a mailbox. |
MailboxesApi | Getmailbox | Get /mailboxes/{mailboxName} | Retrieve the current state of a mailbox. |
MailboxesApi | Listmailboxes | Get /mailboxes | List all mailboxes. |
MailboxesApi | Updatemailbox | Put /mailboxes/{mailboxName} | Change the state of a mailbox. (Note - implicitly creates the mailbox). |
PlaybacksApi | Control | Post /playbacks/{playbackId}/control | Control a playback. |
PlaybacksApi | Getplayback | Get /playbacks/{playbackId} | Get a playback's details. |
PlaybacksApi | Stop | Delete /playbacks/{playbackId} | Stop a playback. |
RecordingsApi | Cancel | Delete /recordings/live/{recordingName} | Stop a live recording and discard it. |
RecordingsApi | CopyStored | Post /recordings/stored/{recordingName}/copy | Copy a stored recording. |
RecordingsApi | DeleteStored | Delete /recordings/stored/{recordingName} | Delete a stored recording. |
RecordingsApi | GetLive | Get /recordings/live/{recordingName} | List live recordings. |
RecordingsApi | GetStored | Get /recordings/stored/{recordingName} | Get a stored recording's details. |
RecordingsApi | GetStoredFile | Get /recordings/stored/{recordingName}/file | Get the file associated with the stored recording. |
RecordingsApi | ListStored | Get /recordings/stored | List recordings that are complete. |
RecordingsApi | Muterecording | Post /recordings/live/{recordingName}/mute | Mute a live recording. |
RecordingsApi | Pause | Post /recordings/live/{recordingName}/pause | Pause a live recording. |
RecordingsApi | Stoprecording | Post /recordings/live/{recordingName}/stop | Stop a live recording and store it. |
RecordingsApi | Unmuterecording | Delete /recordings/live/{recordingName}/mute | Unmute a live recording. |
RecordingsApi | Unpause | Delete /recordings/live/{recordingName}/pause | Unpause a live recording. |
SoundsApi | Getsound | Get /sounds/{soundId} | Get a sound's details. |
SoundsApi | Listsounds | Get /sounds | List all sounds. |
Documentation For Models
- Application
- ApplicationMoveFailed
- ApplicationReplaced
- AsteriskInfo
- AsteriskPing
- Binary
- Bridge
- BridgeAttendedTransfer
- BridgeBlindTransfer
- BridgeCreated
- BridgeDestroyed
- BridgeMerged
- BridgeVideoSourceChanged
- BuildInfo
- CallerId
- Channel
- ChannelCallerId
- ChannelConnectedLine
- ChannelCreated
- ChannelDestroyed
- ChannelDialplan
- ChannelDtmfReceived
- ChannelEnteredBridge
- ChannelHangupRequest
- ChannelHold
- ChannelLeftBridge
- ChannelStateChange
- ChannelTalkingFinished
- ChannelTalkingStarted
- ChannelUnhold
- ChannelUserevent
- ChannelVarset
- ConfigInfo
- ConfigTuple
- ContactInfo
- ContactStatusChange
- Containers
- DeviceState
- DeviceStateChanged
- Dial
- Dialed
- DialplanCep
- Endpoint
- EndpointStateChange
- Event
- FormatLangPair
- LiveRecording
- LogChannel
- Mailbox
- Message
- MissingParams
- Module
- Peer
- PeerStatusChange
- Playback
- PlaybackContinuing
- PlaybackFinished
- PlaybackStarted
- RecordingFailed
- RecordingFinished
- RecordingStarted
- RtPstat
- SetId
- Sound
- StasisEnd
- StasisStart
- StatusInfo
- StoredRecording
- SystemInfo
- TextMessage
- TextMessageReceived
- Variable
Documentation For Authorization
Asterisk ARI uses HTTP Basic Authorization. Go context.Context
is used to pass in the HTTP Basic Authorization
credentials.
Author
Chris Roy @chris
With love from - Quintex Software Solutions Pvt. Ltd.
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
NewConfiguration creates a new Configuration object to be passed to the client.
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
# Structs
APIClient manages communication with the localhost:8088 API v6.0.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
Details of a Stasis application.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Asterisk system information.
Asterisk ping information.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Binary.
The merging of media from one or more channels.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Info about how Asterisk was built.
Caller identification.
A specific communication connection between Asterisk and an Endpoint.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Info about Asterisk configuration.
A key/value pair that makes up part of a configuration object.
No description provided by the author
Detailed information about a contact on an endpoint.
No description provided by the author
Container.
Represents the state of a device.
No description provided by the author
No description provided by the author
Dialed channel information.
Dialplan location (context/extension/priority).
An external device that may offer/accept calls to/from Asterisk.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Identifies the format and language of a sound file.
GenericSwaggerError Provides access to the body, error and model on returned errors.
A recording that is in progress.
Details of an Asterisk log channel.
Represents the state of a mailbox.
Base type for errors and events.
No description provided by the author
Details of an Asterisk module.
Detailed information about a remote peer that communicates with Asterisk.
No description provided by the author
Object representing the playback of media to a channel.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
A statistics of a RTP.
Effective user/group id.
A media file that may be played back.
No description provided by the author
No description provided by the author
No description provided by the author
Info about Asterisk status.
A past recording that may be played back.
Info about Asterisk.
A text message.
No description provided by the author
The value of a channel variable.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author