requests

package
v0.0.0-...-2ec00d9 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 []arioptions.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"`

	// AbsorbDTMF indicates that DTMF coming from this channel will not be passed through to the bridge
	AbsorbDTMF bool `json:"absorbDTMF,omitempty"`

	// Mute indicates that the channel should be muted, preventing audio from it passing through to the bridge
	Mute bool `json:"mute,omitempty"`

	// Role indicates the channel's role in the bridge
	Role string `json:"role,omitempty"`
}

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 *arioptions.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 BridgeVideoSource

type BridgeVideoSource struct {
	// Channel is the name of the channel to use as the explicit video source
	Channel string `json:"channel"`
}

BridgeVideoSource describes the details of a request to set the video source of a bridge explicitly

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 ChannelCreateRequest `json:"channel_create_request"`
}

ChannelCreate describes a request to create a new channel

type ChannelCreateRequest

type ChannelCreateRequest struct {
	// Endpoint is the target endpoint for the dial
	Endpoint string `json:"endpoint"`

	// App is the name of the Stasis application to execute on connection
	App string `json:"app"`

	// AppArgs is the set of (comma-separated) arguments for the Stasis App
	AppArgs string `json:"appArgs,omitempty"`

	// ChannelID is the ID to give to the newly-created channel
	ChannelID string `json:"channelId,omitempty"`

	// OtherChannelID is the ID of the second created channel (when creating Local channels)
	OtherChannelID string `json:"otherChannelId,omitempty"`

	// Originator is the unique ID of the calling channel, for which this new channel-dial is being created
	Originator string `json:"originator,omitempty"`

	// Formats is the comma-separated list of valid codecs to allow for the new channel, in the case that
	// the Originator is not specified
	Formats string `json:"formats,omitempty"`
}

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 ChannelExternalMedia

type ChannelExternalMedia struct {
	Options arioptions.ExternalMediaOptions `json:"options"`
}

ChannelExternalMedia describes the request for an external media channel

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 arioptions.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 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 *arioptions.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 *arioptions.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 *arioptions.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 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 OriginateRequest

type OriginateRequest struct {

	// Endpoint is the name of the Asterisk resource to be used to create the
	// channel.  The format is tech/resource.
	//
	// Examples:
	//
	//   - PJSIP/george
	//
	//   - Local/party@mycontext
	//
	//   - DAHDI/8005558282
	Endpoint string `json:"endpoint"`

	// Timeout specifies the number of seconds to wait for the channel to be
	// answered before giving up.  Note that this is REQUIRED and the default is
	// to timeout immediately.  Use a negative value to specify no timeout, but
	// be aware that this could result in an unlimited call, which could result
	// in a very unfriendly bill.
	Timeout int `json:"timeout,omitempty"`

	// CallerID specifies the Caller ID (name and number) to be set on the
	// newly-created channel.  This is optional but recommended.  The format is
	// `"Name" <number>`, but most every component is optional.
	//
	// Examples:
	//
	//   - "Jane" <100>
	//
	//   - <102>
	//
	//   - 8005558282
	//
	CallerID string `json:"callerId,omitempty"`

	// CEP (Context/Extension/Priority) is the location in the Asterisk dialplan
	// into which the newly created channel should be dropped.  All of these are
	// required if the CEP is used.  Exactly one of CEP or App/AppArgs must be
	// specified.
	Context   string `json:"context,omitempty"`
	Extension string `json:"extension,omitempty"`
	Priority  int64  `json:"priority,omitempty"`

	// The Label is the string form of Priority, if there is such a label in the
	// dialplan.  Like CEP, Label may not be used if an ARI App is specified.
	// If both Label and Priority are specified, Label will take priority.
	Label string `json:"label,omitempty"`

	// App specifies the ARI application and its arguments into which
	// the newly-created channel should be placed.  Exactly one of CEP or
	// App/AppArgs is required.
	App string `json:"app,omitempty"`

	// AppArgs defines the arguments to supply to the ARI application, if one is
	// defined.  It is optional but only applicable for Originations which
	// specify an ARI App.
	AppArgs string `json:"appArgs,omitempty"`

	// Formats describes the (comma-delimited) set of codecs which should be
	// allowed for the created channel.  This is an optional parameter, and if
	// an Originator is specified, this should be left blank so that Asterisk
	// derives the codecs from that Originator channel instead.
	//
	// Ex. "ulaw,slin16".
	//
	// The list of valid codecs can be found with Asterisk command "core show codecs".
	Formats string `json:"formats,omitempty"`

	// ChannelID specifies the unique ID to be used for the channel to be
	// created.  It is optional, and if not specified, a time-based UUID will be
	// generated.
	ChannelID string `json:"channelId,omitempty"` // Optionally assign channel id

	// OtherChannelID specifies the unique ID of the second channel to be
	// created.  This is only valid for the creation of Local channels, which
	// are always generated in pairs.  It is optional, and if not specified, a
	// time-based UUID will be generated (again, only if the Origination is of a
	// Local channel).
	OtherChannelID string `json:"otherChannelId,omitempty"`

	// Originator is the channel for whom this Originate request is being made, if there is one.
	// It is used by Asterisk to set the right codecs (and possibly other parameters) such that
	// when the new channel is bridged to the Originator channel, there should be no transcoding.
	// This is a purely optional (but helpful, where applicable) field.
	Originator string `json:"originator,omitempty"`

	// Variables describes the set of channel variables to apply to the new channel.  It is optional.
	Variables map[string]string `json:"variables,omitempty"`
}

OriginateRequest defines the parameters for the creation of a new Asterisk channel

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 *key.Key `json:"key"`

	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"`
	BridgeVideoSource   *BridgeVideoSource   `json:"bridge_video_source,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"`
	ChannelExternalMedia *ChannelExternalMedia `json:"channel_external_media,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 SoundList

type SoundList struct {
	// Filters are the filters to apply when listing the sounds
	Filters map[string]string `json:"filters"`
}

SoundList describes the request for listing the sounds

Jump to

Keyboard shortcuts

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