asterisk_ari_go

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

README

Go Reference

Go API client Asterisk 18.13.0 LTS

Forked from https://github.com/quintex-dev/asterisk-ari-go

What is different from the original repo:

  1. Added api_websocket.go that helps to establish initial web-socket connection to Asterisk.
  2. Added examples/ folder with the working example and Asterisk dialplan sample. Use make run to run the example. Do not forget to fill .env with proper values.
    sample.env is provided as an example.
cd examples/
go mod tidy
make run
  1. To get this working you must have properly configured Asterisk that supports ARI and http server must be enabled.

The original documentation

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.

Usage

After installation, simply import this package and start using it:

import "github.com/olegromanchuk/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

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.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	ApplicationsApi *ApplicationsApiService

	AsteriskApi *AsteriskApiService

	BridgesApi *BridgesApiService

	ChannelsApi *ChannelsApiService

	DeviceStatesApi *DeviceStatesApiService

	EndpointsApi *EndpointsApiService

	EventsApi *EventsApiService

	MailboxesApi *MailboxesApiService

	PlaybacksApi *PlaybacksApiService

	RecordingsApi *RecordingsApiService

	SoundsApi *SoundsApiService

	WebsocketApi *WebsocketApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the localhost:8088 API v6.0.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration, logger ...*logrus.Logger) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type Application

type Application struct {
	// Id's for bridges subscribed to.
	BridgeIds []string `json:"bridge_ids"`
	// Id's for channels subscribed to.
	ChannelIds []string `json:"channel_ids"`
	// Names of the devices subscribed to.
	DeviceNames []string `json:"device_names"`
	// {tech}/{resource} for endpoints subscribed to.
	EndpointIds []string `json:"endpoint_ids"`
	// Event types sent to the application.
	EventsAllowed []interface{} `json:"events_allowed"`
	// Event types not sent to the application.
	EventsDisallowed []interface{} `json:"events_disallowed"`
	// Name of this application
	Name string `json:"name"`
}

Details of a Stasis application

type ApplicationMoveFailed

type ApplicationMoveFailed struct {
}

type ApplicationReplaced

type ApplicationReplaced struct {
}

type ApplicationsApiFilterOpts

type ApplicationsApiFilterOpts struct {
	Filter optional.Interface
}

type ApplicationsApiService

type ApplicationsApiService service

func (*ApplicationsApiService) Filter

func (a *ApplicationsApiService) Filter(ctx context.Context, applicationName string, localVarOptionals *ApplicationsApiFilterOpts) (Application, *http.Response, error)

func (*ApplicationsApiService) Get

func (a *ApplicationsApiService) Get(ctx context.Context, applicationName string) (Application, *http.Response, error)

ApplicationsApiService Get details of an application.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param applicationName Application's name

@return Application

func (*ApplicationsApiService) List

ApplicationsApiService List all applications.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Application

func (*ApplicationsApiService) Subscribe

func (a *ApplicationsApiService) Subscribe(ctx context.Context, applicationName string, eventSource []string) (Application, *http.Response, error)

ApplicationsApiService Subscribe an application to a event source. Returns the state of the application after the subscriptions have changed

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param applicationName Application's name
  • @param eventSource URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}

@return Application

func (*ApplicationsApiService) Unsubscribe

func (a *ApplicationsApiService) Unsubscribe(ctx context.Context, applicationName string, eventSource []string) (Application, *http.Response, error)

ApplicationsApiService Unsubscribe an application from an event source. Returns the state of the application after the subscriptions have changed

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param applicationName Application's name
  • @param eventSource URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}

@return Application

type AsteriskApiGetInfoOpts

type AsteriskApiGetInfoOpts struct {
	Only optional.Interface
}

type AsteriskApiService

type AsteriskApiService service

func (*AsteriskApiService) AddLog

func (a *AsteriskApiService) AddLog(ctx context.Context, logChannelName string, configuration string) (*http.Response, error)

AddLog Adds a log channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param logChannelName The log channel to add
  • @param configuration levels of the log channel

func (*AsteriskApiService) DeleteLog

func (a *AsteriskApiService) DeleteLog(ctx context.Context, logChannelName string) (*http.Response, error)

DeleteLog Deletes a log channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param logChannelName Log channels name

func (*AsteriskApiService) DeleteObject

func (a *AsteriskApiService) DeleteObject(ctx context.Context, configClass string, objectType string, id string) (*http.Response, error)

DeleteObject Delete a dynamic configuration object.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param configClass The configuration class containing dynamic configuration objects.
  • @param objectType The type of configuration object to delete.
  • @param id The unique identifier of the object to delete.

func (*AsteriskApiService) GetGlobalVar

func (a *AsteriskApiService) GetGlobalVar(ctx context.Context, variable string) (Variable, *http.Response, error)

GetGlobalVar Get the value of a global variable.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param variable The variable to get

@return Variable

func (*AsteriskApiService) GetInfo

func (a *AsteriskApiService) GetInfo(ctx context.Context, localVarOptionals *AsteriskApiGetInfoOpts) (AsteriskInfo, *http.Response, error)

func (*AsteriskApiService) GetModule

func (a *AsteriskApiService) GetModule(ctx context.Context, moduleName string) (Module, *http.Response, error)

GetModule Get Asterisk module information.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param moduleName Module's name

@return Module

func (*AsteriskApiService) GetObject

func (a *AsteriskApiService) GetObject(ctx context.Context, configClass string, objectType string, id string) ([]ConfigTuple, *http.Response, error)

GetObject Retrieve a dynamic configuration object.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param configClass The configuration class containing dynamic configuration objects.
  • @param objectType The type of configuration object to retrieve.
  • @param id The unique identifier of the object to retrieve.

@return []ConfigTuple

func (*AsteriskApiService) ListLogChannels

func (a *AsteriskApiService) ListLogChannels(ctx context.Context) ([]LogChannel, *http.Response, error)

ListLogChannels Gets Asterisk log channel information.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []LogChannel

func (*AsteriskApiService) ListModules

func (a *AsteriskApiService) ListModules(ctx context.Context) ([]Module, *http.Response, error)

