nexmo

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2019 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseURL = `https://api.nexmo.com/v1/calls`

BaseURL for Nexmo calls, public so our main IVR test can change it

View Source
var IgnoreSignatures = false

IgnoreSignatures sets whether we ignore signatures (for unit tests)

Functions

func NewClientFromChannel

func NewClientFromChannel(channel *models.Channel) (ivr.Client, error)

NewClientFromChannel creates a new Twilio IVR client for the passed in account and and auth token

Types

type CallRequest

type CallRequest struct {
	To           []Phone  `json:"to"`
	From         Phone    `json:"from"`
	AnswerURL    []string `json:"answer_url"`
	AnswerMethod string   `json:"answer_method"`
	EventURL     []string `json:"event_url"`
	EventMethod  string   `json:"event_method"`
}

type CallResponse

type CallResponse struct {
	UUID             string `json:"uuid"`
	Status           string `json:"status"`
	Direction        string `json:"direction"`
	ConversationUUID string `json:"conversation_uuid"`
}

CallResponse is our struct for a Nexmo call response

{
 "uuid": "63f61863-4a51-4f6b-86e1-46edebcf9356",
 "status": "started",
 "direction": "outbound",
 "conversation_uuid": "CON-f972836a-550f-45fa-956c-12a2ab5b7d22"
}

type Hangup

type Hangup struct {
	XMLName string `xml:"Hangup"`
}

type Input

type Input struct {
	Action       string   `json:"action"`
	MaxDigits    int      `json:"maxDigits,omitempty"`
	SubmitOnHash bool     `json:"submitOnHash"`
	Timeout      int      `json:"timeOut"`
	EventURL     []string `json:"eventUrl"`
	EventMethod  string   `json:"eventMethod"`
}

type NCCOInput

type NCCOInput struct {
	DTMF             string `json:"dtmf"`
	TimedOut         bool   `json:"timed_out"`
	UUID             string `json:"uuid"`
	ConversationUUID string `json:"conversation_uuid"`
	Timestamp        string `json:"timestamp"`
}

type Phone

type Phone struct {
	Type   string `json:"type"`
	Number int    `json:"number"`
}

type Record

type Record struct {
	Action       string   `json:"action"`
	EndOnKey     string   `json:"endOnKey,omitempty"`
	Timeout      int      `json:"timeOut,omitempty"`
	EndOnSilence int      `json:"endOnSilence,omitempty"`
	EventURL     []string `json:"eventUrl"`
	EventMethod  string   `json:"eventMethod"`
}

type Redirect

type Redirect struct {
	XMLName string `xml:"Redirect"`
	URL     string `xml:",chardata"`
}

type StatusRequest

type StatusRequest struct {
	UUID     string `json:"uuid"`
	Status   string `json:"status"`
	Duration string `json:"duration"`
}

type Stream

type Stream struct {
	Action    string   `json:"action"`
	StreamURL []string `json:"streamUrl"`
}

type Talk

type Talk struct {
	Action  string `json:"action"`
	Text    string `json:"text"`
	BargeIn bool   `json:"bargeIn,omitempty"`
	Error   string `json:"_error,omitempty"`
	Message string `json:"_message,omitempty"`
}

Jump to

Keyboard shortcuts

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