ari

package
v0.0.0-...-dd2ac4b Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

README

go-ari-library

A library for building an Asterisk REST Interface proxy and client using a message bus backend for delivery of messages, written in the Go programming language.

This library abstracts the message bus from the application by providing an interface for setting up channels to consume Events and Commands in a bus agnostic way.

Installation

$ go import https://github.com/nvisibleinc/go-ari-library

Usage

import (
	"https://github.com/nvisibleinc/go-ari-library"
)

For a useful example of usage of this library, see the go-ari-proxy and ari-voicemail projects.

Licensing

Copyright 2015 N-Visible Technology Lab, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBus

func InitBus(busType string, config interface{}) error

InitBus will initialize a new message bus. Abstracts the message bus initialization based on the configuration in order to allow the creation of a proxy or client using message bus agnostic methods.

func InitConsumer

func InitConsumer(topic string) chan []byte

InitConsumer initializes a new message bus consumer.

func InitLogger

func InitLogger(handle io.Writer, prefix string) *log.Logger

InitLogger is a wrapper function to provide a sane interface to logging messages.

func InitProducer

func InitProducer(topic string) chan []byte

InitProducer initializes a new message bus producer.

func TopicExists

func TopicExists(topic string) <-chan bool

TopicExists abstracts the basic function provided by the MessageBus interface. Spawns a goroutine which loops through and waits for a topic to actually exist. Returns a channel immediately which is read by the user of this function to determine topic existence or timeout by way of the normal time.After pattern in a select{}.

func UUID

func UUID() string

UUID generates and returns a universally unique identifier. TODO(Brad): Replace this with an imported package.

Types

type App

type App struct {
	Events chan []byte
	Stop   chan bool
	// contains filtered or unexported fields
}

App struct contains information about an ARI application. The top level that signals the application instance creation.

func NewApp

func NewApp() *App

NewApp creates a new signalling channel for use by an application.

func (*App) Init

func (a *App) Init(app string, handler AppInstanceHandler)

Init spawns the goroutine that listens for messages on the signalling channel. Creates a new application instance for the client to utilize. Passes the AppInstance to the AppInstanceHandler function.

type AppInstance

type AppInstance struct {
	Events chan *Event
	// contains filtered or unexported fields
}

AppInstance struct contains the channels necessary for communication to/from the various message bus topics and the event channel.

func NewAppInstance

func NewAppInstance() *AppInstance

NewAppInstance function is a constructor to allocate the memory of AppInstance.

func (*AppInstance) ApplicationsGet

func (a *AppInstance) ApplicationsGet(ApplicationName string) (*Application, error)

func (*AppInstance) ApplicationsList

func (a *AppInstance) ApplicationsList() (*[]Application, error)

func (*AppInstance) ApplicationsSubscribe

func (a *AppInstance) ApplicationsSubscribe(ApplicationName string, EventSource string) (*Application, error)

func (*AppInstance) ApplicationsUnsubscribe

func (a *AppInstance) ApplicationsUnsubscribe(ApplicationName string, EventSource string) (*Application, error)

func (*AppInstance) AsteriskGetGlobalVar

func (a *AppInstance) AsteriskGetGlobalVar(Var string) (*Variable, error)

func (*AppInstance) AsteriskGetInfo

func (a *AppInstance) AsteriskGetInfo(options ...string) (*AsteriskInfo, error)

func (*AppInstance) AsteriskSetGlobalVar

func (a *AppInstance) AsteriskSetGlobalVar(Var string, options ...string) error

func (*AppInstance) BridgesAddChannel

func (a *AppInstance) BridgesAddChannel(BridgeID string, Channel string, options ...string) error

func (*AppInstance) BridgesCreate

func (a *AppInstance) BridgesCreate(options ...string) (*Bridge, error)

func (*AppInstance) BridgesCreate_Or_Update_With_ID

func (a *AppInstance) BridgesCreate_Or_Update_With_ID(BridgeID string, options ...string) (*Bridge, error)