ListModules List Asterisk modules.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Module

func (*AsteriskApiService) LoadModule

func (a *AsteriskApiService) LoadModule(ctx context.Context, moduleName string) (*http.Response, error)

LoadModule Load an Asterisk module.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param moduleName Module's name

func (*AsteriskApiService) Ping

Ping Response pong message.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return AsteriskPing

func (*AsteriskApiService) ReloadModule

func (a *AsteriskApiService) ReloadModule(ctx context.Context, moduleName string) (*http.Response, error)

ReloadModule Reload an Asterisk module.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param moduleName Module's name

func (*AsteriskApiService) RotateLog

func (a *AsteriskApiService) RotateLog(ctx context.Context, logChannelName string) (*http.Response, error)

RotateLog Rotates a log channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param logChannelName Log channel's name

func (*AsteriskApiService) SetGlobalVar

func (a *AsteriskApiService) SetGlobalVar(ctx context.Context, variable string, localVarOptionals *AsteriskApiSetGlobalVarOpts) (*http.Response, error)

func (*AsteriskApiService) UnloadModule

func (a *AsteriskApiService) UnloadModule(ctx context.Context, moduleName string) (*http.Response, error)

UnloadModule Unload an Asterisk module.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param moduleName Module's name

func (*AsteriskApiService) UpdateObject

func (a *AsteriskApiService) UpdateObject(ctx context.Context, configClass string, objectType string, id string, localVarOptionals *AsteriskApiUpdateObjectOpts) ([]ConfigTuple, *http.Response, error)

type AsteriskApiSetGlobalVarOpts

type AsteriskApiSetGlobalVarOpts struct {
	Value optional.String
}

type AsteriskApiUpdateObjectOpts

type AsteriskApiUpdateObjectOpts struct {
	Fields optional.Interface
}

type AsteriskInfo

type AsteriskInfo struct {
	// Info about how Asterisk was built
	Build *BuildInfo `json:"build,omitempty"`
	// Info about Asterisk configuration
	Config *ConfigInfo `json:"config,omitempty"`
	// Info about Asterisk status
	Status *StatusInfo `json:"status,omitempty"`
	// Info about the system running Asterisk
	System *SystemInfo `json:"system,omitempty"`
}

Asterisk system information

type AsteriskPing

type AsteriskPing struct {
	// Asterisk id info
	AsteriskId string `json:"asterisk_id"`
	// Always string value is pong
	Ping string `json:"ping"`
	// The timestamp string of request received time
	Timestamp string `json:"timestamp"`
}

Asterisk ping information

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Binary

type Binary struct {
}

Binary

type Bridge

type Bridge struct {
	// Bridging class
	BridgeClass string `json:"bridge_class"`
	// Type of bridge technology
	BridgeType string `json:"bridge_type"`
	// Ids of channels participating in this bridge
	Channels []string `json:"channels"`
	// Timestamp when bridge was created
	Creationtime string `json:"creationtime"`
	// Entity that created the bridge
	Creator string `json:"creator"`
	// Unique identifier for this bridge
	Id string `json:"id"`
	// Name the creator gave the bridge
	Name string `json:"name"`
	// Name of the current bridging technology
	Technology string `json:"technology"`
	// The video mode the bridge is using. One of 'none', 'talker', or 'single'.
	VideoMode string `json:"video_mode,omitempty"`
	// The ID of the channel that is the source of video in this bridge, if one exists.
	VideoSourceId string `json:"video_source_id,omitempty"`
}

The merging of media from one or more channels. Everyone on the bridge receives the same audio.

type BridgeAttendedTransfer

type BridgeAttendedTransfer struct {
}

type BridgeBlindTransfer

type BridgeBlindTransfer struct {
}

type BridgeCreated

type BridgeCreated struct {
}

type BridgeDestroyed

type BridgeDestroyed struct {
}

type BridgeMerged

type BridgeMerged struct {
}

type BridgeVideoSourceChanged

type BridgeVideoSourceChanged struct {
}

type BridgesApiAddChannelOpts

type BridgesApiAddChannelOpts struct {
	Role                        optional.String
	AbsorbDTMF                  optional.Bool
	Mute                        optional.Bool
	InhibitConnectedLineUpdates optional.Bool
}

type BridgesApiCreateOpts

type BridgesApiCreateOpts struct {
	Type_    optional.String
	BridgeId optional.String
	Name     optional.String
}

type BridgesApiCreateWithIdOpts

type BridgesApiCreateWithIdOpts struct {
	Type_ optional.String
	Name  optional.String
}

type BridgesApiPlayOpts

type BridgesApiPlayOpts struct {
	Lang       optional.String
	Offsetms   optional.Int32
	Skipms     optional.Int32
	PlaybackId optional.String
}

type BridgesApiPlayWithIdOpts

type BridgesApiPlayWithIdOpts struct {
	Lang     optional.String
	Offsetms optional.Int32
	Skipms   optional.Int32
}

type BridgesApiRecordOpts

type BridgesApiRecordOpts struct {
	MaxDurationSeconds optional.Int32
	MaxSilenceSeconds  optional.Int32
	IfExists           optional.String
	Beep               optional.Bool
	TerminateOn        optional.String
}

type BridgesApiService

type BridgesApiService service

func (*BridgesApiService) AddChannel

func (a *BridgesApiService) AddChannel(ctx context.Context, bridgeId string, channel []string, localVarOptionals *BridgesApiAddChannelOpts) (*http.Response, error)

func (*BridgesApiService) ClearVideoSource

func (a *BridgesApiService) ClearVideoSource(ctx context.Context, bridgeId string) (*http.Response, error)

BridgesApiService 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.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id

func (*BridgesApiService) Create

func (a *BridgesApiService) Create(ctx context.Context, localVarOptionals *BridgesApiCreateOpts) (Bridge, *http.Response, error)

func (*BridgesApiService) CreateWithId

func (a *BridgesApiService) CreateWithId(ctx context.Context, bridgeId string, localVarOptionals *BridgesApiCreateWithIdOpts) (Bridge, *http.Response, error)

func (*BridgesApiService) Destroy

