Categorygithub.com/quintex-dev/asterisk-ari-go
modulepackage
1.0.1
Repository: https://github.com/quintex-dev/asterisk-ari-go.git
Documentation: pkg.go.dev

# README

Go Reference

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.

ClassMethodHTTP requestDescription
ApplicationsApiFilterPut /applications/{applicationName}/eventFilterFilter application events types.
ApplicationsApiGetGet /applications/{applicationName}Get details of an application.
ApplicationsApiListGet /applicationsList all applications.
ApplicationsApiSubscribePost /applications/{applicationName}/subscriptionSubscribe an application to a event source.
ApplicationsApiUnsubscribeDelete /applications/{applicationName}/subscriptionUnsubscribe an application from an event source.
AsteriskApiAddLogPost /asterisk/logging/{logChannelName}Adds a log channel.
AsteriskApiDeleteLogDelete /asterisk/logging/{logChannelName}Deletes a log channel.
AsteriskApiDeleteObjectDelete /asterisk/config/dynamic/{configClass}/{objectType}/{id}Delete a dynamic configuration object.
AsteriskApiGetGlobalVarGet /asterisk/variableGet the value of a global variable.
AsteriskApiGetInfoGet /asterisk/infoGets Asterisk system information.
AsteriskApiGetModuleGet /asterisk/modules/{moduleName}Get Asterisk module information.
AsteriskApiGetObjectGet /asterisk/config/dynamic/{configClass}/{objectType}/{id}Retrieve a dynamic configuration object.
AsteriskApiListLogChannelsGet /asterisk/loggingGets Asterisk log channel information.
AsteriskApiListModulesGet /asterisk/modulesList Asterisk modules.
AsteriskApiLoadModulePost /asterisk/modules/{moduleName}Load an Asterisk module.
AsteriskApiPingGet /asterisk/pingResponse pong message.
AsteriskApiReloadModulePut /asterisk/modules/{moduleName}Reload an Asterisk module.
AsteriskApiRotateLogPut /asterisk/logging/{logChannelName}/rotateRotates a log channel.
AsteriskApiSetGlobalVarPost /asterisk/variableSet the value of a global variable.
AsteriskApiUnloadModuleDelete /asterisk/modules/{moduleName}Unload an Asterisk module.
AsteriskApiUpdateObjectPut /asterisk/config/dynamic/{configClass}/{objectType}/{id}Create or update a dynamic configuration object.
BridgesApiAddChannelPost /bridges/{bridgeId}/addChannelAdd a channel to a bridge.
BridgesApiClearVideoSourceDelete /bridges/{bridgeId}/videoSourceRemoves 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.
BridgesApiCreatePost /bridgesCreate a new bridge.
BridgesApiCreateWithIdPost /bridges/{bridgeId}Create a new bridge or updates an existing one.
BridgesApiDestroyDelete /bridges/{bridgeId}Shut down a bridge.
BridgesApiGetbridgeGet /bridges/{bridgeId}Get bridge details.
BridgesApiListbridgesGet /bridgesList all active bridges in Asterisk.
BridgesApiPlayPost /bridges/{bridgeId}/playStart playback of media on a bridge.
BridgesApiPlayWithIdPost /bridges/{bridgeId}/play/{playbackId}Start playback of media on a bridge.
BridgesApiRecordPost /bridges/{bridgeId}/recordStart a recording.
BridgesApiRemoveChannelPost /bridges/{bridgeId}/removeChannelRemove a channel from a bridge.
BridgesApiSetVideoSourcePost /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.
BridgesApiStartMohPost /bridges/{bridgeId}/mohPlay music on hold to a bridge or change the MOH class that is playing.
BridgesApiStopMohDelete /bridges/{bridgeId}/mohStop playing music on hold to a bridge.
ChannelsApiAddMohPost /channels/{channelId}/mohPlay music on hold to a channel.
ChannelsApiAnswerPost /channels/{channelId}/answerAnswer a channel.
ChannelsApiContinueInDialplanPost /channels/{channelId}/continueExit application; continue execution in the dialplan.
ChannelsApiCreatechannelPost /channels/createCreate channel.
ChannelsApiDeletemohDelete /channels/{channelId}/mohStop playing music on hold to a channel.
ChannelsApiDialPost /channels/{channelId}/dialDial a created channel.
ChannelsApiExternalMediaPost /channels/externalMediaStart an External Media session.
ChannelsApiGetChannelVarGet /channels/{channelId}/variableGet the value of a channel variable or function.
ChannelsApiGetchannelGet /channels/{channelId}Channel details.
ChannelsApiHangupDelete /channels/{channelId}Delete (i.e. hangup) a channel.
ChannelsApiHoldPost /channels/{channelId}/holdHold a channel.
ChannelsApiListchannelsGet /channelsList all active channels in Asterisk.
ChannelsApiMovePost /channels/{channelId}/moveMove the channel from one Stasis application to another.
ChannelsApiMutePost /channels/{channelId}/muteMute a channel.
ChannelsApiOriginatePost /channelsCreate a new channel (originate).
ChannelsApiOriginateWithIdPost /channels/{channelId}Create a new channel (originate with id).
ChannelsApiPlaySoundWithIdPost /channels/{channelId}/play/{playbackId}Start playback of media and specify the playbackId.
ChannelsApiPlaysoundPost /channels/{channelId}/playStart playback of media.
ChannelsApiRecordchannelPost /channels/{channelId}/recordStart a recording.
ChannelsApiRedirectPost /channels/{channelId}/redirectRedirect the channel to a different location.
ChannelsApiRingPost /channels/{channelId}/ringIndicate ringing to a channel.
ChannelsApiRingStopDelete /channels/{channelId}/ringStop ringing indication on a channel if locally generated.
ChannelsApiRtpstatisticsGet /channels/{channelId}/rtp_statisticsRTP stats on a channel.
ChannelsApiSendDTMFPost /channels/{channelId}/dtmfSend provided DTMF to a given channel.
ChannelsApiSetChannelVarPost /channels/{channelId}/variableSet the value of a channel variable or function.
ChannelsApiSnoopChannelPost /channels/{channelId}/snoopStart snooping.
ChannelsApiSnoopChannelWithIdPost /channels/{channelId}/snoop/{snoopId}Start snooping.
ChannelsApiStartSilencePost /channels/{channelId}/silencePlay silence to a channel.
ChannelsApiStopSilenceDelete /channels/{channelId}/silenceStop playing silence to a channel.
ChannelsApiUnholdDelete /channels/{channelId}/holdRemove a channel from hold.
ChannelsApiUnmuteDelete /channels/{channelId}/muteUnmute a channel.
DeviceStatesApiDeleteDelete /deviceStates/{deviceName}Destroy a device-state controlled by ARI.
DeviceStatesApiGetdevicestateGet /deviceStates/{deviceName}Retrieve the current state of a device.
DeviceStatesApiListDeviceStatesGet /deviceStatesList all ARI controlled device states.
DeviceStatesApiUpdatePut /deviceStates/{deviceName}Change the state of a device controlled by ARI. (Note - implicitly creates the device state).
EndpointsApiGetendpointGet /endpoints/{tech}/{resource}Details for an endpoint.
EndpointsApiListByTechGet /endpoints/{tech}List available endoints for a given endpoint technology.
EndpointsApiListendpointsGet /endpointsList all endpoints.
EndpointsApiSendMessagePut /endpoints/sendMessageSend a message to some technology URI or endpoint.
EndpointsApiSendMessageToEndpointPut /endpoints/{tech}/{resource}/sendMessageSend a message to some endpoint in a technology.
EventsApiEventWebsocketGet /eventsWebSocket connection for events.
EventsApiUserEventPost /events/user/{eventName}Generate a user event.
MailboxesApiDeletemailboxDelete /mailboxes/{mailboxName}Destroy a mailbox.
MailboxesApiGetmailboxGet /mailboxes/{mailboxName}Retrieve the current state of a mailbox.
MailboxesApiListmailboxesGet /mailboxesList all mailboxes.
MailboxesApiUpdatemailboxPut /mailboxes/{mailboxName}Change the state of a mailbox. (Note - implicitly creates the mailbox).
PlaybacksApiControlPost /playbacks/{playbackId}/controlControl a playback.
PlaybacksApiGetplaybackGet /playbacks/{playbackId}Get a playback's details.
PlaybacksApiStopDelete /playbacks/{playbackId}Stop a playback.
RecordingsApiCancelDelete /recordings/live/{recordingName}Stop a live recording and discard it.
RecordingsApiCopyStoredPost /recordings/stored/{recordingName}/copyCopy a stored recording.
RecordingsApiDeleteStoredDelete /recordings/stored/{recordingName}Delete a stored recording.
RecordingsApiGetLiveGet /recordings/live/{recordingName}List live recordings.
RecordingsApiGetStoredGet /recordings/stored/{recordingName}Get a stored recording's details.
RecordingsApiGetStoredFileGet /recordings/stored/{recordingName}/fileGet the file associated with the stored recording.
RecordingsApiListStoredGet /recordings/storedList recordings that are complete.
RecordingsApiMuterecordingPost /recordings/live/{recordingName}/muteMute a live recording.
RecordingsApiPausePost /recordings/live/{recordingName}/pausePause a live recording.
RecordingsApiStoprecordingPost /recordings/live/{recordingName}/stopStop a live recording and store it.
RecordingsApiUnmuterecordingDelete /recordings/live/{recordingName}/muteUnmute a live recording.
RecordingsApiUnpauseDelete /recordings/live/{recordingName}/pauseUnpause a live recording.
SoundsApiGetsoundGet /sounds/{soundId}Get a sound's details.
SoundsApiListsoundsGet /soundsList all sounds.

Documentation For Models

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