func (*AppInstance) BridgesDestroy

func (a *AppInstance) BridgesDestroy(BridgeID string) error

func (*AppInstance) BridgesGet

func (a *AppInstance) BridgesGet(BridgeID string) (*Bridge, error)

func (*AppInstance) BridgesList

func (a *AppInstance) BridgesList() (*[]Bridge, error)

func (*AppInstance) BridgesPlay

func (a *AppInstance) BridgesPlay(BridgeID string, Media string, options ...string) (*Playback, error)

func (*AppInstance) BridgesPlayWithID

func (a *AppInstance) BridgesPlayWithID(BridgeID string, PlaybackID string, Media string, options ...string) (*Playback, error)

func (*AppInstance) BridgesRecord

func (a *AppInstance) BridgesRecord(BridgeID string, Name string, Format string, options ...string) (*LiveRecording, error)

func (*AppInstance) BridgesRemoveChannel

func (a *AppInstance) BridgesRemoveChannel(BridgeID string, Channel string) error

func (*AppInstance) BridgesStartMoh

func (a *AppInstance) BridgesStartMoh(BridgeID string, options ...string) error

func (*AppInstance) BridgesStopMoh

func (a *AppInstance) BridgesStopMoh(BridgeID string) error

func (*AppInstance) ChannelsAnswer

func (a *AppInstance) ChannelsAnswer(ChannelID string) error

func (*AppInstance) ChannelsContinueInDialplan

func (a *AppInstance) ChannelsContinueInDialplan(ChannelID string, options ...string) error

func (*AppInstance) ChannelsGet

func (a *AppInstance) ChannelsGet(ChannelID string) (*Channel, error)

func (*AppInstance) ChannelsGetChannelVar

func (a *AppInstance) ChannelsGetChannelVar(ChannelID string, Var string) (*Variable, error)

func (*AppInstance) ChannelsHangup

func (a *AppInstance) ChannelsHangup(ChannelID string, options ...string) error

func (*AppInstance) ChannelsHold

func (a *AppInstance) ChannelsHold(ChannelID string) error

func (*AppInstance) ChannelsList

func (a *AppInstance) ChannelsList() (*[]Channel, error)

func (*AppInstance) ChannelsMute

func (a *AppInstance) ChannelsMute(ChannelID string, options ...string) error

func (*AppInstance) ChannelsOriginate

func (a *AppInstance) ChannelsOriginate(Endpoint string, options ...string) (*Channel, error)

func (*AppInstance) ChannelsOriginateWithID

func (a *AppInstance) ChannelsOriginateWithID(ChannelID string, Endpoint string, options ...string) (*Channel, error)

func (*AppInstance) ChannelsPlay

func (a *AppInstance) ChannelsPlay(ChannelID string, Media string, options ...string) (*Playback, error)

func (*AppInstance) ChannelsPlayWithID

func (a *AppInstance) ChannelsPlayWithID(ChannelID string, PlaybackID string, Media string, options ...string) (*Playback, error)

func (*AppInstance) ChannelsRecord

func (a *AppInstance) ChannelsRecord(ChannelID string, Name string, Format string, options ...string) (*LiveRecording, error)

func (*AppInstance) ChannelsRing

func (a *AppInstance) ChannelsRing(ChannelID string) error

func (*AppInstance) ChannelsRingStop

func (a *AppInstance) ChannelsRingStop(ChannelID string) error

func (*AppInstance) ChannelsSendDTMF

func (a *AppInstance) ChannelsSendDTMF(ChannelID string, options ...string) error

func (*AppInstance) ChannelsSetChannelVar

func (a *AppInstance) ChannelsSetChannelVar(ChannelID string, Var string, options ...string) error

func (*AppInstance) ChannelsSnoopChannel

func (a *AppInstance) ChannelsSnoopChannel(ChannelID string, App string, options ...string) (*Channel, error)

func (*AppInstance) ChannelsSnoopChannelWithID