func (a *BridgesApiService) Destroy(ctx context.Context, bridgeId string) (*http.Response, error)

BridgesApiService Shut down a bridge. If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id

func (*BridgesApiService) Getbridge

func (a *BridgesApiService) Getbridge(ctx context.Context, bridgeId string) (Bridge, *http.Response, error)

BridgesApiService Get bridge details.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id

@return Bridge

func (*BridgesApiService) Listbridges

func (a *BridgesApiService) Listbridges(ctx context.Context) ([]Bridge, *http.Response, error)

BridgesApiService List all active bridges in Asterisk.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Bridge

func (*BridgesApiService) Play

func (a *BridgesApiService) Play(ctx context.Context, bridgeId string, media []string, localVarOptionals *BridgesApiPlayOpts) (Playback, *http.Response, error)

func (*BridgesApiService) PlayWithId

func (a *BridgesApiService) PlayWithId(ctx context.Context, bridgeId string, playbackId string, media []string, localVarOptionals *BridgesApiPlayWithIdOpts) (Playback, *http.Response, error)

func (*BridgesApiService) Record

func (a *BridgesApiService) Record(ctx context.Context, bridgeId string, name string, format string, localVarOptionals *BridgesApiRecordOpts) (LiveRecording, *http.Response, error)

func (*BridgesApiService) RemoveChannel

func (a *BridgesApiService) RemoveChannel(ctx context.Context, bridgeId string, channel []string) (*http.Response, error)

BridgesApiService Remove a channel from a bridge.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id
  • @param channel Ids of channels to remove from bridge

func (*BridgesApiService) SetVideoSource

func (a *BridgesApiService) SetVideoSource(ctx context.Context, bridgeId string, channelId string) (*http.Response, error)

BridgesApiService 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.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id
  • @param channelId Channel's id

func (*BridgesApiService) StartMoh

func (a *BridgesApiService) StartMoh(ctx context.Context, bridgeId string, localVarOptionals *BridgesApiStartMohOpts) (*http.Response, error)

func (*BridgesApiService) StopMoh

func (a *BridgesApiService) StopMoh(ctx context.Context, bridgeId string) (*http.Response, error)

BridgesApiService Stop playing music on hold to a bridge. This will only stop music on hold being played via POST bridges/{bridgeId}/moh.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param bridgeId Bridge's id

type BridgesApiStartMohOpts

type BridgesApiStartMohOpts struct {
	MohClass optional.String
}

type BuildInfo

type BuildInfo struct {
	// Date and time when Asterisk was built.
	Date string `json:"date"`
	// Kernel version Asterisk was built on.
	Kernel string `json:"kernel"`
	// Machine architecture (x86_64, i686, ppc, etc.)
	Machine string `json:"machine"`
	// Compile time options, or empty string if default.
	Options string `json:"options"`
	// OS Asterisk was built on.
	Os string `json:"os"`
	// Username that build Asterisk
	User string `json:"user"`
}

Info about how Asterisk was built

type CallerId

type CallerId struct {
	Name   string `json:"name"`
	Number string `json:"number"`
}

Caller identification

type Channel

type Channel struct {
	Accountcode string    `json:"accountcode"`
	Caller      *CallerId `json:"caller"`
	// Channel variables
	Channelvars interface{} `json:"channelvars,omitempty"`
	Connected   *CallerId   `json:"connected"`
	// Timestamp when channel was created
	Creationtime string `json:"creationtime"`
	// Current location in the dialplan
	Dialplan *DialplanCep `json:"dialplan"`
	// Unique identifier of the channel.  This is the same as the Uniqueid field in AMI.
	Id string `json:"id"`
	// The default spoken language
	Language string `json:"language"`
	// Name of the channel (i.e. SIP/foo-0000a7e3)
	Name  string `json:"name"`
	State string `json:"state"`
}

A specific communication connection between Asterisk and an Endpoint.

type ChannelCallerId

type ChannelCallerId struct {
}

type ChannelConnectedLine

type ChannelConnectedLine struct {
}

type ChannelCreated

type ChannelCreated struct {
}

type ChannelDestroyed

type ChannelDestroyed struct {
}

type ChannelDialplan

type ChannelDialplan struct {
}

type ChannelDtmfReceived

type ChannelDtmfReceived struct {
}

type ChannelEnteredBridge

type ChannelEnteredBridge struct {
}

type ChannelHangupRequest

type ChannelHangupRequest struct {
}

type ChannelHold

type ChannelHold struct {
}

type ChannelLeftBridge

type ChannelLeftBridge struct {
}

type ChannelStateChange

type ChannelStateChange struct {
}

type ChannelTalkingFinished

type ChannelTalkingFinished struct {
}

type ChannelTalkingStarted

type ChannelTalkingStarted struct {
}

type ChannelUnhold

type ChannelUnhold struct {
}

type ChannelUserevent

type ChannelUserevent struct {
}

type ChannelVarset

type ChannelVarset struct {
}

type ChannelsApiAddMohOpts

type ChannelsApiAddMohOpts struct {
	MohClass optional.String
}

type ChannelsApiContinueInDialplanOpts

type ChannelsApiContinueInDialplanOpts struct {
	Context   optional.String
	Extension optional.String
	Priority  optional.Int32
	Label     optional.String
}

type ChannelsApiCreatechannelOpts

type ChannelsApiCreatechannelOpts struct {
	AppArgs        optional.String
	ChannelId      optional.String
	OtherChannelId optional.String
	Originator     optional.String
	Formats        optional.String
	Variables      optional.Interface
}

type ChannelsApiDialOpts

type ChannelsApiDialOpts struct {
	Caller  optional.String
	Timeout optional.Int32
}

type ChannelsApiExternalMediaOpts

type ChannelsApiExternalMediaOpts struct {
	ChannelId      optional.String
	Variables      optional.Interface
	Encapsulation  optional.String
	Transport      optional.String
	ConnectionType optional.String
	Direction      optional.String
	Data           optional.String
}

type ChannelsApiHangupOpts

type ChannelsApiHangupOpts struct {
	ReasonCode optional.String
	Reason     optional.String
}

type ChannelsApiMoveOpts

