session

package
v2.5.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2019 License: Apache-2.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 AppStart

type AppStart struct {
	ServerID    string   `json:"server"`
	DialogID    string   `json:"dialog"`
	Application string   `json:"application"`
	AppArgs     []string `json:"appargs"`
	ChannelID   string   `json:"channel"` // The channel from the stasis start event
}

AppStart is the event sent on the start of an application and the creation of a server side dialog

type Dialog

type Dialog struct {
	ID        string
	Transport Transport
	Objects   Objects
	ChannelID string // The channel ID from the StasisStart event
}

A Dialog is a session between the ARI proxy client and the ARI proxy server

func NewDialog

func NewDialog(id string, transport Transport) *Dialog

NewDialog creates a new dialog with the given transport

type Message

type Message struct {
	Command string `json:"command"`
	Object  string `json:"object"`
	Payload []byte `json:"payload"`
}

Message is the wrapper for a command sent over a dialog

type Objects

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

Objects tracks a list of object IDs that are associated with the dialog

func (*Objects) Add

func (o *Objects) Add(id string) bool

Add adds the given object

func (*Objects) Clear

func (o *Objects) Clear()

Clear removes all the objects

func (*Objects) Contains

func (o *Objects) Contains(id string) (int, bool)

Contains finds the id, if it exists

func (*Objects) Items added in v1.2.4

func (o *Objects) Items() []string

Items returns the list of items

func (*Objects) Remove

func (o *Objects) Remove(id string) bool

Remove removes the given object, if it exists

type Transport

type Transport interface {

	// Command sends a command and waits for a response
	Command(name string, body interface{}, resp interface{}) error

	// Event dispatches an event
	Event(evt ari.Event) error
}

Transport defines how the commands and events are sent.

Jump to

Keyboard shortcuts

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