func (a *AppInstance) ChannelsSnoopChannelWithID(ChannelID string, SnoopID string, App string, options ...string) (*Channel, error)

func (*AppInstance) ChannelsStartMoh

func (a *AppInstance) ChannelsStartMoh(ChannelID string, options ...string) error

func (*AppInstance) ChannelsStartSilence

func (a *AppInstance) ChannelsStartSilence(ChannelID string) error

func (*AppInstance) ChannelsStopMoh

func (a *AppInstance) ChannelsStopMoh(ChannelID string) error

func (*AppInstance) ChannelsStopSilence

func (a *AppInstance) ChannelsStopSilence(ChannelID string) error

func (*AppInstance) ChannelsUnhold

func (a *AppInstance) ChannelsUnhold(ChannelID string) error

func (*AppInstance) ChannelsUnmute

func (a *AppInstance) ChannelsUnmute(ChannelID string, options ...string) error

func (*AppInstance) DeviceStatesDelete

func (a *AppInstance) DeviceStatesDelete(DeviceName string) error

func (*AppInstance) DeviceStatesGet

func (a *AppInstance) DeviceStatesGet(DeviceName string) (*DeviceState, error)

func (*AppInstance) DeviceStatesList

func (a *AppInstance) DeviceStatesList() (*[]DeviceState, error)

func (*AppInstance) DeviceStatesUpdate

func (a *AppInstance) DeviceStatesUpdate(DeviceName string, DeviceState string) error

func (*AppInstance) EndpointsGet

func (a *AppInstance) EndpointsGet(Tech string, Resource string) (*Endpoint, error)

func (*AppInstance) EndpointsList

func (a *AppInstance) EndpointsList() (*[]Endpoint, error)

func (*AppInstance) EndpointsListByTech

func (a *AppInstance) EndpointsListByTech(Tech string) (*[]Endpoint, error)

func (*AppInstance) EndpointsSendMessage

func (a *AppInstance) EndpointsSendMessage(To string, From string, options ...string) error

func (*AppInstance) EndpointsSendMessageToEndpoint

func (a *AppInstance) EndpointsSendMessageToEndpoint(Tech string, Resource string, From string, options ...string) error

func (*AppInstance) EventsEventWebsocket

func (a *AppInstance) EventsEventWebsocket(App string) (*Message, error)

func (*AppInstance) EventsUserEvent

func (a *AppInstance) EventsUserEvent(EventName string, Application string, options ...string) error

func (*AppInstance) InitAppInstance

func (a *AppInstance) InitAppInstance(instanceID string)

InitAppInstance initializes the set of resources necessary for a new application instance.

func (*AppInstance) MailboxesDelete

func (a *AppInstance) MailboxesDelete(MailboxName string) error

func (*AppInstance) MailboxesGet

func (a *AppInstance) MailboxesGet(MailboxName string) (*Mailbox, error)

func (*AppInstance) MailboxesList

func (a *AppInstance) MailboxesList() (*[]Mailbox, error)

func (*AppInstance) MailboxesUpdate

func (a *AppInstance) MailboxesUpdate(MailboxName string, OldMessages int, NewMessages int) error

func (*AppInstance) PlaybacksControl

func (a *AppInstance) PlaybacksControl(PlaybackID string, Operation string) error

func (*AppInstance) PlaybacksGet

func (a *AppInstance) PlaybacksGet(PlaybackID string) (*Playback, error)

func (*AppInstance) PlaybacksStop

func (a *AppInstance) PlaybacksStop(PlaybackID string) error

func (*AppInstance) RecordingsCancel

func (a *AppInstance) RecordingsCancel(RecordingName string) error

func (*AppInstance) RecordingsCopyStored

func (a *AppInstance) RecordingsCopyStored(RecordingName string, DestinationRecordingName string) (*StoredRecording, error)

func (*AppInstance) RecordingsDeleteStored

func (a *AppInstance) RecordingsDeleteStored(RecordingName string) error