type ChannelsApiMoveOpts struct {
	AppArgs optional.String
}

type ChannelsApiMuteOpts

type ChannelsApiMuteOpts struct {
	Direction optional.String
}

type ChannelsApiOriginateOpts

type ChannelsApiOriginateOpts struct {
	Extension      optional.String
	Context        optional.String
	Priority       optional.Int64
	Label          optional.String
	App            optional.String
	AppArgs        optional.String
	CallerId       optional.String
	Timeout        optional.Int32
	Variables      optional.Interface
	ChannelId      optional.String
	OtherChannelId optional.String
	Originator     optional.String
	Formats        optional.String
}

type ChannelsApiOriginateWithIdOpts

type ChannelsApiOriginateWithIdOpts struct {
	Extension      optional.String
	Context        optional.String
	Priority       optional.Int64
	Label          optional.String
	App            optional.String
	AppArgs        optional.String
	CallerId       optional.String
	Timeout        optional.Int32
	Variables      optional.Interface
	OtherChannelId optional.String
	Originator     optional.String
	Formats        optional.String
}

type ChannelsApiPlaySoundWithIdOpts

type ChannelsApiPlaySoundWithIdOpts struct {
	Lang     optional.String
	Offsetms optional.Int32
	Skipms   optional.Int32
}

type ChannelsApiPlaysoundOpts

type ChannelsApiPlaysoundOpts struct {
	Lang       optional.String
	Offsetms   optional.Int32
	Skipms     optional.Int32
	PlaybackId optional.String
}

type ChannelsApiRecordchannelOpts

type ChannelsApiRecordchannelOpts struct {
	MaxDurationSeconds optional.Int32
	MaxSilenceSeconds  optional.Int32
	IfExists           optional.String
	Beep               optional.Bool
	TerminateOn        optional.String
}

type ChannelsApiSendDTMFOpts

type ChannelsApiSendDTMFOpts struct {
	Dtmf     optional.String
	Before   optional.Int32
	Between  optional.Int32
	Duration optional.Int32
	After    optional.Int32
}

type ChannelsApiService

type ChannelsApiService service

func (*ChannelsApiService) AddMoh

func (a *ChannelsApiService) AddMoh(ctx context.Context, channelId string, localVarOptionals *ChannelsApiAddMohOpts) (*http.Response, error)

func (*ChannelsApiService) Answer

func (a *ChannelsApiService) Answer(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Answer a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) ContinueInDialplan

func (a *ChannelsApiService) ContinueInDialplan(ctx context.Context, channelId string, localVarOptionals *ChannelsApiContinueInDialplanOpts) (*http.Response, error)

func (*ChannelsApiService) Createchannel

func (a *ChannelsApiService) Createchannel(ctx context.Context, endpoint string, app string, localVarOptionals *ChannelsApiCreatechannelOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) Deletemoh

func (a *ChannelsApiService) Deletemoh(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Stop playing music on hold to a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) Dial

func (a *ChannelsApiService) Dial(ctx context.Context, channelId string, localVarOptionals *ChannelsApiDialOpts) (*http.Response, error)

func (*ChannelsApiService) ExternalMedia

func (a *ChannelsApiService) ExternalMedia(ctx context.Context, app string, externalHost string, format string, localVarOptionals *ChannelsApiExternalMediaOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) GetChannelVar

func (a *ChannelsApiService) GetChannelVar(ctx context.Context, channelId string, variable string) (Variable, *http.Response, error)

ChannelsApiService Get the value of a channel variable or function.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id
  • @param variable The channel variable or function to get

@return Variable

func (*ChannelsApiService) Getchannel

func (a *ChannelsApiService) Getchannel(ctx context.Context, channelId string) (Channel, *http.Response, error)

ChannelsApiService Channel details.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

@return Channel

func (*ChannelsApiService) Hangup

func (a *ChannelsApiService) Hangup(ctx context.Context, channelId string, localVarOptionals *ChannelsApiHangupOpts) (*http.Response, error)

func (*ChannelsApiService) Hold

func (a *ChannelsApiService) Hold(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Hold a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) Listchannels

func (a *ChannelsApiService) Listchannels(ctx context.Context) ([]Channel, *http.Response, error)

ChannelsApiService List all active channels in Asterisk.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Channel

func (*ChannelsApiService) Move

func (a *ChannelsApiService) Move(ctx context.Context, channelId string, app string, localVarOptionals *ChannelsApiMoveOpts) (*http.Response, error)

func (*ChannelsApiService) Mute

func (a *ChannelsApiService) Mute(ctx context.Context, channelId string, localVarOptionals *ChannelsApiMuteOpts) (*http.Response, error)

func (*ChannelsApiService) Originate

func (a *ChannelsApiService) Originate(ctx context.Context, endpoint string, localVarOptionals *ChannelsApiOriginateOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) OriginateWithId

func (a *ChannelsApiService) OriginateWithId(ctx context.Context, channelId string, endpoint string, localVarOptionals *ChannelsApiOriginateWithIdOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) PlaySoundWithId

func (a *ChannelsApiService) PlaySoundWithId(ctx context.Context, channelId string, playbackId string, media []string, localVarOptionals *ChannelsApiPlaySoundWithIdOpts) (Playback, *http.Response, error)

func (*ChannelsApiService) Playsound

func (a *ChannelsApiService) Playsound(ctx context.Context, channelId string, media []string, localVarOptionals *ChannelsApiPlaysoundOpts) (Playback, *http.Response, error)

func (*ChannelsApiService) Recordchannel

func (a *ChannelsApiService) Recordchannel(ctx context.Context, channelId string, name string, format string, localVarOptionals *ChannelsApiRecordchannelOpts) (LiveRecording, *http.Response, error)

func (*ChannelsApiService) Redirect

func (a *ChannelsApiService) Redirect(ctx context.Context, channelId string, endpoint string) (*http.Response, error)

ChannelsApiService Redirect the channel to a different location.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id
  • @param endpoint The endpoint to redirect the channel to

func (*ChannelsApiService) Ring

func (a *ChannelsApiService) Ring(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Indicate ringing to a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) RingStop

func (a *ChannelsApiService) RingStop(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Stop ringing indication on a channel if locally generated.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) Rtpstatistics

