ncco

package
v0.0.0-...-32ef62a Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 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 Action

type Action interface {
	// contains filtered or unexported methods
}

Action is an interface to ensure all Actions have a prepare()

type ConnectAction

type ConnectAction struct {
	Action           string     `json:"action"`
	Endpoint         []Endpoint `json:"endpoint"`
	From             string     `json:"from,omitempty"`
	Timeout          int        `json:"timeout,omitempty"`
	Limit            int        `json:"limit,omitempty"`
	MachineDetection string     `json:"machineDetection,omitempty"`
	EventType        string     `json:"eventType,omitempty"`
	EventUrl         []string   `json:"eventUrl,omitempty"`
	EventMethod      string     `json:"eventMethod,omitempty"`
	RingbackTone     string     `json:"ringbackTone,omitempty"`
}

ConnectAction takes an Endpoint (of which there are many) and joins it into the current call

type ConversationAction

type ConversationAction struct {
	Action                      string   `json:"action"`
	Name                        string   `json:"name,omitempty"`
	MusicOnHoldUrl              []string `json:"musicOnHoldUrl,omitempty"`
	StartOnEnter                string   `json:"-"`
	EndOnExit                   bool     `json:"endOnExit,omitempty"`
	Record                      bool     `json:"record,omitempty"`
	CanSpeak                    []string `json:"canSpeak,omitempty"`
	CanHear                     []string `json:"canHear,omitempty"`
	CalculatedStartOnEnterValue bool     `json:"startOnEnter"`
}

ConversationAction sets up a conference that calls can be added to

type DtmfInput

type DtmfInput struct {
	TimeOut      int  `json:"timeOut,omitempty"`
	MaxDigits    int  `json:"maxDigits,omitempty"`
	SubmitOnHash bool `json:"submitOnHash,omitempty"`
}

DtmfInput captures digits pressed on the keypad

type Endpoint

type Endpoint interface {
	// contains filtered or unexported methods
}

Endpoint is a mostly dummy interface to let us typehint on it

type InputAction

type InputAction struct {
	Action      string     `json:"action"`
	Dtmf        *DtmfInput `json:"dtmf,omitempty"`
	EventUrl    []string   `json:"eventUrl,omitempty"`
	EventMethod string     `json:"eventMethod,omitempty"`
}

InputAction uses pointers for the optional dtmf input

type Ncco

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

Ncco is a parent type to hold the actions

func (*Ncco) AddAction

func (n *Ncco) AddAction(action Action)

AddAction to add a next action, in sequence, to the Ncco

func (*Ncco) GetActions

func (n *Ncco) GetActions() []interface{}

GetActions to return the NCCO array, ready to be JSON Marshalled This calls the prepare() actions for any additional transforms needed

func (Ncco) MarshalJSON

func (n Ncco) MarshalJSON() ([]byte, error)

MarshalJSON to return the NCCO array, ready to be JSON Marshalled

type NotifyAction

type NotifyAction struct {
	Action      string            `json:"action"`
	Payload     map[string]string `json:"payload,omitempty"`
	EventUrl    []string          `json:"eventUrl,omitempty"`
	EventMethod string            `json:"eventMethod,omitempty"`
}

NotifyAction to represent a Notify Action

type PhoneEndpoint

type PhoneEndpoint struct {
	Type       string `json:"type"`
	Number     string `json:"number"`
	DtmfAnswer string `json:"dtmfAnswer,omitempty"`
	OnAnswer   string `json:"onAnswer,omitempty"`
}

type RecordAction

type RecordAction struct {
	Action       string   `json:"action"`
	Format       string   `json:"format,omitempty"`
	Split        string   `json:"split,omitempty"`
	Channels     int      `json:"channels,omitempty"`
	EndOnSilence int      `json:"endOnSilence,omitempty"`
	EndOnKey     string   `json:"endOnKey,omitempty"`
	TimeOut      int      `json:"timeOut,omitempty"`
	BeepStart    bool     `json:"beepStart,omitempty"`
	EventUrl     []string `json:"eventUrl,omitempty"`
	EventMethod  string   `json:"eventMethod,omitempty"`
}

RecordAction to start a recording at this point in the call

type StreamAction

type StreamAction struct {
	Action              string   `json:"action"`
	StreamUrl           []string `json:"streamUrl,omitempty"`
	Level               int      `json:"level,omitempty"`
	Loop                string   `json:"-"`
	BargeIn             bool     `json:"bargeIn"`
	CalculatedLoopValue int      `json:"loop"`
}

StreamAction plays audio stream from URL. Beware that the "Loop" field is a string here, and the CalculatedLoopValue is used to assemble the correct value when sending

type TalkAction

type TalkAction struct {
	Action              string `json:"action"`
	Text                string `json:"text"`
	Loop                string `json:"-"`
	BargeIn             bool   `json:"bargeIn"`
	Level               int    `json:"level,omitempty"`
	VoiceName           string `json:"voiceName,omitempty"`
	CalculatedLoopValue int    `json:"loop"`
}

TalkAction is a text-to-speech feature. Beware that the "Loop" field is a string here, and the CalculatedLoopValue is used to assemble the correct value when sending

Jump to

Keyboard shortcuts

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