Categorygithub.com/quintex-dev/asterisk-ari-go
repositorypackage
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.