func (a *ChannelsApiService) Rtpstatistics(ctx context.Context, channelId string) (RtPstat, *http.Response, error)

ChannelsApiService RTP stats on a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

@return RtPstat

func (*ChannelsApiService) SendDTMF

func (a *ChannelsApiService) SendDTMF(ctx context.Context, channelId string, localVarOptionals *ChannelsApiSendDTMFOpts) (*http.Response, error)

func (*ChannelsApiService) SetChannelVar

func (a *ChannelsApiService) SetChannelVar(ctx context.Context, channelId string, variable string, localVarOptionals *ChannelsApiSetChannelVarOpts) (*http.Response, error)

func (*ChannelsApiService) SnoopChannel

func (a *ChannelsApiService) SnoopChannel(ctx context.Context, channelId string, app string, localVarOptionals *ChannelsApiSnoopChannelOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) SnoopChannelWithId

func (a *ChannelsApiService) SnoopChannelWithId(ctx context.Context, channelId string, snoopId string, app string, localVarOptionals *ChannelsApiSnoopChannelWithIdOpts) (Channel, *http.Response, error)

func (*ChannelsApiService) StartSilence

func (a *ChannelsApiService) StartSilence(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Play silence to a channel. Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) StopSilence

func (a *ChannelsApiService) StopSilence(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Stop playing silence to a channel.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) Unhold

func (a *ChannelsApiService) Unhold(ctx context.Context, channelId string) (*http.Response, error)

ChannelsApiService Remove a channel from hold.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param channelId Channel's id

func (*ChannelsApiService) Unmute

func (a *ChannelsApiService) Unmute(ctx context.Context, channelId string, localVarOptionals *ChannelsApiUnmuteOpts) (*http.Response, error)

type ChannelsApiSetChannelVarOpts

type ChannelsApiSetChannelVarOpts struct {
	Value optional.String
}

type ChannelsApiSnoopChannelOpts

type ChannelsApiSnoopChannelOpts struct {
	Spy     optional.String
	Whisper optional.String
	AppArgs optional.String
	SnoopId optional.String
}

type ChannelsApiSnoopChannelWithIdOpts

type ChannelsApiSnoopChannelWithIdOpts struct {
	Spy     optional.String
	Whisper optional.String
	AppArgs optional.String
}

type ChannelsApiUnmuteOpts

type ChannelsApiUnmuteOpts struct {
	Direction optional.String
}

type ConfigInfo

type ConfigInfo struct {
	// Default language for media playback.
	DefaultLanguage string `json:"default_language"`
	// Maximum number of simultaneous channels.
	MaxChannels int32 `json:"max_channels,omitempty"`
	// Maximum load avg on system.
	MaxLoad float64 `json:"max_load,omitempty"`
	// Maximum number of open file handles (files, sockets).
	MaxOpenFiles int32 `json:"max_open_files,omitempty"`
	// Asterisk system name.
	Name string `json:"name"`
	// Effective user/group id for running Asterisk.
	Setid *SetId `json:"setid"`
}

Info about Asterisk configuration

type ConfigTuple

type ConfigTuple struct {
	// A configuration object attribute.
	Attribute string `json:"attribute"`
	// The value for the attribute.
	Value string `json:"value"`
}

A key/value pair that makes up part of a configuration object.

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration(basePath string) *Configuration

NewConfiguration creates a new Configuration object to be passed to the client. DO NOT INCLUDE "/ari" in the basePath.

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type ContactInfo

type ContactInfo struct {
	// The Address of Record this contact belongs to.
	Aor string `json:"aor"`
	// The current status of the contact.
	ContactStatus string `json:"contact_status"`
	// Current round trip time, in microseconds, for the contact.
	RoundtripUsec string `json:"roundtrip_usec,omitempty"`
	// The location of the contact.
	Uri string `json:"uri"`
}

Detailed information about a contact on an endpoint.

type ContactStatusChange

type ContactStatusChange struct {
}

type Containers

type Containers struct {
}

Container

type DeviceState

type DeviceState struct {
	// Name of the device.
	Name string `json:"name"`
	// Device's state
	State string `json:"state"`
}

Represents the state of a device.

type DeviceStateChanged

type DeviceStateChanged struct {
}

type DeviceStatesApiService

type DeviceStatesApiService service

func (*DeviceStatesApiService) Delete

func (a *DeviceStatesApiService) Delete(ctx context.Context, deviceName string) (*http.Response, error)

DeviceStatesApiService Destroy a device-state controlled by ARI.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param deviceName Name of the device

func (*DeviceStatesApiService) Getdevicestate

func (a *DeviceStatesApiService) Getdevicestate(ctx context.Context, deviceName string) (DeviceState, *http.Response, error)

DeviceStatesApiService Retrieve the current state of a device.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param deviceName Name of the device

@return DeviceState

func (*DeviceStatesApiService) ListDeviceStates

func (a *DeviceStatesApiService) ListDeviceStates(ctx context.Context) ([]DeviceState, *http.Response, error)

DeviceStatesApiService List all ARI controlled device states.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []DeviceState

func (*DeviceStatesApiService) Update

func (a *DeviceStatesApiService) Update(ctx context.Context, deviceName string, deviceState string) (*http.Response, error)

DeviceStatesApiService Change the state of a device controlled by ARI. (Note - implicitly creates the device state).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param deviceName Name of the device
  • @param deviceState Device state value

type Dial

type Dial struct {
}

type Dialed

type Dialed struct {
}

Dialed channel information.

type DialplanCep

type DialplanCep struct {
	// Parameter of current dialplan application
	AppData string `json:"app_data"`
	// Name of current dialplan application
	AppName string `json:"app_name"`
	// Context in the dialplan
	Context string `json:"context"`
	// Extension in the dialplan
	Exten string `json:"exten"`
	// Priority in the dialplan
	Priority int64 `json:"priority"`
}

Dialplan location (context/extension/priority)

type Endpoint

