Documentation
¶
Index ¶
- Variables
- func AnnouncementSubject(prefix string) string
- func PingSubject(prefix string) string
- func Subject(prefix, class, appName, asterisk string) (ret string)
- type Announcement
- type ApplicationSubscribe
- type AsteriskConfig
- type AsteriskLoggingChannel
- type AsteriskVariableSet
- type BridgeAddChannel
- type BridgeCreate
- type BridgeMOH
- type BridgePlay
- type BridgeRecord
- type BridgeRemoveChannel
- type ChannelContinue
- type ChannelCreate
- type ChannelDial
- type ChannelHangup
- type ChannelMOH
- type ChannelMute
- type ChannelOriginate
- type ChannelPlay
- type ChannelRecord
- type ChannelSendDTMF
- type ChannelSnoop
- type ChannelVariable
- type DeviceStateUpdate
- type EndpointListByTech
- type EntityData
- type MailboxUpdate
- type PlaybackControl
- type RecordingStoredCopy
- type Request
- type Response
- type SoundList
Constants ¶
This section is empty.
Variables ¶
var AnnouncementInterval = time.Minute
AnnouncementInterval is the amount of time to wait between periodic service availability announcements
var ErrNotFound = errors.New("Not found")
ErrNotFound indicates that the operation did not return a result
Functions ¶
func AnnouncementSubject ¶
AnnouncementSubject returns the NATS subject
func PingSubject ¶
PingSubject returns the NATS subject for a cluster-wide proxy ping for presence
Types ¶
type Announcement ¶
type Announcement struct {
// Node indicates the Asterisk ID to which the proxy is connected
Node string `json:"node"`
// Application indicates the ARI application as which the proxy is connected
Application string `json:"application"`
}
Announcement describes the structure of an ARI proxy's announcement of availability on the network. These are sent periodically and upon request (by a Ping).
type ApplicationSubscribe ¶
type ApplicationSubscribe struct {
// EventSource is the ARI event source to which the subscription is requested. This should be one of:
// - channel:<channelId>
// - bridge:<bridgeId>
// - endpoint:<tech>/<resource> (e.g. SIP/102)
// - deviceState:<deviceName>
EventSource string `json:"event_source"`
}
ApplicationSubscribe describes a request to subscribe/unsubscribe a particular ARI application to an EventSource
type AsteriskConfig ¶
type AsteriskConfig struct {
// Tuples is the list of configuration tuples to update
Tuples []ari.ConfigTuple `json:"tuples,omitempty"`
}
AsteriskConfig describes the request relating to asterisk configuration
type AsteriskLoggingChannel ¶
type AsteriskLoggingChannel struct {
// Levels is the set of logging levels for this logging channel (comma-separated string)
Levels string `json:"config"`
}
AsteriskLoggingChannel describes a request relating to an asterisk logging channel
type AsteriskVariableSet ¶
type AsteriskVariableSet struct {
// Value is the value to set
Value string `json:"value"`
}
AsteriskVariableSet is the request type for setting an asterisk variable
type BridgeAddChannel ¶
type BridgeAddChannel struct {
// Channel is the channel ID to add to the bridge
Channel string `json:"channel"`
}
BridgeAddChannel is the request type for adding a channel to a bridge
type BridgeCreate ¶
type BridgeCreate struct {
// Type is the comma-separated list of bridge type attributes (mixing,
// holding, dtmf_events, proxy_media). If not set, the default (mixing)
// will be used.
Type string `json:"type"`
// Name is the name to assign to the bridge (optional)
Name string `json:"name,omitempty"`
}
BridgeCreate is the request type for creating a bridge
type BridgeMOH ¶
type BridgeMOH struct {
// Class is the Music On Hold class to be played
Class string `json:"class"`
}
BridgeMOH is the request type for playing Music on Hold to a bridge
type BridgePlay ¶
type BridgePlay struct {
// PlaybackID is the unique identifier for this playback
PlaybackID string `json:"playback_id"`
// MediaURI is the URI from which to obtain the playback media
MediaURI string `json:"media_uri"`
}
BridgePlay is the request type for playing audio on the bridge
type BridgeRecord ¶
type BridgeRecord struct {
// Name is the name for the recording
Name string `json:"name"`
// Options is the list of recording Options
Options *ari.RecordingOptions `json:"options,omitempty"`
}
BridgeRecord is the request for recording a bridge
type BridgeRemoveChannel ¶
type BridgeRemoveChannel struct {
// Channel is the name of the channel to remove
Channel string `json:"channel"`
}
BridgeRemoveChannel is the request for removing a channel on the bridge
type ChannelContinue ¶
type ChannelContinue struct {
// Context is the context into which the channel should be continued
Context string `json:"context"`
// Extension is the extension into which the channel should be continued
Extension string `json:"extension"`
// Priority is the priority at which the channel should be continued
Priority int `json:"priority"`
}
ChannelContinue describes a request to continue an ARI application
type ChannelCreate ¶
type ChannelCreate struct {
// ChannelCreateRequest is the request for creating the channel
ChannelCreateRequest ari.ChannelCreateRequest `json:"channel_create_request"`
}
ChannelCreate describes a request to create a new channel
type ChannelDial ¶
type ChannelDial struct {
// Caller is the channel ID of the "caller" channel; if specified, the media parameters of the dialing channel will be matched to the "caller" channel.
Caller string `json:"caller"`
// Timeout is the maximum time which should be allowed for the dial to complete
Timeout time.Duration `json:"timeout"`
}
ChannelDial describes a request to dial
type ChannelHangup ¶
type ChannelHangup struct {
// Reason is the reason the channel is being hung up
Reason string `json:"reason"`
}
ChannelHangup is the request for hanging up a channel
type ChannelMOH ¶
type ChannelMOH struct {
// Music is the music to play
Music string `json:"music"`
}
ChannelMOH is the request playing hold on music on a channel
type ChannelMute ¶
type ChannelMute struct {
// Direction is the direction to mute
Direction ari.Direction `json:"direction,omitempty"`
}
ChannelMute is the request for muting or unmuting a channel
type ChannelOriginate ¶
type ChannelOriginate struct {
// OriginateRequest contains the information for originating a channel
OriginateRequest ari.OriginateRequest `json:"originate_request"`
}
ChannelOriginate is the request for creating a channel
type ChannelPlay ¶
type ChannelPlay struct {
// PlaybackID is the unique identifier for this playback
PlaybackID string `json:"playback_id"`
// MediaURI is the URI from which to obtain the playback media
MediaURI string `json:"media_uri"`
}
ChannelPlay is the request for playing audio on a channel
type ChannelRecord ¶
type ChannelRecord struct {
// Name is the name for the recording
Name string `json:"name"`
// Options is the list of recording Options
Options *ari.RecordingOptions `json:"options,omitempty"`
}
ChannelRecord is the request for recording a channel
type ChannelSendDTMF ¶
type ChannelSendDTMF struct {
// DTMF is the series of DTMF inputs to send
DTMF string `json:"dtmf"`
// Options are the DTMF options
Options *ari.DTMFOptions `json:"options,omitempty"`
}
ChannelSendDTMF is the request for sending a DTMF event to a channel
type ChannelSnoop ¶
type ChannelSnoop struct {
// SnoopID is the ID to use for the snoop channel which will be created.
SnoopID string `json:"snoop_id"`
// Options describe the parameters for the snoop session
Options *ari.SnoopOptions `json:"options,omitempty"`
}
ChannelSnoop is the request for snooping on a channel
type ChannelVariable ¶
type ChannelVariable struct {
// Name is the name of the channel variable
Name string `json:"name"`
// Value is the value to set to the channel variable
Value string `json:"value,omitempty"`
}
ChannelVariable is the request type to read or modify a channel variable
type DeviceStateUpdate ¶
type DeviceStateUpdate struct {
// State is the new state of the device to set
State string `json:"state"`
}
DeviceStateUpdate describes the request for updating the device state
type EndpointListByTech ¶
type EndpointListByTech struct {
// Tech is the technology for the endpoint
Tech string `json:"tech"`
}
EndpointListByTech describes the request for listing endpoints by technology
type EntityData ¶
type EntityData struct {
Application *ari.ApplicationData `json:"application,omitempty"`
Asterisk *ari.AsteriskInfo `json:"asterisk,omitempty"`
Bridge *ari.BridgeData `json:"bridge,omitempty"`
Channel *ari.ChannelData `json:"channel,omitempty"`
Config *ari.ConfigData `json:"config,omitempty"`
DeviceState *ari.DeviceStateData `json:"device_state,omitempty"`
Endpoint *ari.EndpointData `json:"endpoint,omitempty"`
LiveRecording *ari.LiveRecordingData `json:"live_recording,omitempty"`
Log *ari.LogData `json:"log,omitempty"`
Mailbox *ari.MailboxData `json:"mailbox,omitempty"`
Module *ari.ModuleData `json:"module,omitempty"`
Playback *ari.PlaybackData `json:"playback,omitempty"`
Sound *ari.SoundData `json:"sound,omitempty"`
StoredRecording *ari.StoredRecordingData `json:"stored_recording,omitempty"`
TextMessage *ari.TextMessageData `json:"text_message,omitempty"`
Variable string `json:"variable,omitempty"`
}
EntityData is a response which returns the data for a specific entity.
type MailboxUpdate ¶
type MailboxUpdate struct {
// New is the number of New (unread) messages in the mailbox
New int `json:"new"`
// Old is the number of Old (read) messages in the mailbox
Old int `json:"old"`
}
MailboxUpdate describes the request for updating a mailbox
type PlaybackControl ¶
type PlaybackControl struct {
// Command is the playback control command to run
Command string `json:"command"`
}
PlaybackControl describes the request for performing a playback command
type RecordingStoredCopy ¶
type RecordingStoredCopy struct {
// Destination is the destination location to copy to
Destination string `json:"destination"`
}
RecordingStoredCopy describes the request for copying a stored recording
type Request ¶
type Request struct {
// Kind indicates the type of request
Kind string `json:"kind"`
// Key is the key or key filter on which this request should be processed
Key *ari.Key `json:"key"`
ApplicationSubscribe *ApplicationSubscribe `json:"application_subscribe,omitempty"`
AsteriskConfig *AsteriskConfig `json:"asterisk_config,omitempty"`
AsteriskLoggingChannel *AsteriskLoggingChannel `json:"asterisk_logging_channel,omitempty"`
AsteriskVariableSet *AsteriskVariableSet `json:"asterisk_variable_set,omitempty"`
BridgeAddChannel *BridgeAddChannel `json:"bridge_add_channel,omitempty"`
BridgeCreate *BridgeCreate `json:"bridge_create,omitempty"`
BridgeMOH *BridgeMOH `json:"bridge_moh,omitempty"`
BridgePlay *BridgePlay `json:"bridge_play,omitempty"`
BridgeRecord *BridgeRecord `json:"bridge_record,omitempty"`
BridgeRemoveChannel *BridgeRemoveChannel `json:"bridge_remove_channel,omitempty"`
ChannelCreate *ChannelCreate `json:"channel_create,omitempty"`
ChannelContinue *ChannelContinue `json:"channel_continue,omitempty"`
ChannelDial *ChannelDial `json:"channel_dial,omitempty"`
ChannelHangup *ChannelHangup `json:"channel_hangup,omitempty"`
ChannelMOH *ChannelMOH `json:"channel_moh,omitempty"`
ChannelMute *ChannelMute `json:"channel_mute,omitempty"`
ChannelOriginate *ChannelOriginate `json:"channel_originate,omitempty"`
ChannelPlay *ChannelPlay `json:"channel_play,omitempty"`
ChannelRecord *ChannelRecord `json:"channel_record,omitempty"`
ChannelSendDTMF *ChannelSendDTMF `json:"channel_send_dtmf,omitempty"`
ChannelSnoop *ChannelSnoop `json:"channel_snoop,omitempty"`
ChannelVariable *ChannelVariable `json:"channel_variable,omitempty"`
DeviceStateUpdate *DeviceStateUpdate `json:"device_state_update,omitempty"`
EndpointListByTech *EndpointListByTech `json:"endpoint_list_by_tech,omitempty"`
MailboxUpdate *MailboxUpdate `json:"mailbox_update,omitempty"`
PlaybackControl *PlaybackControl `json:"playback_control,omitempty"`
RecordingStoredCopy *RecordingStoredCopy `json:"recording_stored_copy,omitempty"`
SoundList *SoundList `json:"sound_list,omitempty"`
}
Request describes a request which is sent from an ARI proxy Client to an ARI proxy Server
type Response ¶
type Response struct {
// Error is the error encountered
Error string `json:"error"`
// Data is the returned entity data, if applicable
Data *EntityData `json:"data,omitempty"`
// Key is the key of the returned entity, if applicable
Key *ari.Key `json:"key,omitempty"`
// Keys is the list of keys of any matching entities, if applicable
Keys []*ari.Key `json:"keys,omitempty"`
}
Response is a response to a request. This acts as a base type for more complicated responses, as well.
func NewErrorResponse ¶
NewErrorResponse wraps an error as an ErrorResponse
func (*Response) Err ¶
Err returns an error from the Response. If the response's Error is empty, a nil error is returned. Otherwise, the error will be filled with the value of response.Error.
func (*Response) IsNotFound ¶
IsNotFound indicates that the retuned error response was a Not Found error response