func (*AppInstance) RecordingsGetLive

func (a *AppInstance) RecordingsGetLive(RecordingName string) (*LiveRecording, error)

func (*AppInstance) RecordingsGetStored

func (a *AppInstance) RecordingsGetStored(RecordingName string) (*StoredRecording, error)

func (*AppInstance) RecordingsListStored

func (a *AppInstance) RecordingsListStored() (*[]StoredRecording, error)

func (*AppInstance) RecordingsMute

func (a *AppInstance) RecordingsMute(RecordingName string) error

func (*AppInstance) RecordingsPause

func (a *AppInstance) RecordingsPause(RecordingName string) error

func (*AppInstance) RecordingsStop

func (a *AppInstance) RecordingsStop(RecordingName string) error

func (*AppInstance) RecordingsUnmute

func (a *AppInstance) RecordingsUnmute(RecordingName string) error

func (*AppInstance) RecordingsUnpause

func (a *AppInstance) RecordingsUnpause(RecordingName string) error

func (*AppInstance) SoundsGet

func (a *AppInstance) SoundsGet(SoundID string) (*Sound, error)

func (*AppInstance) SoundsList

func (a *AppInstance) SoundsList(options ...string) (*[]Sound, error)

type AppInstanceHandler

type AppInstanceHandler func(*AppInstance)

AppInstanceHandler when you start a new App, you pass in a function of type AppInstanceHandler. The entry point of the execution of an application instance.

type AppStart

type AppStart struct {
	Application string `json:"application"`
	DialogID    string `json:"dialog_id"`
	ServerID    string `json:"server_id"`
}

AppStart struct contains the initial information for the start of a new application instance.

type Application

type Application struct {
	Name         string   `json:"name"`
	Channel_IDs  []string `json:"channel_ids"`
	Bridge_IDs   []string `json:"bridge_ids"`
	Endpoint_IDs []string `json:"endpoint_ids"`
	Device_Names []string `json:"device_names"`
}

type ApplicationReplaced

type ApplicationReplaced struct {
	Application string `json:"application"`
	Timestamp   string `json:"timestamp"`
	Type        string `json:"type"`
}

type AsteriskInfo

type AsteriskInfo struct {
	Build  BuildInfo  `json:"build"`
	System SystemInfo `json:"system"`
	Config ConfigInfo `json:"config"`
	Status StatusInfo `json:"status"`
}

type Bridge

type Bridge struct {
	Id           string   `json:"id"`
	Technology   string   `json:"technology"`
	Bridge_Type  string   `json:"bridge_type"`
	Bridge_Class string   `json:"bridge_class"`
	Creator      string   `json:"creator"`
	Name         string   `json:"name"`
	Channels     []string `json:"channels"`
}

type BridgeAttendedTransfer

type BridgeAttendedTransfer struct {
	Result                       string  `json:"result"`
	Transferer_First_Leg         Channel `json:"transferer_first_leg"`
	Transferer_Second_Leg        Channel `json:"transferer_second_leg"`
	Replace_Channel              Channel `json:"replace_channel"`
	Is_External                  bool    `json:"is_external"`
	Transferer_First_Leg_Bridge  Bridge  `json:"transferer_first_leg_bridge"`
	Transferer_Second_Leg_Bridge Bridge  `json:"transferer_second_leg_bridge"`
	Destination_Bridge           string  `json:"destination_bridge"`
	Destination_Link_Second_Leg  Channel `json:"destination_link_second_leg"`
	Destination_Threeway_Channel Channel `json:"destination_threeway_channel"`
	Destination_Threeway_Bridge  Bridge  `json:"destination_threeway_bridge"`
	Transferee                   Channel `json:"transferee"`
	Transfer_Target              Channel `json:"transfer_target"`
	Destination_Type             string  `json:"destination_type"`
	Destination_Application      string  `json:"destination_application"`
	Destination_Link_First_Leg   Channel `json:"destination_link_first_leg"`
	Application                  string  `json:"application"`
	Timestamp                    string  `json:"timestamp"`
	Type                         string  `json:"type"`
}