type Endpoint struct {
	// Id's of channels associated with this endpoint
	ChannelIds []string `json:"channel_ids"`
	// Identifier of the endpoint, specific to the given technology.
	Resource string `json:"resource"`
	// Endpoint's state
	State string `json:"state,omitempty"`
	// Technology of the endpoint
	Technology string `json:"technology"`
}

An external device that may offer/accept calls to/from Asterisk. Unlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.

type EndpointStateChange

type EndpointStateChange struct {
}

type EndpointsApiSendMessageOpts

type EndpointsApiSendMessageOpts struct {
	Body      optional.String
	Variables optional.Interface
}

type EndpointsApiSendMessageToEndpointOpts

type EndpointsApiSendMessageToEndpointOpts struct {
	Body      optional.String
	Variables optional.Interface
}

type EndpointsApiService

type EndpointsApiService service

func (*EndpointsApiService) Getendpoint

func (a *EndpointsApiService) Getendpoint(ctx context.Context, tech string, resource string) (Endpoint, *http.Response, error)

EndpointsApiService Details for an endpoint.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param tech Technology of the endpoint
  • @param resource ID of the endpoint

@return Endpoint

func (*EndpointsApiService) ListByTech

func (a *EndpointsApiService) ListByTech(ctx context.Context, tech string) ([]Endpoint, *http.Response, error)

EndpointsApiService List available endoints for a given endpoint technology.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param tech Technology of the endpoints (sip,iax2,...)

@return []Endpoint

func (*EndpointsApiService) Listendpoints

func (a *EndpointsApiService) Listendpoints(ctx context.Context) ([]Endpoint, *http.Response, error)

EndpointsApiService List all endpoints.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Endpoint

func (*EndpointsApiService) SendMessage

func (a *EndpointsApiService) SendMessage(ctx context.Context, to string, from string, localVarOptionals *EndpointsApiSendMessageOpts) (*http.Response, error)

func (*EndpointsApiService) SendMessageToEndpoint

func (a *EndpointsApiService) SendMessageToEndpoint(ctx context.Context, tech string, resource string, from string, localVarOptionals *EndpointsApiSendMessageToEndpointOpts) (*http.Response, error)

type Event

type Event struct {
	// The unique ID for the Asterisk instance that raised this event.
	AsteriskId string `json:"asterisk_id,omitempty"`
	// Indicates the type of this message.
	Type_ string `json:"type"`
}

type EventsApiEventWebsocketOpts

type EventsApiEventWebsocketOpts struct {
	SubscribeAll optional.Bool
}

type EventsApiService

type EventsApiService service

func (*EventsApiService) EventWebsocket

func (a *EventsApiService) EventWebsocket(ctx context.Context, app []string, localVarOptionals *EventsApiEventWebsocketOpts) (Message, *http.Response, error)

func (*EventsApiService) UserEvent

func (a *EventsApiService) UserEvent(ctx context.Context, eventName string, application string, localVarOptionals *EventsApiUserEventOpts) (*http.Response, error)

type EventsApiUserEventOpts

type EventsApiUserEventOpts struct {
	Source    optional.Interface
	Variables optional.Interface
}

type FormatLangPair

type FormatLangPair struct {
	Format   string `json:"format"`
	Language string `json:"language"`
}

Identifies the format and language of a sound file

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type LiveRecording

type LiveRecording struct {
	// Cause for recording failure if failed
	Cause string `json:"cause,omitempty"`
	// Duration in seconds of the recording
	Duration int32 `json:"duration,omitempty"`
	// Recording format (wav, gsm, etc.)
	Format string `json:"format"`
	// Base name for the recording
	Name string `json:"name"`
	// Duration of silence, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds.
	SilenceDuration int32  `json:"silence_duration,omitempty"`
	State           string `json:"state"`
	// Duration of talking, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds.
	TalkingDuration int32 `json:"talking_duration,omitempty"`
	// URI for the channel or bridge being recorded
	TargetUri string `json:"target_uri"`
}

A recording that is in progress

type LogChannel

type LogChannel struct {
	// The log channel path
	Channel string `json:"channel"`
	// The various log levels
	Configuration string `json:"configuration"`
	// Whether or not a log type is enabled
	Status string `json:"status"`
	// Types of logs for the log channel
	Type_ string `json:"type"`
}

Details of an Asterisk log channel

type Mailbox

type Mailbox struct {
	// Name of the mailbox.
	Name string `json:"name"`
	// Count of new messages in the mailbox.
	NewMessages int32 `json:"new_messages"`
	// Count of old messages in the mailbox.
	OldMessages int32 `json:"old_messages"`
}

Represents the state of a mailbox.

type MailboxesApiService

type MailboxesApiService service

func (*MailboxesApiService) Deletemailbox

func (a *MailboxesApiService) Deletemailbox(ctx context.Context, mailboxName string) (*http.Response, error)

MailboxesApiService Destroy a mailbox.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mailboxName Name of the mailbox

func (*MailboxesApiService) Getmailbox

func (a *MailboxesApiService) Getmailbox(ctx context.Context, mailboxName string) (Mailbox, *http.Response, error)

MailboxesApiService Retrieve the current state of a mailbox.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mailboxName Name of the mailbox

@return Mailbox

func (*MailboxesApiService) Listmailboxes

func (a *MailboxesApiService) Listmailboxes(ctx context.Context) ([]Mailbox, *http.Response, error)

MailboxesApiService List all mailboxes.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Mailbox

func (*MailboxesApiService) Updatemailbox

func (a *MailboxesApiService) Updatemailbox(ctx context.Context, mailboxName string, oldMessages int32, newMessages int32) (*http.Response, error)

MailboxesApiService Change the state of a mailbox. (Note - implicitly creates the mailbox).

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param mailboxName Name of the mailbox
  • @param oldMessages Count of old messages in the mailbox
  • @param newMessages Count of new messages in the mailbox

type Message

type Message struct {
	// The unique ID for the Asterisk instance that raised this event.
	AsteriskId string `json:"asterisk_id,omitempty"`
	// Indicates the type of this message.
	Type_ string `json:"type"`
}

Base type for errors and events

type MissingParams

type MissingParams struct {
	// The unique ID for the Asterisk instance that raised this event.
	AsteriskId string `json:"asterisk_id,omitempty"`
	// Indicates the type of this message.
	Type_ string `json:"type"`
}

type Module

type Module struct {
	// The description of this module
	Description string `json:"description"`
	// The name of this module
	Name string `json:"name"`
	// The running status of this module
	Status string `json:"status"`
	// The support state of this module
	SupportLevel string `json:"support_level"`
	// The number of times this module is being used
	UseCount int32 `json:"use_count"`
}

Details of an Asterisk module

type Peer

type Peer struct {
	// The IP address of the peer.
	Address string `json:"address,omitempty"`
	// An optional reason associated with the change in peer_status.
	Cause string `json:"cause,omitempty"`
	// The current state of the peer. Note that the values of the status are dependent on the underlying peer technology.
	PeerStatus string `json:"peer_status"`
	// The port of the peer.
	Port string `json:"port,omitempty"`
	// The last known time the peer was contacted.
	Time string `json:"time,omitempty"`
}

Detailed information about a remote peer that communicates with Asterisk.

type PeerStatusChange

type PeerStatusChange struct {
}

type Playback

type Playback struct {
	// ID for this playback operation
	Id string `json:"id"`
	// For media types that support multiple languages, the language requested for playback.
	Language string `json:"language,omitempty"`
	// The URI for the media currently being played back.
	MediaUri string `json:"media_uri"`
	// If a list of URIs is being played, the next media URI to be played back.
	NextMediaUri string `json:"next_media_uri,omitempty"`
	// Current state of the playback operation.
	State string `json:"state"`
	// URI for the channel or bridge to play the media on
	TargetUri string `json:"target_uri"`
}

Object representing the playback of media to a channel

type PlaybackContinuing

type PlaybackContinuing struct {
}

type PlaybackFinished

type PlaybackFinished struct {
}

type PlaybackStarted

type PlaybackStarted struct {
}

type PlaybacksApiService

type PlaybacksApiService service

func (*PlaybacksApiService) Control

func (a *PlaybacksApiService) Control(ctx context.Context, playbackId string, operation string) (*http.Response, error)

PlaybacksApiService Control a playback.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param playbackId Playback's id
  • @param operation Operation to perform on the playback.

func (*PlaybacksApiService) Getplayback

func (a *PlaybacksApiService) Getplayback(ctx context.Context, playbackId string) (Playback, *http.Response, error)

PlaybacksApiService Get a playback's details.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param playbackId Playback's id

@return Playback

func (*PlaybacksApiService) Stop

func (a *PlaybacksApiService) Stop(ctx context.Context, playbackId string) (*http.Response, error)

PlaybacksApiService Stop a playback.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param playbackId Playback's id

type RecordingFailed

type RecordingFailed struct {
}

type RecordingFinished

type RecordingFinished struct {
}

type RecordingStarted

type RecordingStarted struct {
}

type RecordingsApiService

type RecordingsApiService service

func (*RecordingsApiService) Cancel

func (a *RecordingsApiService) Cancel(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Stop a live recording and discard it.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) CopyStored

func (a *RecordingsApiService) CopyStored(ctx context.Context, recordingName string, destinationRecordingName string) (StoredRecording, *http.Response, error)

RecordingsApiService Copy a stored recording.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording to copy
  • @param destinationRecordingName The destination name of the recording

@return StoredRecording

func (*RecordingsApiService) DeleteStored

func (a *RecordingsApiService) DeleteStored(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Delete a stored recording.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) GetLive

func (a *RecordingsApiService) GetLive(ctx context.Context, recordingName string) (LiveRecording, *http.Response, error)

RecordingsApiService List live recordings.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

@return LiveRecording

func (*RecordingsApiService) GetStored

func (a *RecordingsApiService) GetStored(ctx context.Context, recordingName string) (StoredRecording, *http.Response, error)

RecordingsApiService Get a stored recording's details.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

@return StoredRecording

func (*RecordingsApiService) GetStoredFile

func (a *RecordingsApiService) GetStoredFile(ctx context.Context, recordingName string) (string, *http.Response, error)

RecordingsApiService Get the file associated with the stored recording.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

@return string

func (*RecordingsApiService) ListStored

RecordingsApiService List recordings that are complete.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []StoredRecording

func (*RecordingsApiService) Muterecording

func (a *RecordingsApiService) Muterecording(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Mute a live recording. Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) Pause

func (a *RecordingsApiService) Pause(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Pause a live recording. Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) Stoprecording

func (a *RecordingsApiService) Stoprecording(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Stop a live recording and store it.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) Unmuterecording