type BridgeBlindTransfer

type BridgeBlindTransfer struct {
	Channel         Channel `json:"channel"`
	Replace_Channel Channel `json:"replace_channel"`
	Transferee      Channel `json:"transferee"`
	Exten           string  `json:"exten"`
	Context         string  `json:"context"`
	Result          string  `json:"result"`
	Is_External     bool    `json:"is_external"`
	Bridge          Bridge  `json:"bridge"`
	Application     string  `json:"application"`
	Timestamp       string  `json:"timestamp"`
	Type            string  `json:"type"`
}

type BridgeCreated

type BridgeCreated struct {
	Bridge      Bridge `json:"bridge"`
	Application string `json:"application"`
	Timestamp   string `json:"timestamp"`
	Type        string `json:"type"`
}

type BridgeDestroyed

type BridgeDestroyed struct {
	Bridge      Bridge `json:"bridge"`
	Application string `json:"application"`
	Timestamp   string `json:"timestamp"`
	Type        string `json:"type"`
}

type BridgeMerged

type BridgeMerged struct {
	Bridge      Bridge `json:"bridge"`
	Bridge_From Bridge `json:"bridge_from"`
	Application string `json:"application"`
	Timestamp   string `json:"timestamp"`
	Type        string `json:"type"`
}

type BuildInfo

type BuildInfo struct {
	Os      string `json:"os"`
	Kernel  string `json:"kernel"`
	Options string `json:"options"`
	Machine string `json:"machine"`
	Date    string `json:"date"`
	User    string `json:"user"`
}

type CallerID

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

type Channel

type Channel struct {
	Id           string      `json:"id"`
	Name         string      `json:"name"`
	State        string      `json:"state"`
	Caller       CallerID    `json:"caller"`
	Connected    CallerID    `json:"connected"`
	Accountcode  string      `json:"accountcode"`
	Dialplan     DialplanCEP `json:"dialplan"`
	Creationtime string      `json:"creationtime"`
}

type ChannelCallerId

type ChannelCallerId struct {
	Caller_Presentation     int     `json:"caller_presentation"`
	Caller_Presentation_Txt string  `json:"caller_presentation_txt"`
	Channel                 Channel `json:"channel"`
	Application             string  `json:"application"`
	Timestamp               string  `json:"timestamp"`
	Type                    string  `json:"type"`
}

type ChannelCreated

type ChannelCreated struct {
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelDestroyed

type ChannelDestroyed struct {
	Cause       int     `json:"cause"`
	Cause_Txt   string  `json:"cause_txt"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelDialplan

type ChannelDialplan struct {
	Channel           Channel `json:"channel"`
	Dialplan_App      string  `json:"dialplan_app"`
	Dialplan_App_Data string  `json:"dialplan_app_data"`
	Application       string  `json:"application"`
	Timestamp         string  `json:"timestamp"`
	Type              string  `json:"type"`
}

type ChannelDtmfReceived

type ChannelDtmfReceived struct {
	Digit       string  `json:"digit"`
	Duration_Ms int     `json:"duration_ms"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelEnteredBridge

type ChannelEnteredBridge struct {
	Bridge      Bridge  `json:"bridge"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelHangupRequest

type ChannelHangupRequest struct {
	Cause       int     `json:"cause"`
	Soft        bool    `json:"soft"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelLeftBridge

type ChannelLeftBridge struct {
	Bridge      Bridge  `json:"bridge"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelStateChange

type ChannelStateChange struct {
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelTalkingFinished

type ChannelTalkingFinished struct {
	Channel     Channel `json:"channel"`
	Duration    int     `json:"duration"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelTalkingStarted

type ChannelTalkingStarted struct {
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type ChannelUserevent

type ChannelUserevent struct {
	Eventname   string   `json:"eventname"`
	Channel     Channel  `json:"channel"`
	Bridge      Bridge   `json:"bridge"`
	Endpoint    Endpoint `json:"endpoint"`
	Userevent   string   `json:"userevent"`
	Application string   `json:"application"`
	Timestamp   string   `json:"timestamp"`
	Type        string   `json:"type"`
}

type ChannelVarset

type ChannelVarset struct {
	Variable    string  `json:"variable"`
	Value       string  `json:"value"`
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type Command

type Command struct {
	UniqueID string `json:"unique_id"`
	URL      string `json:"url"`
	Method   string `json:"method"`
	Body     string `json:"body"`
}

Command struct contains the command we're passing back to ARI.

type CommandResponse

type CommandResponse struct {
	UniqueID     string `json:"unique_id"`
	StatusCode   int    `json:"status_code"`
	ResponseBody string `json:"response_body"`
}

CommandResponse struct contains the response to a Command

type ConfigInfo

type ConfigInfo struct {
	Name             string  `json:"name"`
	Default_Language string  `json:"default_language"`
	Max_Channels     int     `json:"max_channels"`
	Max_Open_Files   int     `json:"max_open_files"`
	Max_Load         float64 `json:"max_load"`
	Setid            SetId   `json:"setid"`
}

type DeviceState

type DeviceState struct {
	Name  string `json:"name"`
	State string `json:"state"`
}

type DeviceStateChanged

type DeviceStateChanged struct {
	Device_State DeviceState `json:"device_state"`
	Application  string      `json:"application"`
	Timestamp    string      `json:"timestamp"`
	Type         string      `json:"type"`
}

type Dial

type Dial struct {
	Caller      Channel `json:"caller"`
	Peer        Channel `json:"peer"`
	Forward     string  `json:"forward"`
	Forwarded   Channel `json:"forwarded"`
	Dialstring  string  `json:"dialstring"`
	Dialstatus  string  `json:"dialstatus"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type Dialed

type Dialed struct {
}

type DialplanCEP

type DialplanCEP struct {
	Context  string `json:"context"`
	Exten    string `json:"exten"`
	Priority uint64 `json:"priority"`
}

type Endpoint

type Endpoint struct {
	Technology  string   `json:"technology"`
	Resource    string   `json:"resource"`
	State       string   `json:"state"`
	Channel_IDs []string `json:"channel_ids"`
}

type EndpointStateChange

type EndpointStateChange struct {
	Endpoint    Endpoint `json:"endpoint"`
	Application string   `json:"application"`
	Timestamp   string   `json:"timestamp"`
	Type        string   `json:"type"`
}

type Event

type Event struct {
	ServerID  string    `json:"server_id"`
	Timestamp time.Time `json:"timestamp"`
	Type      string    `json:"type"`
	ARI_Body  string    `json:"ari_body"`
}

Event struct contains the events we pull off the websocket connection.

type FormatLangPair

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

type LiveRecording

type LiveRecording struct {
	Name             string `json:"name"`
	Format           string `json:"format"`
	Target_Uri       string `json:"target_uri"`
	State            string `json:"state"`
	Duration         int    `json:"duration"`
	Talking_Duration int    `json:"talking_duration"`
	Silence_Duration int    `json:"silence_duration"`
	Cause            string `json:"cause"`
}

type Mailbox

type Mailbox struct {
	Name         string `json:"name"`
	Old_Messages int    `json:"old_messages"`
	New_Messages int    `json:"new_messages"`
}

type Message

type Message struct {
	Type string `json:"type"`
}

type MessageBus

type MessageBus interface {
	InitBus(config interface{}) error
	StartProducer(topic string) (chan []byte, error)
	StartConsumer(topic string) (chan []byte, error)
	TopicExists(topic string) bool
}

MessageBus interface contains methods for interacting with the abstracted message bus.

type MissingParams

type MissingParams struct {
	Params []string `json:"params"`
	Type   string   `json:"type"`
}

type NATS

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

func (*NATS) InitBus

func (n *NATS) InitBus(config interface{}) error

func (*NATS) StartConsumer

func (n *NATS) StartConsumer(topic string) (chan []byte, error)

func (*NATS) StartProducer

func (n *NATS) StartProducer(topic string) (chan []byte, error)

func (*NATS) TopicExists

func (n *NATS) TopicExists(topic string) bool

type Playback

type Playback struct {
	Id         string `json:"id"`
	Media_Uri  string `json:"media_uri"`
	Target_Uri string `json:"target_uri"`
	Language   string `json:"language"`
	State      string `json:"state"`
}

type PlaybackFinished

type PlaybackFinished struct {
	Playback    Playback `json:"playback"`
	Application string   `json:"application"`
	Timestamp   string   `json:"timestamp"`
	Type        string   `json:"type"`
}

type PlaybackStarted

type PlaybackStarted struct {
	Playback    Playback `json:"playback"`
	Application string   `json:"application"`
	Timestamp   string   `json:"timestamp"`
	Type        string   `json:"type"`
}

type RabbitMQ

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

func (*RabbitMQ) InitBus

func (r *RabbitMQ) InitBus(config interface{}) error

func (*RabbitMQ) StartConsumer

func (r *RabbitMQ) StartConsumer(topic string) (chan []byte, error)

func (*RabbitMQ) StartProducer

func (r *RabbitMQ) StartProducer(topic string) (chan []byte, error)

func (*RabbitMQ) TopicExists

func (r *RabbitMQ) TopicExists(topic string) bool

type RecordingFailed

type RecordingFailed struct {
	Recording   LiveRecording `json:"recording"`
	Application string        `json:"application"`
	Timestamp   string        `json:"timestamp"`
	Type        string        `json:"type"`
}

type RecordingFinished

type RecordingFinished struct {
	Recording   LiveRecording `json:"recording"`
	Application string        `json:"application"`
	Timestamp   string        `json:"timestamp"`
	Type        string        `json:"type"`
}

type RecordingStarted

type RecordingStarted struct {
	Recording   LiveRecording `json:"recording"`
	Application string        `json:"application"`
	Timestamp   string        `json:"timestamp"`
	Type        string        `json:"type"`
}

type SetId

type SetId struct {
	User  string `json:"user"`
	Group string `json:"group"`
}

type Sound

type Sound struct {
	Id      string           `json:"id"`
	Text    string           `json:"text"`
	Formats []FormatLangPair `json:"formats"`
}

type StasisEnd

type StasisEnd struct {
	Channel     Channel `json:"channel"`
	Application string  `json:"application"`
	Timestamp   string  `json:"timestamp"`
	Type        string  `json:"type"`
}

type StasisStart

type StasisStart struct {
	Args            []string `json:"args"`
	Channel         Channel  `json:"channel"`
	Replace_Channel Channel  `json:"replace_channel"`
	Application     string   `json:"application"`
	Timestamp       string   `json:"timestamp"`
	Type            string   `json:"type"`
}

type StatusInfo

type StatusInfo struct {
	Startup_Time     string `json:"startup_time"`
	Last_Reload_Time string `json:"last_reload_time"`
}

type StoredRecording

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

type SystemInfo

type SystemInfo struct {
	Version   string `json:"version"`
	Entity_ID string `json:"entity_id"`
}

type TextMessage

type TextMessage struct {
	From      string                `json:"from"`
	To        string                `json:"to"`
	Body      string                `json:"body"`
	Variables []TextMessageVariable `json:"variables"`
}

type TextMessageReceived

type TextMessageReceived struct {
	Message     TextMessage `json:"message"`
	Endpoint    Endpoint    `json:"endpoint"`
	Application string      `json:"application"`
	Timestamp   string      `json:"timestamp"`
	Type        string      `json:"type"`
}

type TextMessageVariable

type TextMessageVariable struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Variable

type Variable struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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