func (a *RecordingsApiService) Unmuterecording(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Unmute a live recording.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

func (*RecordingsApiService) Unpause

func (a *RecordingsApiService) Unpause(ctx context.Context, recordingName string) (*http.Response, error)

RecordingsApiService Unpause a live recording.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param recordingName The name of the recording

type RtPstat

type RtPstat struct {
	// The Asterisk channel's unique ID that owns this instance.
	ChannelUniqueid string `json:"channel_uniqueid"`
	// Maximum jitter on local side.
	LocalMaxjitter float64 `json:"local_maxjitter,omitempty"`
	// Maximum number of packets lost on local side.
	LocalMaxrxploss float64 `json:"local_maxrxploss,omitempty"`
	// Minimum jitter on local side.
	LocalMinjitter float64 `json:"local_minjitter,omitempty"`
	// Minimum number of packets lost on local side.
	LocalMinrxploss float64 `json:"local_minrxploss,omitempty"`
	// Average jitter on local side.
	LocalNormdevjitter float64 `json:"local_normdevjitter,omitempty"`
	// Average number of packets lost on local side.
	LocalNormdevrxploss float64 `json:"local_normdevrxploss,omitempty"`
	// Our SSRC.
	LocalSsrc int32 `json:"local_ssrc"`
	// Standard deviation jitter on local side.
	LocalStdevjitter float64 `json:"local_stdevjitter,omitempty"`
	// Standard deviation packets lost on local side.
	LocalStdevrxploss float64 `json:"local_stdevrxploss,omitempty"`
	// Maximum round trip time.
	Maxrtt float64 `json:"maxrtt,omitempty"`
	// Minimum round trip time.
	Minrtt float64 `json:"minrtt,omitempty"`
	// Average round trip time.
	Normdevrtt float64 `json:"normdevrtt,omitempty"`
	// Maximum jitter on remote side.
	RemoteMaxjitter float64 `json:"remote_maxjitter,omitempty"`
	// Maximum number of packets lost on remote side.
	RemoteMaxrxploss float64 `json:"remote_maxrxploss,omitempty"`
	// Minimum jitter on remote side.
	RemoteMinjitter float64 `json:"remote_minjitter,omitempty"`
	// Minimum number of packets lost on remote side.
	RemoteMinrxploss float64 `json:"remote_minrxploss,omitempty"`
	// Average jitter on remote side.
	RemoteNormdevjitter float64 `json:"remote_normdevjitter,omitempty"`
	// Average number of packets lost on remote side.
	RemoteNormdevrxploss float64 `json:"remote_normdevrxploss,omitempty"`
	// Their SSRC.
	RemoteSsrc int32 `json:"remote_ssrc"`
	// Standard deviation jitter on remote side.
	RemoteStdevjitter float64 `json:"remote_stdevjitter,omitempty"`
	// Standard deviation packets lost on remote side.
	RemoteStdevrxploss float64 `json:"remote_stdevrxploss,omitempty"`
	// Total round trip time.
	Rtt float64 `json:"rtt,omitempty"`
	// Number of packets received.
	Rxcount int32 `json:"rxcount"`
	// Jitter on received packets.
	Rxjitter float64 `json:"rxjitter,omitempty"`
	// Number of octets received.
	Rxoctetcount int32 `json:"rxoctetcount"`
	// Number of received packets lost.
	Rxploss int32 `json:"rxploss"`
	// Standard deviation round trip time.
	Stdevrtt float64 `json:"stdevrtt,omitempty"`
	// Number of packets transmitted.
	Txcount int32 `json:"txcount"`
	// Jitter on transmitted packets.
	Txjitter float64 `json:"txjitter,omitempty"`
	// Number of octets transmitted.
	Txoctetcount int32 `json:"txoctetcount"`
	// Number of transmitted packets lost.
	Txploss int32 `json:"txploss"`
}

A statistics of a RTP.

type SetId

type SetId struct {
	// Effective group id.
	Group string `json:"group"`
	// Effective user id.
	User string `json:"user"`
}

Effective user/group id

type Sound

type Sound struct {
	// The formats and languages in which this sound is available.
	Formats []FormatLangPair `json:"formats"`
	// Sound's identifier.
	Id string `json:"id"`
	// Text description of the sound, usually the words spoken.
	Text string `json:"text,omitempty"`
}

A media file that may be played back.

type SoundsApiListsoundsOpts

type SoundsApiListsoundsOpts struct {
	Lang   optional.String
	Format optional.String
}

type SoundsApiService

type SoundsApiService service

func (*SoundsApiService) Getsound

func (a *SoundsApiService) Getsound(ctx context.Context, soundId string) (Sound, *http.Response, error)

SoundsApiService Get a sound's details.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param soundId Sound's id

@return Sound

func (*SoundsApiService) Listsounds

func (a *SoundsApiService) Listsounds(ctx context.Context, localVarOptionals *SoundsApiListsoundsOpts) ([]Sound, *http.Response, error)

type StasisEnd

type StasisEnd struct {
}

type StasisEvent

type StasisEvent struct {
	Application string               `json:"application"`        // Application name
	Args        []string             `json:"args,omitempty"`     // Optional arguments
	AsteriskID  string               `json:"asterisk_id"`        // Asterisk instance ID
	Channel     Channel              `json:"channel"`            // Channel information
	Timestamp   StasisTimestampEvent `json:"timestamp"`          // Event timestamp
	Type        string               `json:"type"`               // Event type
	Value       string               `json:"value,omitempty"`    // Optional value
	Variable    string               `json:"variable,omitempty"` // Optional variable
}

StasisEvent represents an event in the Stasis application.

type StasisStart

type StasisStart struct {
}

type StasisTimestampEvent

type StasisTimestampEvent struct {
	Timestamp time.Time `json:"timestamp"` // Timestamp of the event
}

StasisTimestampEvent represents a timestamp for a Stasis event.

func (*StasisTimestampEvent) UnmarshalJSON

func (s *StasisTimestampEvent) UnmarshalJSON(b []byte) error

UnmarshalJSON custom parsing for the timestamp UnmarshalJSON parses the JSON-encoded data and stores the result in the value pointed to by s.

type StatusInfo

type StatusInfo struct {
	// Time when Asterisk was last reloaded.
	LastReloadTime string `json:"last_reload_time"`
	// Time when Asterisk was started.
	StartupTime string `json:"startup_time"`
}

Info about Asterisk status

type StoredRecording

type StoredRecording struct {
	Format string `json:"format"`
	Name   string `json:"name"`
}

A past recording that may be played back.

type SystemInfo

type SystemInfo struct {
	EntityId string `json:"entity_id"`
	// Asterisk version.
	Version string `json:"version"`
}

Info about Asterisk

type TextMessage

type TextMessage struct {
	// The text of the message.
	Body string `json:"body"`
	// A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.
	From string `json:"from"`
	// A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.
	To string `json:"to"`
	// Technology specific key/value pairs (JSON object) associated with the message.
	Variables interface{} `json:"variables,omitempty"`
}

A text message.

type TextMessageReceived

type TextMessageReceived struct {
}

type Variable

type Variable struct {
	// The value of the variable requested
	Value string `json:"value"`
}

The value of a channel variable

type WebsocketApiService

type WebsocketApiService service

WebsocketApiService represents a service for managing WebSocket connections.

func (*WebsocketApiService) WebsocketConnect

func (a *WebsocketApiService) WebsocketConnect(ctx context.Context, app []string, auth []string) (*websocket.Conn, *http.Response, error)

WebsocketConnect establishes a WebSocket connection for events. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. @param app []string - Applications to subscribe to. @param auth []string - Authentication credentials. @return *websocket.Conn - WebSocket connection. @return *http.Response - HTTP response. @return error - Error, if any.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL