signalwire

package module
v0.0.0-...-a9d4530 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MIT Imports: 23 Imported by: 17

Documentation

Overview

Package signalwire is a generated GoMock package.

Package signalwire is a generated GoMock package.

Package signalwire is a generated GoMock package.

Package signalwire is a generated GoMock package.

Package signalwire is a generated GoMock package.

Index

Constants

View Source
const (
	// CacheExpiry Default object expiry
	CacheExpiry = 3600 * 24 /*seconds*/
	// CacheCleaning Cleaning interval for expired cached objects
	CacheCleaning = 10 /*seconds*/
)
View Source
const (
	WSTimeOut              = 5
	JSONRPCVer             = "2.0"
	WssHost                = "relay.signalwire.com"
	SDKVersion             = "1.0.1"
	BladeVersionMajor      = 2
	BladeVersionMinor      = 3
	BladeRevision          = 0
	MaxSimCalls            = 100
	MaxPlay                = 10
	TaskingEndpoint        = "https://relay.signalwire.com/api/relay/rest/tasks"
	UserAgent              = "Go SDK"
	BladeConnectionRetries = -1 // how many times to retry to connect before giving up . -1 keeps trying forever.
	/* internal */
	BroadcastEventTimeout   = 10 /* seconds */
	DefaultRingTimeout      = 30 /* seconds */
	SimActionsOfTheSameKind = 10 /* Buffered Channels - how many simultaneous actions of the same kind we can start */
	EventQueue              = 10 /* Buffered Channels - max unprocessed events per action */
	DefaultActionTimeout    = 30
	HTTPClientTimeout       = 60 /* seconds */
	MaxCallDuration         = 3600 * 4
)

SDK consts

View Source
const (
	Finished   = "finished"
	InboundStr = "inbound"
)

the 'finished' keyword

View Source
const (
	PanicLevelLog int = iota + 1
	FatalLevelLog
	ErrorLevelLog
	WarnLevelLog
	InfoLevelLog
	DebugLevelLog
	TraceLevelLog
)

Available log levels

View Source
const (
	StrError = "error"
)

generic name for error event

Variables

View Source
var GlobalBladeSessionControl = NewBladeSessionControl()

GlobalBladeSessionControl - needs Refactor

View Source
var GlobalConnectTimeout time.Duration
View Source
var GlobalOverwriteHost string

GlobalOverwriteHost TODO DESCRIPTION

Functions

func GenUUIDv4

func GenUUIDv4() (string, error)

GenUUIDv4 generates UUIDv4 (random), see: https://en.wikipedia.org/wiki/Universally_unique_identifier

func GetEvent

func GetEvent(action *ConnectAction) *json.RawMessage

GetEvent TODO DESCRIPTION

Types

type Actions

type Actions struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Actions TODO DESCRIPTION

type AudioStruct

type AudioStruct struct {
	Format    string `json:"format,omitempty"`
	Direction string `json:"direction,omitempty"`
	Stereo    bool   `json:"stereo,omitempty"`
}

AudioStruct TODO DESCRIPTION

type AuthStruct

type AuthStruct struct {
	Project string `json:"project"`
	Token   string `json:"token"`
}

AuthStruct TODO DESCRIPTION

type BCache

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

BCache TODO DESCRIPTION

func (*BCache) DeleteCallCache

func (cache *BCache) DeleteCallCache(callID string) error

DeleteCallCache TODO DESCRIPTION

func (*BCache) DeleteMsgCache

func (cache *BCache) DeleteMsgCache(msgID string) error

DeleteMsgCache TODO DESCRIPTION

func (*BCache) GetCallCache

func (cache *BCache) GetCallCache(callID string) (*CallSession, error)

GetCallCache TODO DESCRIPTION

func (*BCache) GetMsgCache

func (cache *BCache) GetMsgCache(msgID string) (*MsgSession, error)

GetMsgCache TODO DESCRIPTION

func (*BCache) GetTasking

func (cache *BCache) GetTasking(id string) (*Tasking, error)

GetTasking TODO DESCRIPTION

func (*BCache) InitCache

func (cache *BCache) InitCache(expiry, clean time.Duration) error

InitCache TODO DESCRIPTION

func (*BCache) SetCallCache

func (cache *BCache) SetCallCache(callID string, sess *CallSession) error

SetCallCache TODO DESCRIPTION

func (*BCache) SetMsgCache

func (cache *BCache) SetMsgCache(msgID string, sess *MsgSession) error

SetMsgCache TODO DESCRIPTION

func (*BCache) SetTasking

func (cache *BCache) SetTasking(id string, t *Tasking) error

SetTasking TODO DESCRIPTION

type BasicLogger

type BasicLogger struct {
	TraceLevel *log.Logger
	DebugLevel *log.Logger
	InfoLevel  *log.Logger
	WarnLevel  *log.Logger
	ErrorLevel *log.Logger
	FatalLevel *log.Logger
	PanicLevel *log.Logger
}

BasicLogger is a package level logger

func CreateNewBasicLogger

func CreateNewBasicLogger() *BasicLogger

CreateNewBasicLogger creates new logger

func (*BasicLogger) Debug

func (l *BasicLogger) Debug(format string, args ...interface{})

Debug is a debug level logger

func (*BasicLogger) Error

func (l *BasicLogger) Error(format string, args ...interface{})

Error is a error level logger

func (*BasicLogger) Fatal

func (l *BasicLogger) Fatal(format string, args ...interface{})

Fatal is a fatal level logger

func (*BasicLogger) Info

func (l *BasicLogger) Info(format string, args ...interface{})

Info is a info level logger

func (*BasicLogger) Panic

func (l *BasicLogger) Panic(format string, args ...interface{})

Panic is a panic level logger

func (*BasicLogger) SetLevel

func (l *BasicLogger) SetLevel(level int)

SetLevel defines maximum level of a logger output

func (*BasicLogger) Trace

func (l *BasicLogger) Trace(format string, args ...interface{})

Trace is a trace level logger

func (*BasicLogger) Warn

func (l *BasicLogger) Warn(format string, args ...interface{})

Warn is a warn level logger

type BladeAuth

type BladeAuth struct {
	ProjectID string
	TokenID   string
}

BladeAuth holds auth data for the WS connection

type BladeSession

type BladeSession struct {
	BladeHandlerIncoming ReqHandler
	Calls                [MaxSimCalls]CallSession
	RemoteAddress        url.URL

	EventCalling       EventCalling
	EventMessaging     EventMessaging
	EventTasking       EventTasking
	LastJRPCError      JError
	SignalwireChannels []string
	SignalwireContexts []string

	SessionID    string
	Protocol     string
	SpaceID      string
	LastError    error
	Ctx          context.Context
	I            IBlade
	SessionState SessionState

	DisconnectChan chan struct{}
	Inbound        chan string
	Netcast        chan string
	InboundDone    chan struct{}
	InboundMsg     chan string
	InboundMsgDone chan struct{}
	Tconn          *time.Timer
	WatcherDone    chan struct{}
	WatcherSync    chan struct{}
	Tmutex         sync.Mutex
	Certified      bool
	WantReconnect  bool
	// contains filtered or unexported fields
}

BladeSession cache Session information

func BladeNew

func BladeNew() *BladeSession

BladeNew TODO DESCRIPTION

func NewBladeSession

func NewBladeSession() *BladeSession

NewBladeSession creates new cache Session information object

func (*BladeSession) BladeAddSubscription

func (blade *BladeSession) BladeAddSubscription(ctx context.Context, signalwireChannels []string) error

BladeAddSubscription TODO DESCRIPTION

func (*BladeSession) BladeCleanup

func (blade *BladeSession) BladeCleanup() error

BladeCleanup TODO DESCRIPTION

func (*BladeSession) BladeConnect

func (blade *BladeSession) BladeConnect(ctx context.Context, bladeAuth *BladeAuth) error

BladeConnect TODO DESCRIPTION

func (*BladeSession) BladeDisconnect

func (blade *BladeSession) BladeDisconnect(ctx context.Context) error

BladeDisconnect TODO DESCRIPTION

func (*BladeSession) BladeExecute

func (blade *BladeSession) BladeExecute(ctx context.Context, v interface{}, res interface{}) (interface{}, error)

BladeExecute TODO DESCRIPTION

func (*BladeSession) BladeInit

func (blade *BladeSession) BladeInit(ctx context.Context, addr string) error

BladeInit TODO DESCRIPTION

func (*BladeSession) BladeReconnect

func (blade *BladeSession) BladeReconnect(ctx context.Context, u url.URL)

BladeReconnect TODO DESCRIPTION

func (*BladeSession) BladeSetup

func (blade *BladeSession) BladeSetup(ctx context.Context) error

BladeSetup TODO DESCRIPTION

func (*BladeSession) BladeSetupInbound

func (blade *BladeSession) BladeSetupInbound(_ context.Context)

BladeSetupInbound TODO DESCRIPTION

func (*BladeSession) BladeSetupInboundMsg

func (blade *BladeSession) BladeSetupInboundMsg(_ context.Context)

BladeSetupInboundMsg TODO DESCRIPTION

func (*BladeSession) BladeSignalwireReceive

func (blade *BladeSession) BladeSignalwireReceive(ctx context.Context, signalwireContexts []string) error

BladeSignalwireReceive TODO DESCRIPTION

func (*BladeSession) BladeWSOpenConn

func (blade *BladeSession) BladeWSOpenConn(ctx context.Context, u url.URL) (*websocket.Conn, error)

BladeWSOpenConn TODO DESCRIPTION

func (*BladeSession) BladeWSWatchConn

func (blade *BladeSession) BladeWSWatchConn(ctx context.Context)

BladeWSWatchConn TODO DESCRIPTION

func (*BladeSession) BladeWaitDisconnect

func (blade *BladeSession) BladeWaitDisconnect(ctx context.Context) int

BladeWaitDisconnect TODO DESCRIPTION

func (*BladeSession) BladeWaitInboundCall

func (blade *BladeSession) BladeWaitInboundCall(ctx context.Context) (*CallSession, error)

BladeWaitInboundCall TODO DESCRIPTION

func (*BladeSession) BladeWaitInboundMsg

func (blade *BladeSession) BladeWaitInboundMsg(ctx context.Context) (*MsgSession, error)

BladeWaitInboundMsg TODO DESCRIPTION

func (*BladeSession) GetConnection

func (blade *BladeSession) GetConnection() (*jsonrpc2.Conn, error)

GetConnection returns pointer to jsonrpc2.Conn object

type BladeSessionControl

type BladeSessionControl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

BladeSessionControl Control Pool of Sessions

func NewBladeSessionControl

func NewBladeSessionControl() *BladeSessionControl

NewBladeSessionControl creates new Control Pool of Sessions object

type BladeVersionStruct

type BladeVersionStruct struct {
	Major    int `json:"major"`
	Minor    int `json:"minor"`
	Revision int `json:"revision"`
}

BladeVersionStruct TODO DESCRIPTION

type CallConnectState

type CallConnectState int

CallConnectState TODO DESCRIPTION

const (
	CallConnectFailed CallConnectState = iota
	CallConnectConnecting
	CallConnectConnected
	CallConnectDisconnected
)

call.connect states

func (CallConnectState) String

func (s CallConnectState) String() string

type CallDirection

type CallDirection int

CallDirection has the direction of a call

const (
	CallInbound CallDirection = iota
	CallOutbound
)

Call state constants

func (CallDirection) String

func (s CallDirection) String() string

type CallDisconnectReason

type CallDisconnectReason int

CallDisconnectReason describes reason for call disconnection

const (
	CallHangup CallDisconnectReason = iota
	CallCancel
	CallBusy
	CallNoAnswer
	CallDecline
	CallGenericError
)

Call disconnection constants

func (CallDisconnectReason) String

func (s CallDisconnectReason) String() string

type CallObj

type CallObj struct {
	I       ICallObj
	Calling *Calling
	Payload *json.RawMessage // last command payload

	OnStateChange           func(*CallObj)
	OnRinging               func(*CallObj)
	OnAnswered              func(*CallObj)
	OnEnding                func(*CallObj)
	OnEnded                 func(*CallObj)
	OnPlayFinished          func(*PlayAction)
	OnPlayPaused            func(*PlayAction)
	OnPlayError             func(*PlayAction)
	OnPlayPlaying           func(*PlayAction)
	OnPlayStateChange       func(*PlayAction)
	OnRecordStateChange     func(*RecordAction)
	OnRecordRecording       func(*RecordAction)
	OnRecordPaused          func(*RecordAction)
	OnRecordFinished        func(*RecordAction)
	OnRecordNoInput         func(*RecordAction)
	OnDetectUpdate          func(*DetectAction)
	OnDetectError           func(*DetectAction)
	OnDetectFinished        func(*DetectAction)
	OnFaxFinished           func(*FaxAction)
	OnFaxPage               func(*FaxAction)
	OnFaxError              func(*FaxAction)
	OnConnectStateChange    func(*ConnectAction)
	OnConnectFailed         func(*ConnectAction)
	OnConnectConnecting     func(*ConnectAction)
	OnConnectConnected      func(*ConnectAction)
	OnConnectDisconnected   func(*ConnectAction)
	OnTapStateChange        func(*TapAction)
	OnTapFinished           func(*TapAction)
	OnTapTapping            func(*TapAction)
	OnSendDigitsFinished    func(*SendDigitsAction)
	OnSendDigitsStateChange func(*SendDigitsAction)
	OnPrompt                func(*PromptAction)
	// contains filtered or unexported fields
}

CallObj is the external Call object (as exposed to the user)

func CallObjNew

func CallObjNew() *CallObj

CallObjNew TODO DESCRIPTION

func (*CallObj) AMD

func (callobj *CallObj) AMD(det *DetectMachineParams) (*DetectResult, error)

AMD TODO DESCRIPTION

func (*CallObj) AMDAsync

func (callobj *CallObj) AMDAsync(det *DetectMachineParams) (*DetectAction, error)

AMDAsync TODO DESCRIPTION

func (*CallObj) Active

func (callobj *CallObj) Active() bool

Active TODO DESCRIPTION

func (*CallObj) Answer

func (callobj *CallObj) Answer() (*ResultAnswer, error)

Answer TODO DESCRIPTION

func (*CallObj) Answered

func (callobj *CallObj) Answered() bool

Answered TODO DESCRIPTION

func (*CallObj) Busy

func (callobj *CallObj) Busy() bool

Busy TODO DESCRIPTION

func (*CallObj) Connect

func (callobj *CallObj) Connect(ringback *[]RingbackStruct, devices *[][]DeviceStruct) (*ConnectResult, error)

Connect TODO DESCRIPTION

func (*CallObj) ConnectAsync

func (callobj *CallObj) ConnectAsync(fromNumber, toNumber string) (*ConnectAction, error)

ConnectAsync TODO DESCRIPTION

func (*CallObj) DetectDigit

func (callobj *CallObj) DetectDigit(det *DetectDigitParams) (*DetectResult, error)

DetectDigit TODO DESCRIPTION

func (*CallObj) DetectDigitAsync

func (callobj *CallObj) DetectDigitAsync(det *DetectDigitParams) (*DetectAction, error)

DetectDigitAsync TODO DESCRIPTION

func (*CallObj) DetectFax

func (callobj *CallObj) DetectFax(det *DetectFaxParams) (*DetectResult, error)

DetectFax TODO DESCRIPTION

func (*CallObj) DetectFaxAsync

func (callobj *CallObj) DetectFaxAsync(det *DetectFaxParams) (*DetectAction, error)

DetectFaxAsync TODO DESCRIPTION

func (*CallObj) DetectMachine

func (callobj *CallObj) DetectMachine(det *DetectMachineParams) (*DetectResult, error)

DetectMachine TODO DESCRIPTION

func (*CallObj) DetectMachineAsync

func (callobj *CallObj) DetectMachineAsync(det *DetectMachineParams) (*DetectAction, error)

DetectMachineAsync TODO DESCRIPTION

func (*CallObj) DetectStop

func (callobj *CallObj) DetectStop(ctrlID *string) error

DetectStop TODO DESCRIPTION

func (*CallObj) Ended

func (callobj *CallObj) Ended() bool

Ended TODO DESCRIPTION

func (*CallObj) Failed

func (callobj *CallObj) Failed() bool

Failed TODO DESCRIPTION

func (*CallObj) GetCallState

func (callobj *CallObj) GetCallState() CallState

GetCallState TODO DESCRIPTION

func (*CallObj) GetEvent

func (callobj *CallObj) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*CallObj) GetEventName

func (callobj *CallObj) GetEventName() string

GetEventName this is expensive

func (*CallObj) GetFrom

func (callobj *CallObj) GetFrom() string

GetFrom TODO DESCRIPTION

func (*CallObj) GetID

func (callobj *CallObj) GetID() string

GetID TODO DESCRIPTION

func (*CallObj) GetPrevState

func (callobj *CallObj) GetPrevState() CallState

GetPrevState TODO DESCRIPTION

func (*CallObj) GetState

func (callobj *CallObj) GetState() CallState

GetState TODO DESCRIPTION

func (*CallObj) GetTempID

func (callobj *CallObj) GetTempID() string

GetTempID TODO DESCRIPTION

func (*CallObj) GetTimeout

func (callobj *CallObj) GetTimeout() uint

GetTimeout TODO DESCRIPTION

func (*CallObj) GetTo

func (callobj *CallObj) GetTo() string

GetTo TODO DESCRIPTION

func (*CallObj) GetType

func (callobj *CallObj) GetType() string

GetType TODO DESCRIPTION

func (*CallObj) Hangup

func (callobj *CallObj) Hangup() (*ResultHangup, error)

Hangup TODO DESCRIPTION

func (*CallObj) Play

func (callobj *CallObj) Play(g [MaxPlay]PlayGenericParams) ([]PlayResult, error)

Play TODO DESCRIPTION

func (*CallObj) PlayAsync

func (callobj *CallObj) PlayAsync(g [MaxPlay]PlayGenericParams) ([]*PlayAction, error)

PlayAsync TODO DESCRIPTION

func (*CallObj) PlayAudio

func (callobj *CallObj) PlayAudio(s string) (*PlayResult, error)

PlayAudio TODO DESCRIPTION

func (*CallObj) PlayAudioAsync

func (callobj *CallObj) PlayAudioAsync(url string) (*PlayAction, error)

PlayAudioAsync TODO DESCRIPTION

func (*CallObj) PlayRingtone

func (callobj *CallObj) PlayRingtone(name string, duration float64) (*PlayResult, error)

PlayRingtone TODO DESCRIPTION

func (*CallObj) PlayRingtoneAsync

func (callobj *CallObj) PlayRingtoneAsync(name string, duration float64) (*PlayAction, error)

PlayRingtoneAsync TODO DESCRIPTION

func (*CallObj) PlaySilence

func (callobj *CallObj) PlaySilence(duration float64) (*PlayResult, error)

PlaySilence TODO DESCRIPTION

func (*CallObj) PlaySilenceAsync

func (callobj *CallObj) PlaySilenceAsync(duration float64) (*PlayAction, error)

PlaySilenceAsync TODO DESCRIPTION

func (*CallObj) PlayStop

func (callobj *CallObj) PlayStop(ctrlID *string) error

PlayStop TODO DESCRIPTION

func (*CallObj) PlayTTS

func (callobj *CallObj) PlayTTS(text, language, gender string) (*PlayResult, error)

PlayTTS TODO DESCRIPTION

func (*CallObj) PlayTTSAsync

func (callobj *CallObj) PlayTTSAsync(text, language, gender string) (*PlayAction, error)

PlayTTSAsync TODO DESCRIPTION

func (*CallObj) Prompt

func (callobj *CallObj) Prompt(playlist *[]PlayStruct, collect *CollectStruct) (*CollectResult, error)

Prompt TODO DESCRIPTION

func (*CallObj) PromptAsync

func (callobj *CallObj) PromptAsync(playlist *[]PlayStruct, collect *CollectStruct) (*PromptAction, error)

PromptAsync TODO DESCRIPTION

func (*CallObj) PromptStop

func (callobj *CallObj) PromptStop(ctrlID *string) error

PromptStop TODO DESCRIPTION

func (*CallObj) ReceiveFax

func (callobj *CallObj) ReceiveFax() (*FaxResult, error)

ReceiveFax TODO DESCRIPTION

func (*CallObj) ReceiveFaxAsync

func (callobj *CallObj) ReceiveFaxAsync() (*FaxAction, error)

ReceiveFaxAsync TODO DESCRIPTION

func (*CallObj) RecordAudio

func (callobj *CallObj) RecordAudio(rec *RecordParams) (*RecordResult, error)

RecordAudio TODO DESCRIPTION

func (*CallObj) RecordAudioAsync

func (callobj *CallObj) RecordAudioAsync(rec *RecordParams) (*RecordAction, error)

RecordAudioAsync TODO DESCRIPTION

func (*CallObj) RecordAudioStop

func (callobj *CallObj) RecordAudioStop(ctrlID *string) error

RecordAudioStop TODO DESCRIPTION

func (*CallObj) SendDigits

func (callobj *CallObj) SendDigits(digits string) (*SendDigitsResult, error)

SendDigits TODO DESCRIPTION

func (*CallObj) SendDigitsAsync

func (callobj *CallObj) SendDigitsAsync(digits string) (*SendDigitsAction, error)

SendDigitsAsync TODO DESCRIPTION

func (*CallObj) SendFax

func (callobj *CallObj) SendFax(doc, id, headerInfo string) (*FaxResult, error)

SendFax TODO DESCRIPTION

func (*CallObj) SendFaxAsync

func (callobj *CallObj) SendFaxAsync(doc, id, headerInfo string) (*FaxAction, error)

SendFaxAsync TODO DESCRIPTION

func (*CallObj) SendFaxStop

func (callobj *CallObj) SendFaxStop(ctrlID *string) error

SendFaxStop TODO DESCRIPTION

func (*CallObj) SetTimeout

func (callobj *CallObj) SetTimeout(t uint)

SetTimeout TODO DESCRIPTION

func (*CallObj) TapAudio

func (callobj *CallObj) TapAudio(direction fmt.Stringer, tapdev *TapDevice) (*TapResult, error)

TapAudio TODO DESCRIPTION

func (*CallObj) TapAudioAsync

func (callobj *CallObj) TapAudioAsync(direction fmt.Stringer, tapdev *TapDevice) (*TapAction, error)

TapAudioAsync TODO DESCRIPTION

func (*CallObj) TapStop

func (callobj *CallObj) TapStop(ctrlID *string) error

TapStop TODO DESCRIPTION

func (*CallObj) WaitFor

func (callobj *CallObj) WaitFor(want CallState, timeout uint) bool

WaitFor TODO DESCRIPTION

func (*CallObj) WaitForAnswered

func (callobj *CallObj) WaitForAnswered(timeout uint) bool

WaitForAnswered TODO DESCRIPTION

func (*CallObj) WaitForEnded

func (callobj *CallObj) WaitForEnded(timeout uint) bool

WaitForEnded TODO DESCRIPTION

func (*CallObj) WaitForEnding

func (callobj *CallObj) WaitForEnding(timeout uint) bool

WaitForEnding TODO DESCRIPTION

func (*CallObj) WaitForRinging

func (callobj *CallObj) WaitForRinging(timeout uint) bool

WaitForRinging TODO DESCRIPTION

type CallParams

type CallParams struct {
	TagID      string
	CallID     string
	NodeID     string
	Direction  string
	ToNumber   string
	FromNumber string
	CallState  CallState
	EndReason  string
	Context    string // inbound
}

CallParams TODO DESCRIPTION (internal, to pass it around)

type CallSession

type CallSession struct {
	Active               bool
	To                   string
	From                 string
	TagID                string
	Timeout              uint // ring timeout
	CallID               string
	NodeID               string
	ProjectID            string
	SpaceID              string
	Direction            CallDirection
	Context              string
	CallState            CallState
	PrevCallState        CallState
	CallType             CallType
	CallDisconnectReason CallDisconnectReason
	CallConnectState     CallConnectState
	CallStateChan        chan CallState

	CallConnectStateChan    chan CallConnectState
	CallConnectRawEventChan chan *json.RawMessage

	CallPlayChans         map[string](chan PlayState)
	CallPlayControlIDs    chan string
	CallPlayEventChans    map[string](chan ParamsEventCallingCallPlay)
	CallPlayReadyChans    map[string](chan struct{})
	CallPlayRawEventChans map[string](chan *json.RawMessage)

	CallRecordChans         map[string](chan RecordState)
	CallRecordControlIDs    chan string
	CallRecordEventChans    map[string](chan ParamsEventCallingCallRecord)
	CallRecordReadyChans    map[string](chan struct{})
	CallRecordRawEventChans map[string](chan *json.RawMessage)

	CallDetectMachineChans     map[string](chan DetectMachineEvent)
	CallDetectDigitChans       map[string](chan DetectDigitEvent)
	CallDetectFaxChans         map[string](chan DetectFaxEvent)
	CallDetectMachineControlID chan string
	CallDetectDigitControlID   chan string
	CallDetectFaxControlID     chan string
	CallDetectEventChans       map[string](chan ParamsEventCallingCallDetect)
	CallDetectReadyChans       map[string](chan struct{})
	CallDetectRawEventChans    map[string](chan *json.RawMessage)

	CallFaxChan         chan FaxEventType
	CallFaxControlID    chan string
	CallFaxEventChan    chan FaxEventStruct
	CallFaxReadyChan    chan struct{}
	CallFaxRawEventChan chan *json.RawMessage

	CallTapChans         map[string](chan TapState)
	CallTapControlIDs    chan string
	CallTapEventChans    map[string](chan ParamsEventCallingCallTap)
	CallTapReadyChans    map[string](chan struct{})
	CallTapRawEventChans map[string](chan *json.RawMessage)

	CallSendDigitsChans         map[string](chan SendDigitsState)
	CallSendDigitsControlIDs    chan string
	CallSenDigitsEventChans     map[string](chan ParamsEventCallingCallSendDigits)
	CallSendDigitsReadyChans    map[string](chan struct{})
	CallSendDigitsRawEventChans map[string](chan *json.RawMessage)

	CallPlayAndCollectChans         map[string](chan CollectResultType)
	CallPlayAndCollectControlID     chan string
	CallPlayAndCollectEventChans    map[string](chan ParamsEventCallingCallPlayAndCollect)
	CallPlayAndCollectReadyChans    map[string](chan struct{})
	CallPlayAndCollectRawEventChans map[string](chan *json.RawMessage)

	Hangup   chan struct{}
	CallPeer PeerDeviceStruct
	Actions  Actions
	Blade    *BladeSession
	I        ICall
	Event    *json.RawMessage
	sync.RWMutex
	// contains filtered or unexported fields
}

CallSession internal representation of a call

func CallNew

func CallNew() *CallSession

CallNew TODO DESCRIPTION

func (*CallSession) AddAction

func (c *CallSession) AddAction(ctrlID, state string)

AddAction TODO DESCRIPTION

func (*CallSession) CallCleanup

func (c *CallSession) CallCleanup(_ context.Context)

CallCleanup close the channels, etc app writer should set CallObj and/or c to nil to clean it up

func (*CallSession) CallInit

func (c *CallSession) CallInit(_ context.Context)

CallInit creates the channels communicating call states

func (*CallSession) GetActionState

func (c *CallSession) GetActionState(ctrlID string) string

GetActionState TODO DESCRIPTION

func (*CallSession) GetActive

func (c *CallSession) GetActive() bool

GetActive TODO DESCRIPTION

func (*CallSession) GetCallID

func (c *CallSession) GetCallID() string

GetCallID TODO DESCRIPTION

func (*CallSession) GetEventName

func (c *CallSession) GetEventName() string

GetEventName TODO DESCRIPTION

func (*CallSession) GetEventPayload

func (c *CallSession) GetEventPayload() *json.RawMessage

GetEventPayload TODO DESCRIPTION

func (*CallSession) GetFrom

func (c *CallSession) GetFrom() string

GetFrom TODO DESCRIPTION

func (*CallSession) GetPeer

func (c *CallSession) GetPeer(_ context.Context) (*CallSession, error)

GetPeer get the call peer if the peer is local

func (*CallSession) GetPrevState

func (c *CallSession) GetPrevState() CallState

GetPrevState TODO DESCRIPTION

func (*CallSession) GetState

func (c *CallSession) GetState() CallState

GetState TODO DESCRIPTION

func (*CallSession) GetTagID

func (c *CallSession) GetTagID() string

GetTagID TODO DESCRIPTION

func (*CallSession) GetTimeout

func (c *CallSession) GetTimeout() uint

GetTimeout TODO DESCRIPTION

func (*CallSession) GetTo

func (c *CallSession) GetTo() string

GetTo TODO DESCRIPTION

func (*CallSession) GetType

func (c *CallSession) GetType() string

GetType TODO DESCRIPTION

func (*CallSession) RemoveAction

func (c *CallSession) RemoveAction(ctrlID string)

RemoveAction TODO DESCRIPTION

func (*CallSession) SetActive

func (c *CallSession) SetActive(active bool)

SetActive TODO DESCRIPTION

func (*CallSession) SetDisconnectReason

func (c *CallSession) SetDisconnectReason(reason CallDisconnectReason)

SetDisconnectReason TODO DESCRIPTION

func (*CallSession) SetFrom

func (c *CallSession) SetFrom(from string)

SetFrom TODO DESCRIPTION

func (*CallSession) SetParams

func (c *CallSession) SetParams(callID, nodeID, to, from, signalwireContext string, direction CallDirection)

SetParams setting Params that stay the same during the call*/

func (*CallSession) SetTimeout

func (c *CallSession) SetTimeout(t uint)

SetTimeout TODO DESCRIPTION

func (*CallSession) SetTo

func (c *CallSession) SetTo(to string)

SetTo TODO DESCRIPTION

func (*CallSession) SetType

func (c *CallSession) SetType(t CallType)

SetType TODO DESCRIPTION

func (*CallSession) UpdateAction

func (c *CallSession) UpdateAction(ctrlID, state string)

UpdateAction TODO DESCRIPTION

func (*CallSession) UpdateCallConnectState

func (c *CallSession) UpdateCallConnectState(s CallConnectState)

UpdateCallConnectState TODO DESCRIPTION

func (*CallSession) UpdateCallState

func (c *CallSession) UpdateCallState(s CallState)

UpdateCallState TODO DESCRIPTION

func (*CallSession) UpdateConnectPeer

func (c *CallSession) UpdateConnectPeer(p PeerDeviceStruct)

UpdateConnectPeer TODO DESCRIPTION

func (*CallSession) WaitCallConnectState

func (c *CallSession) WaitCallConnectState(_ context.Context, want CallConnectState) bool

WaitCallConnectState wait for a certain call connect state and return true when it arrives. return false if timeout.

func (*CallSession) WaitCallStateInternal

func (c *CallSession) WaitCallStateInternal(ctx context.Context, want CallState, timeoutSec uint) bool

WaitCallStateInternal wait for a certain call state and return true when it arrives. return false if timeout.

type CallState

type CallState int

CallState keeps the state of a call

const (
	Created CallState = iota
	Ringing
	Answered
	Ending
	Ended
)

Call state constants

func (CallState) String

func (s CallState) String() string

type CallTagToCallID

type CallTagToCallID struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CallTagToCallID map of tag to Call-ID

func NewCallTagToCallID

func NewCallTagToCallID() *CallTagToCallID

NewCallTagToCallID returns new map of tag to Call-ID

type CallType

type CallType int

CallType keeps the type of a call

const (
	CallTypePhone CallType = iota
	CallTypeSIP
	CallWebrtc
	CallAgora
)

Call state constants

func (CallType) String

func (s CallType) String() string

type Calling

type Calling struct {
	Ctx    context.Context
	Cancel context.CancelFunc
	Relay  *RelaySession
}

Calling TODO DESCRIPTION

func (*Calling) Dial

func (calling *Calling) Dial(c *CallObj) ResultDial

Dial TODO DESCRIPTION

func (*Calling) DialPhone

func (calling *Calling) DialPhone(fromNumber, toNumber string) ResultDial

DialPhone TODO DESCRIPTION

func (*Calling) NewCall

func (calling *Calling) NewCall(from, to string) *CallObj

NewCall TODO DESCRIPTION

type ClientSession

type ClientSession struct {
	Project     string
	Token       string
	Host        string
	Agent       string
	Relay       RelaySession
	Calling     Calling
	Messaging   Messaging
	Tasking     Tasking
	Ctx         context.Context
	Cancel      context.CancelFunc
	Operational chan struct{}
	I           IClientSession
	Consumer    *Consumer
	OnReady     func(*ClientSession)

	Log LoggerWrapper
}

ClientSession TODO DESCRIPTION

func Client

func Client(project, token, host string, signalwireContexts []string) *ClientSession

Client TODO DESCRIPTION

func ClientNew

func ClientNew() *ClientSession

ClientNew TODO DESCRIPTION

func NewClientSession

func NewClientSession() *ClientSession

NewClientSession TODO DESCRIPTION

func (*ClientSession) Connect

func (client *ClientSession) Connect() error

Connect TODO DESCRIPTION

func (*ClientSession) Disconnect

func (client *ClientSession) Disconnect() error

Disconnect TODO DESCRIPTION

type CollectContinue

type CollectContinue int

CollectContinue TODO DESCRIPTION

const (
	CollectPartial CollectContinue = iota
	CollectFinal
)

Collect Result Type constants

type CollectDigits

type CollectDigits struct {
	Terminators  string `json:"terminators,omitempty"`
	Max          uint16 `json:"max"`
	DigitTimeout uint16 `json:"digit_timeout,omitempty"`
}

CollectDigits TODO DESCRIPTION

type CollectResult

type CollectResult struct {
	Successful bool
	Terminator string
	Confidence float64
	Result     string
	ResultType CollectResultType
	Continue   CollectContinue
	Event      json.RawMessage
}

CollectResult TODO DESCRIPTION

type CollectResultType

type CollectResultType int

CollectResultType keeps the result type of a Collect action

const (
	CollectResultError CollectResultType = iota
	CollectResultNoInput
	CollectResultNoMatch
	CollectResultDigit
	CollectResultSpeech
	CollectResultStartOfSpeech
)

Collect Result Type constants

func (CollectResultType) String

func (s CollectResultType) String() string

type CollectSpeech

type CollectSpeech struct {
	EndSilenceTimeout uint16   `json:"end_silence_timeout,omitempty"`
	SpeechTimeout     uint16   `json:"speech_timeout,omitempty"`
	Language          string   `json:"language,omitempty"`
	Hints             []string `json:"hints,omitempty"`
}

CollectSpeech TODO DESCRIPTION

type CollectStruct

type CollectStruct struct {
	Digits         *CollectDigits `json:"digits,omitempty"`
	Speech         *CollectSpeech `json:"speech,omitempty"`
	InitialTimeout uint16         `json:"initial_timeout,omitempty"`
	PartialResults bool           `json:"partial_results,omitempty"`
}

CollectStruct TODO DESCRIPTION

type ConnectAction

type ConnectAction struct {
	ControlID string
	Completed bool
	Result    ConnectResult
	State     CallConnectState
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

ConnectAction TODO DESCRIPTION

func (*ConnectAction) GetCall

func (action *ConnectAction) GetCall() *CallObj

GetCall TODO DESCRIPTION

func (*ConnectAction) GetPayload

func (action *ConnectAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

type ConnectResult

type ConnectResult struct {
	Successful bool
	Event      json.RawMessage
	CallObj    *CallObj
}

ConnectResult TODO DESCRIPTION

type Consumer

type Consumer struct {
	Project              string
	Token                string
	Contexts             []string
	Host                 string
	Client               *ClientSession
	Ready                func(*Consumer)
	OnIncomingCall       func(*Consumer, *CallObj)
	OnIncomingMessage    func(*Consumer, *MsgObj)
	OnMessageStateChange func(*Consumer, *MsgObj)
	OnTask               func(*Consumer, ParamsEventTaskingTask)
	Teardown             func(*Consumer)

	Log LoggerWrapper
}

Consumer TODO DESCRIPTION

func NewConsumer

func NewConsumer() *Consumer

NewConsumer TODO DESCRIPTION

func (*Consumer) Run

func (consumer *Consumer) Run() error

Run TODO DESCRIPTION

func (*Consumer) Setup

func (consumer *Consumer) Setup(project, token string, contexts []string)

Setup TODO DESCRIPTION

func (*Consumer) Stop

func (consumer *Consumer) Stop() error

Stop TODO DESCRIPTION

type DetectAction

type DetectAction struct {
	CallObj   *CallObj
	ControlID string
	Result    DetectResult

	DetectorType DetectorType
	Payload      *json.RawMessage

	sync.RWMutex

	Completed bool
	// contains filtered or unexported fields
}

DetectAction TODO DESCRIPTION

func (*DetectAction) GetCompleted

func (detectaction *DetectAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*DetectAction) GetControlID

func (detectaction *DetectAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*DetectAction) GetDetectorEvent

func (detectaction *DetectAction) GetDetectorEvent() interface{}

GetDetectorEvent TODO DESCRIPTION

func (*DetectAction) GetEvent

func (detectaction *DetectAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*DetectAction) GetPayload

func (detectaction *DetectAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*DetectAction) GetResult

func (detectaction *DetectAction) GetResult() DetectResult

GetResult TODO DESCRIPTION

func (*DetectAction) Stop

func (detectaction *DetectAction) Stop() StopResult

Stop TODO DESCRIPTION

type DetectDigitEvent

type DetectDigitEvent int

DetectDigitEvent TODO DESCRIPTION

const (
	DetectDigitZero DetectDigitEvent = iota
	DetectDigitOne
	DetectDigitTwo
	DetectDigitThree
	DetectDigitFour
	DetectDigitFive
	DetectDigitSix
	DetectDigitSeven
	DetectDigitEight
	DetectDigitNine
	DetectDigitPound
	DetectDigitStar
	DetectDigitFinished
)

Digit Detector events

func (DetectDigitEvent) String

func (s DetectDigitEvent) String() string

type DetectDigitParams

type DetectDigitParams struct {
	Digits  string
	Timeout float64
}

DetectDigitParams TODO DESCRIPTION

type DetectDigitParamsInternal

type DetectDigitParamsInternal struct {
	Digits string `json:"digits,omitempty"`
}

DetectDigitParamsInternal TODO DESCRIPTION

type DetectEventStruct

type DetectEventStruct struct {
	Type   string            `json:"type"`
	Params ParamsEventDetect `json:"params"`
}

DetectEventStruct TODO DESCRIPTION

type DetectFaxEvent

type DetectFaxEvent int

DetectFaxEvent TODO DESCRIPTION

const (
	DetectFaxNone DetectFaxEvent = iota
	DetectFaxCED                 // Called Station Fax Tone
	DetectFaxCNG                 // Calling Station Fax Tone
	DetectFaxFinished
)

Call event constants

func (DetectFaxEvent) String

func (s DetectFaxEvent) String() string

type DetectFaxParams

type DetectFaxParams struct {
	Tone    string
	Timeout float64
}

DetectFaxParams TODO DESCRIPTION

type DetectFaxParamsInternal

type DetectFaxParamsInternal struct {
	Tone string `json:"tone,omitempty"`
}

DetectFaxParamsInternal TODO DESCRIPTION

type DetectMachineEvent

type DetectMachineEvent int

DetectMachineEvent keeps the event of a detect action

const (
	DetectMachineUnknown DetectMachineEvent = iota
	DetectMachineMachine
	DetectMachineHuman
	DetectMachineReady
	DetectMachineNotReady
	DetectMachineFinished
)

Machine detector event constants

func (DetectMachineEvent) String

func (s DetectMachineEvent) String() string

type DetectMachineParams

type DetectMachineParams struct {
	InitialTimeout        float64
	EndSilenceTimeout     float64
	MachineVoiceThreshold float64
	MachineWordsThreshold float64
	WaitForBeep           bool // special param that does not get sent
	Timeout               float64
}

DetectMachineParams TODO DESCRIPTION

type DetectMachineParamsInternal

type DetectMachineParamsInternal struct {
	InitialTimeout        float64 `json:"initial_timeout,omitempty"`
	EndSilenceTimeout     float64 `json:"end_silence_timeout,omitempty"`
	MachineVoiceThreshold float64 `json:"machine_voice_threshold,omitempty"`
	MachineWordsThreshold float64 `json:"machine_words_threshold,omitempty"`
}

DetectMachineParamsInternal TODO DESCRIPTION

type DetectResult

type DetectResult struct {
	Successful bool
	Type       DetectResultType
	Result     string
	Event      json.RawMessage
}

DetectResult TODO DESCRIPTION

type DetectResultType

type DetectResultType int

DetectResultType TODO DESCRIPTION

const (
	DetectorMachine DetectResultType = iota
	DetectorHuman
	DetectorFax
	DetectorDTMF
	DetectorUnknown
	DetectorError
	DetectorFinished
)

Type of detector (used only in the Result)

func (DetectResultType) String

func (s DetectResultType) String() string

type DetectStruct

type DetectStruct struct {
	Type   string      `json:"type"`
	Params interface{} `json:"params"`
}

DetectStruct TODO DESCRIPTION

type DetectorType

type DetectorType int

DetectorType type of running detector

const (
	MachineDetector DetectorType = iota
	FaxDetector
	DigitDetector
)

TODO DESCRIPTION

func (DetectorType) String

func (s DetectorType) String() string

type DeviceAgoraParams

type DeviceAgoraParams struct {
	To      string `json:"to"`
	From    string `json:"from"`
	Appid   string `json:"appid"`
	Channel string `json:"channel"`
}

DeviceAgoraParams TODO DESCRIPTION

type DevicePhoneParams

type DevicePhoneParams struct {
	ToNumber   string `json:"to_number"`
	FromNumber string `json:"from_number"`
	Timeout    uint   `json:"timeout"`
}

DevicePhoneParams TODO DESCRIPTION

type DeviceStruct

type DeviceStruct struct {
	Type string `json:"type"`
	// todo: make Params interface{}
	Params DevicePhoneParams `json:"params"`
}

DeviceStruct TODO DESCRIPTION

type EventCalling

type EventCalling struct {
	Cache BCache
	I     IEventCalling
	// contains filtered or unexported fields
}

EventCalling TODO DESCRIPTION

func EventCallingNew

func EventCallingNew() *EventCalling

EventCallingNew TODO DESCRIPTION

type EventMessaging

type EventMessaging struct {
	Cache BCache
	I     IEventMessaging
	// contains filtered or unexported fields
}

EventMessaging TODO DESCRIPTION

func EventMessagingNew

func EventMessagingNew() *EventMessaging

EventMessagingNew TODO DESCRIPTION

type EventTasking

type EventTasking struct {
	Cache BCache
	I     IEventTasking
	// contains filtered or unexported fields
}

EventTasking TODO DESCRIPTION

func EventTaskingNew

func EventTaskingNew() *EventTasking

EventTaskingNew TODO DESCRIPTION

type FaxAction

type FaxAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    FaxResult
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

FaxAction TODO DESCRIPTION

func (*FaxAction) GetCompleted

func (action *FaxAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*FaxAction) GetControlID

func (action *FaxAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*FaxAction) GetDocument

func (action *FaxAction) GetDocument() string

GetDocument TODO DESCRIPTION

func (*FaxAction) GetEvent

func (action *FaxAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*FaxAction) GetIdentity

func (action *FaxAction) GetIdentity() string

GetIdentity TODO DESCRIPTION

func (*FaxAction) GetPages

func (action *FaxAction) GetPages() uint16

GetPages TODO DESCRIPTION

func (*FaxAction) GetPayload

func (action *FaxAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*FaxAction) GetRemoteIdentity

func (action *FaxAction) GetRemoteIdentity() string

GetRemoteIdentity TODO DESCRIPTION

func (*FaxAction) GetResult

func (action *FaxAction) GetResult() FaxResult

GetResult TODO DESCRIPTION

func (*FaxAction) GetSuccessful

func (action *FaxAction) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

func (*FaxAction) Stop

func (action *FaxAction) Stop() StopResult

Stop TODO DESCRIPTION

type FaxDirection

type FaxDirection int

FaxDirection direction of a fax Action (send/receive)

const (
	FaxSend FaxDirection = iota
	FaxReceive
)

Call state constants

func (FaxDirection) String

func (s FaxDirection) String() string

type FaxEventStruct

type FaxEventStruct struct {
	EventType string                 `json:"type"`
	Params    map[string]interface{} `json:"params"`
}

FaxEventStruct TODO DESCRIPTION

type FaxEventType

type FaxEventType int

FaxEventType type of a Faxing (Send/Receive) event

const (
	FaxError FaxEventType = iota
	FaxPage
	FaxFinished
)

Call state constants

func (FaxEventType) String

func (s FaxEventType) String() string

type FaxParamsInternal

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

FaxParamsInternal TODO DESCRIPTION

type FaxResult

type FaxResult struct {
	Identity       string
	RemoteIdentity string
	Document       string
	Direction      FaxDirection
	Pages          uint16
	Successful     bool
	Event          json.RawMessage
}

FaxResult TODO DESCRIPTION

type FaxTypeParamsError

type FaxTypeParamsError struct {
	Description string `json:"description"`
}

FaxTypeParamsError TODO DESCRIPTION

type FaxTypeParamsFinished

type FaxTypeParamsFinished struct {
	Direction      string `json:"direction"`
	Identity       string `json:"identity"`
	RemoteIdentity string `json:"remote_identity"`
	Document       string `json:"document"`
	Pages          uint16 `json:"pages"`
	Success        bool   `json:"success"`
	Result         uint16 `json:"result"`
	ResultText     string `json:"result_text"`
	Format         string `json:"format"`
}

FaxTypeParamsFinished TODO DESCRIPTION

type FaxTypeParamsPage

type FaxTypeParamsPage struct {
	Direction string `json:"direction"`
	Number    uint16 `json:"number"`
}

FaxTypeParamsPage TODO DESCRIPTION

type IBlade

type IBlade interface {
	GetConnection() (*jsonrpc2.Conn, error)
	BladeCleanup() error
	BladeWSOpenConn(ctx context.Context, u url.URL) (*websocket.Conn, error)
	BladeWSWatchConn(ctx context.Context)
	BladeInit(ctx context.Context, addr string) error
	BladeConnect(ctx context.Context, bladeAuth *BladeAuth) error
	BladeSetup(ctx context.Context) error
	BladeAddSubscription(ctx context.Context, signalwireChannels []string) error
	BladeExecute(ctx context.Context, v interface{}, res interface{}) (interface{}, error)
	BladeSignalwireReceive(ctx context.Context, signalwireContexts []string) error
	BladeWaitDisconnect(ctx context.Context) int
	BladeDisconnect(ctx context.Context) error
	BladeWaitInboundCall(ctx context.Context) (*CallSession, error)
	// contains filtered or unexported methods
}

IBlade TODO DESCRIPTION

type ICall

type ICall interface {
	CallInit(ctx context.Context)
	CallCleanup(ctx context.Context)
	UpdateCallState(s CallState)
	UpdateCallConnectState(s CallConnectState)
	UpdateConnectPeer(p PeerDeviceStruct)
	WaitCallStateInternal(ctx context.Context, want CallState, timeoutSec uint) bool
	WaitCallConnectState(ctx context.Context, want CallConnectState) bool
	GetPeer(ctx context.Context) (*CallSession, error)
}

ICall Call Interface

type ICallObj

type ICallObj interface {
	Hangup() (*ResultHangup, error)
	Answer() (*ResultAnswer, error)
	PlayAudio(url string) (*PlayResult, error)
	PlayStop(ctrlID *string) error
	PlayTTS(text, language, gender string) (*PlayResult, error)
	PlaySilence(duration float64) (*PlayResult, error)
	PlayRingtone(name string, duration float64) (*PlayResult, error)
	RecordAudio(r *RecordParams) (*RecordResult, error)
	RecordAudioAsync(r *RecordParams) (*RecordAction, error)
	RecordAudioStop(ctrlID *string) error
	DetectMachine(det *DetectMachineParams) (*DetectResult, error)
	DetectMachineAsync(det *DetectMachineParams) (*DetectAction, error)
	DetectFax(det *DetectFaxParams) (*DetectResult, error)
	DetectFaxAsync(det *DetectFaxParams) (*DetectAction, error)
	DetectDigit(det *DetectDigitParams) (*DetectResult, error)
	DetectDigitAsync(det *DetectDigitParams) (*DetectAction, error)
	DetectStop(ctrlID *string) error
	ReceiveFax() (*FaxResult, error)
	SendFax(doc, id, headerInfo string) (*FaxResult, error)
	SendFaxStop(ctrlID *string) error
	ReceiveFaxAsync() (*FaxAction, error)
	SendFaxAsync(doc, id, headerInfo string) (*FaxAction, error)
	WaitFor(state CallState, timeout uint) bool
	WaitForRinging(timeout uint) bool
	WaitForAnswered(timeout uint) bool
	WaitForEnding(timeout uint) bool
	WaitForEnded(timeout uint) bool
	Active() bool
	GetState() CallState
	GetPrevState() CallState
	GetID() string
	GetTempID() string
	GetTo() string
	GetFrom() string
}

ICallObj these are for unit-testing

type ICalling

type ICalling interface {
	DialPhone(fromNumber, toNumber string) ResultDial
	NewCall() *CallObj
	Dial(c *CallObj) ResultDial
}

ICalling object visible to the end user

type IClientSession

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

IClientSession TODO DESCRIPTION

type IConsumer

type IConsumer interface {
	Setup(projectID, token string)
	Stop()
	Run()
}

IConsumer TODO DESCRIPTION

type IDetectAction

type IDetectAction interface {
	Stop()
	// contains filtered or unexported methods
}

IDetectAction TODO DESCRIPTION

type IEventCalling

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

IEventCalling TODO DESCRIPTION

type IEventMessaging

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

IEventMessaging TODO DESCRIPTION

type IEventTasking

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

IEventTasking TODO DESCRIPTION

type IFaxAction

type IFaxAction interface {
	Stop()
	GetCompleted() bool
	GetResult() FaxResult
	// contains filtered or unexported methods
}

IFaxAction unit-tests only

type IMessaging

type IMessaging interface {
	Send(signalwireContext, fromNumber, toNumber, text string) *SendResult
	NewMessage() *MsgObj
	SendMsg(m *MsgObj) *SendResult
}

IMessaging object visible to the end user

type IMsg

type IMsg interface {
	MsgInit(ctx context.Context)
	MsgCleanup(ctx context.Context)
	UpdateCallState(s CallState)
	WaitMsgState(ctx context.Context, want MsgState) bool
}

IMsg Msg Interface

type IMsgObj

type IMsgObj interface {
	SetMedia(media []string)
	SetTags(tags []string)
	SetRegion(params string)
	GetFrom() string
	GetTo() string
	GetBody() string
	GetMedia() []string
}

IMsgObj TODO DESCRIPTION

type IPlayAction

type IPlayAction interface {
	Stop()
	GetCompleted() bool
	GetResult() PlayResult
	Volume() error
	Pause() error
	Resume() error
	// contains filtered or unexported methods
}

IPlayAction TODO DESCRIPTION

type IPromptAction

type IPromptAction interface {
	Stop()
	GetCompleted() bool
	GetResult() PlayResult
	Volume(vol float64) (*PlayVolumeResult, error)
	GetEvent() *json.RawMessage
	// contains filtered or unexported methods
}

IPromptAction TODO DESCRIPTION

type IRecordAction

type IRecordAction interface {
	Stop()
	// contains filtered or unexported methods
}

IRecordAction TODO DESCRIPTION

type IRelay

type IRelay interface {
	/*calling*/
	RelayPhoneDial(ctx context.Context, call *CallSession, fromNumber string, toNumber string, timeout uint, payload **json.RawMessage) error
	RelayPhoneConnect(ctx context.Context, call *CallSession, fromNumber string, toNumber string, payload **json.RawMessage) error
	RelayCallEnd(ctx context.Context, call *CallSession, payload **json.RawMessage) error
	RelayStop(ctx context.Context) error
	RelayOnInboundAnswer(ctx context.Context) (*CallSession, error)
	RelayPlayAudio(ctx context.Context, call *CallSession, ctrlID string, url string, payload **json.RawMessage) error
	RelayRecordAudio(ctx context.Context, call *CallSession, ctrlID string, rec *RecordParams, payload **json.RawMessage) error
	RelayRecordAudioStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayConnect(ctx context.Context, call *CallSession, ringback *[]RingbackStruct, devices *[][]DeviceStruct, payload **json.RawMessage) error
	RelayCallAnswer(ctx context.Context, call *CallSession, payload **json.RawMessage) error
	RelayPlayTTS(ctx context.Context, call *CallSession, ctrlID string, tts *TTSParamsInternal, payload **json.RawMessage) error
	RelayPlayRingtone(ctx context.Context, call *CallSession, ctrlID string, name string, duration float64, payload **json.RawMessage) error
	RelayPlaySilence(ctx context.Context, call *CallSession, ctrlID string, duration float64, payload **json.RawMessage) error
	RelayPlay(ctx context.Context, call *CallSession, controlID string, play []PlayStruct, payload **json.RawMessage) error
	RelayPlayVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error
	RelayPlayResume(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayPlayPause(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayPlayStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayDetectDigit(ctx context.Context, call *CallSession, controlID string, digits string, timeout float64, payload **json.RawMessage) error
	RelayDetectFax(ctx context.Context, call *CallSession, controlID string, faxtone string, timeout float64, payload **json.RawMessage) error
	RelayDetectMachine(ctx context.Context, call *CallSession, controlID string, det *DetectMachineParamsInternal, timeout float64, payload **json.RawMessage) error
	RelayDetect(ctx context.Context, call *CallSession, controlID string, detect DetectStruct, timeout float64, payload **json.RawMessage) error
	RelayDetectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelaySendFax(ctx context.Context, call *CallSession, ctrlID *string, fax *FaxParamsInternal, payload **json.RawMessage) error
	RelayReceiveFax(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelaySendFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayReceiveFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelayTapAudio(ctx context.Context, call *CallSession, ctrlID, direction string, device *TapDevice, payload **json.RawMessage) (TapDevice, error)
	RelayTap(ctx context.Context, call *CallSession, controlID string, tap TapStruct, device *TapDevice, payload **json.RawMessage) (TapDevice, error)
	RelayTapStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	RelaySendDigits(ctx context.Context, call *CallSession, controlID, digits string, payload **json.RawMessage) error
	RelayPlayAndCollect(ctx context.Context, call *CallSession, controlID string, playlist *[]PlayStruct, collect *CollectStruct, payload **json.RawMessage) error
	RelayPlayAndCollectVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error
	RelayPlayAndCollectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error
	/*messaging*/
	RelaySendMessage(ctx context.Context, msg *MsgSession, fromNumber, toNumber, signalwireContext, msgBody string) (string, error)
	/*tasking*/
	RelayTaskDeliver(context.Context, string, string, string, string, []byte) error
}

IRelay TODO DESCRIPTION

type ISendDigits

type ISendDigits interface {
	GetCompleted() bool
	GetResult() SendDigitsResult
}

ISendDigits TODO DESCRIPTION

type ISessionControl

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

ISessionControl TODO DESCRIPTION

type ITagToCallID

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

ITagToCallID TODO DESCRIPTION

type ITapAction

type ITapAction interface {
	Stop()
	GetCompleted() bool
	GetResult() TapResult
	GetTap() Tap
	GetSourceDevice() TapDevice
	GetDestinationDevice() TapDevice
	// contains filtered or unexported methods
}

ITapAction TODO DESCRIPTION

type ITasking

type ITasking interface {
	Deliver(signalwireContext string, params interface{}) error
}

ITasking object visible to the end user

type JError

type JError struct {
	Code    int64
	Message string
}

JError TODO DESCRIPTION

type Jsonrpc2Logger

type Jsonrpc2Logger struct{}

Jsonrpc2Logger is a wrapper for sourcegraph jsonrpc2 logger

func (*Jsonrpc2Logger) Printf

func (l *Jsonrpc2Logger) Printf(format string, args ...interface{})

Printf is a logger for Jsonrpc2 library

type LoggerWrapper

type LoggerWrapper interface {
	Trace(format string, args ...interface{})
	Debug(format string, args ...interface{})
	Info(format string, args ...interface{})
	Warn(format string, args ...interface{})
	Error(format string, args ...interface{})
	Fatal(format string, args ...interface{})
	Panic(format string, args ...interface{})

	SetLevel(level int)
}

LoggerWrapper defines custom logger interface

Log is a global logger

type Messaging

type Messaging struct {
	Ctx    context.Context
	Cancel context.CancelFunc
	Relay  *RelaySession
}

Messaging TODO DESCRIPTION

func (*Messaging) NewMessage

func (messaging *Messaging) NewMessage(signalwireContext, from, to, text string) *MsgObj

NewMessage TODO DESCRIPTION

func (*Messaging) Send

func (messaging *Messaging) Send(fromNumber, toNumber, signalwireContext, msgBody string) *SendResult

Send TODO DESCRIPTION

func (*Messaging) SendMsg

func (messaging *Messaging) SendMsg(mObj *MsgObj) *SendResult

SendMsg TODO DESCRIPTION

type MockIBlade

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

MockIBlade is a mock of IBlade interface

func NewMockIBlade

func NewMockIBlade(ctrl *gomock.Controller) *MockIBlade

NewMockIBlade creates a new mock instance

func (*MockIBlade) BladeAddSubscription

func (m *MockIBlade) BladeAddSubscription(ctx context.Context, signalwireChannels []string) error

BladeAddSubscription mocks base method

func (*MockIBlade) BladeCleanup

func (m *MockIBlade) BladeCleanup() error

BladeCleanup mocks base method

func (*MockIBlade) BladeConnect

func (m *MockIBlade) BladeConnect(ctx context.Context, bladeAuth *BladeAuth) error

BladeConnect mocks base method

func (*MockIBlade) BladeDisconnect

func (m *MockIBlade) BladeDisconnect(ctx context.Context) error

BladeDisconnect mocks base method

func (*MockIBlade) BladeExecute

func (m *MockIBlade) BladeExecute(ctx context.Context, v, res interface{}) (interface{}, error)

BladeExecute mocks base method

func (*MockIBlade) BladeInit

func (m *MockIBlade) BladeInit(ctx context.Context, addr string) error

BladeInit mocks base method

func (*MockIBlade) BladeSetup

func (m *MockIBlade) BladeSetup(ctx context.Context) error

BladeSetup mocks base method

func (*MockIBlade) BladeSignalwireReceive

func (m *MockIBlade) BladeSignalwireReceive(ctx context.Context, signalwireContexts []string) error

BladeSignalwireReceive mocks base method

func (*MockIBlade) BladeWSOpenConn

func (m *MockIBlade) BladeWSOpenConn(ctx context.Context, u url.URL) (*websocket.Conn, error)

BladeWSOpenConn mocks base method

func (*MockIBlade) BladeWSWatchConn

func (m *MockIBlade) BladeWSWatchConn(ctx context.Context)

BladeWSWatchConn mocks base method

func (*MockIBlade) BladeWaitDisconnect

func (m *MockIBlade) BladeWaitDisconnect(ctx context.Context) int

BladeWaitDisconnect mocks base method

func (*MockIBlade) BladeWaitInboundCall

func (m *MockIBlade) BladeWaitInboundCall(ctx context.Context) (*CallSession, error)

BladeWaitInboundCall mocks base method

func (*MockIBlade) EXPECT

func (m *MockIBlade) EXPECT() *MockIBladeMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockIBlade) GetConnection

func (m *MockIBlade) GetConnection() (*jsonrpc2.Conn, error)

GetConnection mocks base method

type MockIBladeMockRecorder

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

MockIBladeMockRecorder is the mock recorder for MockIBlade

func (*MockIBladeMockRecorder) BladeAddSubscription

func (mr *MockIBladeMockRecorder) BladeAddSubscription(ctx, signalwireChannels interface{}) *gomock.Call

BladeAddSubscription indicates an expected call of BladeAddSubscription

func (*MockIBladeMockRecorder) BladeCleanup

func (mr *MockIBladeMockRecorder) BladeCleanup() *gomock.Call

BladeCleanup indicates an expected call of BladeCleanup

func (*MockIBladeMockRecorder) BladeConnect

func (mr *MockIBladeMockRecorder) BladeConnect(ctx, bladeAuth interface{}) *gomock.Call

BladeConnect indicates an expected call of BladeConnect

func (*MockIBladeMockRecorder) BladeDisconnect

func (mr *MockIBladeMockRecorder) BladeDisconnect(ctx interface{}) *gomock.Call

BladeDisconnect indicates an expected call of BladeDisconnect

func (*MockIBladeMockRecorder) BladeExecute

func (mr *MockIBladeMockRecorder) BladeExecute(ctx, v, res interface{}) *gomock.Call

BladeExecute indicates an expected call of BladeExecute

func (*MockIBladeMockRecorder) BladeInit

func (mr *MockIBladeMockRecorder) BladeInit(ctx, addr interface{}) *gomock.Call

BladeInit indicates an expected call of BladeInit

func (*MockIBladeMockRecorder) BladeSetup

func (mr *MockIBladeMockRecorder) BladeSetup(ctx interface{}) *gomock.Call

BladeSetup indicates an expected call of BladeSetup

func (*MockIBladeMockRecorder) BladeSignalwireReceive

func (mr *MockIBladeMockRecorder) BladeSignalwireReceive(ctx, signalwireContexts interface{}) *gomock.Call

BladeSignalwireReceive indicates an expected call of BladeSignalwireReceive

func (*MockIBladeMockRecorder) BladeWSOpenConn

func (mr *MockIBladeMockRecorder) BladeWSOpenConn(ctx, u interface{}) *gomock.Call

BladeWSOpenConn indicates an expected call of BladeWSOpenConn

func (*MockIBladeMockRecorder) BladeWSWatchConn

func (mr *MockIBladeMockRecorder) BladeWSWatchConn(ctx interface{}) *gomock.Call

BladeWSWatchConn indicates an expected call of BladeWSWatchConn

func (*MockIBladeMockRecorder) BladeWaitDisconnect

func (mr *MockIBladeMockRecorder) BladeWaitDisconnect(ctx interface{}) *gomock.Call

BladeWaitDisconnect indicates an expected call of BladeWaitDisconnect

func (*MockIBladeMockRecorder) BladeWaitInboundCall

func (mr *MockIBladeMockRecorder) BladeWaitInboundCall(ctx interface{}) *gomock.Call

BladeWaitInboundCall indicates an expected call of BladeWaitInboundCall

func (*MockIBladeMockRecorder) GetConnection

func (mr *MockIBladeMockRecorder) GetConnection() *gomock.Call

GetConnection indicates an expected call of GetConnection

type MockICall

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

MockICall is a mock of ICall interface

func NewMockICall

func NewMockICall(ctrl *gomock.Controller) *MockICall

NewMockICall creates a new mock instance

func (*MockICall) CallCleanup

func (m *MockICall) CallCleanup(ctx context.Context)

CallCleanup mocks base method

func (*MockICall) CallInit

func (m *MockICall) CallInit(ctx context.Context)

CallInit mocks base method

func (*MockICall) EXPECT

func (m *MockICall) EXPECT() *MockICallMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockICall) GetPeer

func (m *MockICall) GetPeer(ctx context.Context)

GetPeer mocks base method

func (*MockICall) UpdateCallConnectState

func (m *MockICall) UpdateCallConnectState(s CallConnectState)

UpdateCallConnectState mocks base method

func (*MockICall) UpdateCallState

func (m *MockICall) UpdateCallState(s CallState)

UpdateCallState mocks base method

func (*MockICall) UpdateConnectPeer

func (m *MockICall) UpdateConnectPeer(p PeerDeviceStruct)

UpdateConnectPeer mocks base method

func (*MockICall) WaitCallConnectState

func (m *MockICall) WaitCallConnectState(ctx context.Context, want CallConnectState) bool

WaitCallConnectState mocks base method

func (*MockICall) WaitCallState

func (m *MockICall) WaitCallState(ctx context.Context, want CallState) bool

WaitCallState mocks base method

func (*MockICall) WaitPlayState

func (m *MockICall) WaitPlayState(ctx context.Context, ctrlID string, want PlayState) bool

WaitPlayState mocks base method

func (*MockICall) WaitRecordState

func (m *MockICall) WaitRecordState(ctx context.Context, ctrlID string, want RecordState) bool

WaitRecordState mocks base method

type MockICallMockRecorder

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

MockICallMockRecorder is the mock recorder for MockICall

func (*MockICallMockRecorder) CallCleanup

func (mr *MockICallMockRecorder) CallCleanup(ctx interface{}) *gomock.Call

CallCleanup indicates an expected call of CallCleanup

func (*MockICallMockRecorder) CallInit

func (mr *MockICallMockRecorder) CallInit(ctx interface{}) *gomock.Call

CallInit indicates an expected call of CallInit

func (*MockICallMockRecorder) GetPeer

func (mr *MockICallMockRecorder) GetPeer(ctx interface{}) *gomock.Call

GetPeer indicates an expected call of GetPeer

func (*MockICallMockRecorder) UpdateCallConnectState

func (mr *MockICallMockRecorder) UpdateCallConnectState(s interface{}) *gomock.Call

UpdateCallConnectState indicates an expected call of UpdateCallConnectState

func (*MockICallMockRecorder) UpdateCallState

func (mr *MockICallMockRecorder) UpdateCallState(s interface{}) *gomock.Call

UpdateCallState indicates an expected call of UpdateCallState

func (*MockICallMockRecorder) UpdateConnectPeer

func (mr *MockICallMockRecorder) UpdateConnectPeer(p interface{}) *gomock.Call

UpdateConnectPeer indicates an expected call of UpdateConnectPeer

func (*MockICallMockRecorder) WaitCallConnectState

func (mr *MockICallMockRecorder) WaitCallConnectState(ctx, want interface{}) *gomock.Call

WaitCallConnectState indicates an expected call of WaitCallConnectState

func (*MockICallMockRecorder) WaitCallState

func (mr *MockICallMockRecorder) WaitCallState(ctx, want interface{}) *gomock.Call

WaitCallState indicates an expected call of WaitCallState

func (*MockICallMockRecorder) WaitPlayState

func (mr *MockICallMockRecorder) WaitPlayState(ctx, ctrlID, want interface{}) *gomock.Call

WaitPlayState indicates an expected call of WaitPlayState

func (*MockICallMockRecorder) WaitRecordState

func (mr *MockICallMockRecorder) WaitRecordState(ctx, ctrlID, want interface{}) *gomock.Call

WaitRecordState indicates an expected call of WaitRecordState

type MockIClientSession

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

MockIClientSession is a mock of IClientSession interface

func NewMockIClientSession

func NewMockIClientSession(ctrl *gomock.Controller) *MockIClientSession

NewMockIClientSession creates a new mock instance

func (*MockIClientSession) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockIClientSessionMockRecorder

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

MockIClientSessionMockRecorder is the mock recorder for MockIClientSession

type MockIEventCalling

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

MockIEventCalling is a mock of IEventCalling interface

func NewMockIEventCalling

func NewMockIEventCalling(ctrl *gomock.Controller) *MockIEventCalling

NewMockIEventCalling creates a new mock instance

func (*MockIEventCalling) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockIEventCallingMockRecorder

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

MockIEventCallingMockRecorder is the mock recorder for MockIEventCalling

type MockIEventMessaging

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

MockIEventMessaging is a mock of IEventMessaging interface

func NewMockIEventMessaging

func NewMockIEventMessaging(ctrl *gomock.Controller) *MockIEventMessaging

NewMockIEventMessaging creates a new mock instance

func (*MockIEventMessaging) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockIEventMessagingMockRecorder

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

MockIEventMessagingMockRecorder is the mock recorder for MockIEventMessaging

type MockIEventTasking

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

MockIEventTasking is a mock of IEventTasking interface

func NewMockIEventTasking

func NewMockIEventTasking(ctrl *gomock.Controller) *MockIEventTasking

NewMockIEventTasking creates a new mock instance

func (*MockIEventTasking) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockIEventTaskingMockRecorder

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

MockIEventTaskingMockRecorder is the mock recorder for MockIEventTasking

type MockIRelay

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

MockIRelay is a mock of IRelay interface

func NewMockIRelay

func NewMockIRelay(ctrl *gomock.Controller) *MockIRelay

NewMockIRelay creates a new mock instance

func (*MockIRelay) EXPECT

func (m *MockIRelay) EXPECT() *MockIRelayMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockIRelay) RelayCallAnswer

func (m *MockIRelay) RelayCallAnswer(ctx context.Context, call *CallSession, payload **json.RawMessage) error

RelayCallAnswer mocks base method

func (*MockIRelay) RelayCallEnd

func (m *MockIRelay) RelayCallEnd(ctx context.Context, call *CallSession, payload **json.RawMessage) error

RelayCallEnd mocks base method

func (*MockIRelay) RelayConnect

func (m *MockIRelay) RelayConnect(ctx context.Context, call *CallSession, ringback *[]RingbackStruct, devices *[][]DeviceStruct, payload **json.RawMessage) error

RelayConnect mocks base method

func (*MockIRelay) RelayDetect

func (m *MockIRelay) RelayDetect(ctx context.Context, call *CallSession, controlID string, detect DetectStruct, payload **json.RawMessage) error

RelayDetect mocks base method

func (*MockIRelay) RelayDetectDigit

func (m *MockIRelay) RelayDetectDigit(ctx context.Context, call *CallSession, controlID, digits string, payload **json.RawMessage) error

RelayDetectDigit mocks base method

func (*MockIRelay) RelayDetectFax

func (m *MockIRelay) RelayDetectFax(ctx context.Context, call *CallSession, controlID, faxtone string, payload **json.RawMessage) error

RelayDetectFax mocks base method

func (*MockIRelay) RelayDetectMachine

func (m *MockIRelay) RelayDetectMachine(ctx context.Context, call *CallSession, controlID string, det *DetectMachineParams, payload **json.RawMessage) error

RelayDetectMachine mocks base method

func (*MockIRelay) RelayDetectStop

func (m *MockIRelay) RelayDetectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayDetectStop mocks base method

func (*MockIRelay) RelayOnInboundAnswer

func (m *MockIRelay) RelayOnInboundAnswer(ctx context.Context) (*CallSession, error)

RelayOnInboundAnswer mocks base method

func (*MockIRelay) RelayPhoneConnect

func (m *MockIRelay) RelayPhoneConnect(ctx context.Context, call *CallSession, fromNumber, toNumber string, payload **json.RawMessage) error

RelayPhoneConnect mocks base method

func (*MockIRelay) RelayPhoneDial

func (m *MockIRelay) RelayPhoneDial(ctx context.Context, call *CallSession, fromNumber, toNumber string, timeout uint, payload **json.RawMessage) error

RelayPhoneDial mocks base method

func (*MockIRelay) RelayPlay

func (m *MockIRelay) RelayPlay(ctx context.Context, call *CallSession, controlID string, play []PlayStruct, payload **json.RawMessage) error

RelayPlay mocks base method

func (*MockIRelay) RelayPlayAndCollect

func (m *MockIRelay) RelayPlayAndCollect(ctx context.Context, call *CallSession, controlID string, playlist *[]PlayStruct, collect *CollectStruct, payload **json.RawMessage) error

RelayPlayAndCollect mocks base method

func (*MockIRelay) RelayPlayAndCollectStop

func (m *MockIRelay) RelayPlayAndCollectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayAndCollectStop mocks base method

func (*MockIRelay) RelayPlayAndCollectVolume

func (m *MockIRelay) RelayPlayAndCollectVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error

RelayPlayAndCollectVolume mocks base method

func (*MockIRelay) RelayPlayAudio

func (m *MockIRelay) RelayPlayAudio(ctx context.Context, call *CallSession, ctrlID, url string, payload **json.RawMessage) error

RelayPlayAudio mocks base method

func (*MockIRelay) RelayPlayPause

func (m *MockIRelay) RelayPlayPause(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayPause mocks base method

func (*MockIRelay) RelayPlayResume

func (m *MockIRelay) RelayPlayResume(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayResume mocks base method

func (*MockIRelay) RelayPlayRingtone

func (m *MockIRelay) RelayPlayRingtone(ctx context.Context, call *CallSession, ctrlID, name string, duration float64, payload **json.RawMessage) error

RelayPlayRingtone mocks base method

func (*MockIRelay) RelayPlaySilence

func (m *MockIRelay) RelayPlaySilence(ctx context.Context, call *CallSession, ctrlID string, duration float64, payload **json.RawMessage) error

RelayPlaySilence mocks base method

func (*MockIRelay) RelayPlayStop

func (m *MockIRelay) RelayPlayStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayStop mocks base method

func (*MockIRelay) RelayPlayTTS

func (m *MockIRelay) RelayPlayTTS(ctx context.Context, call *CallSession, ctrlID, text, language, gender string, payload **json.RawMessage) error

RelayPlayTTS mocks base method

func (*MockIRelay) RelayPlayVolume

func (m *MockIRelay) RelayPlayVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error

RelayPlayVolume mocks base method

func (*MockIRelay) RelayReceiveFax

func (m *MockIRelay) RelayReceiveFax(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayReceiveFax mocks base method

func (*MockIRelay) RelayReceiveFaxStop

func (m *MockIRelay) RelayReceiveFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayReceiveFaxStop mocks base method

func (*MockIRelay) RelayRecordAudio

func (m *MockIRelay) RelayRecordAudio(ctx context.Context, call *CallSession, ctrlID string, rec *RecordParams, payload **json.RawMessage) error

RelayRecordAudio mocks base method

func (*MockIRelay) RelayRecordAudioStop

func (m *MockIRelay) RelayRecordAudioStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayRecordAudioStop mocks base method

func (*MockIRelay) RelaySendDigits

func (m *MockIRelay) RelaySendDigits(ctx context.Context, call *CallSession, controlID, digits string, payload **json.RawMessage) error

RelaySendDigits mocks base method

func (*MockIRelay) RelaySendFax

func (m *MockIRelay) RelaySendFax(ctx context.Context, call *CallSession, ctrlID *string, fax *FaxParamsInternal, payload **json.RawMessage) error

RelaySendFax mocks base method

func (*MockIRelay) RelaySendFaxStop

func (m *MockIRelay) RelaySendFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelaySendFaxStop mocks base method

func (*MockIRelay) RelaySendMessage

func (m *MockIRelay) RelaySendMessage(ctx context.Context, msg *MsgSession, fromNumber, toNumber, signalwireContext, msgBody string) (string, error)

RelaySendMessage mocks base method

func (*MockIRelay) RelayStop

func (m *MockIRelay) RelayStop(ctx context.Context) error

RelayStop mocks base method

func (*MockIRelay) RelayTap

func (m *MockIRelay) RelayTap(ctx context.Context, call *CallSession, controlID string, tap TapStruct, device *TapDevice, payload **json.RawMessage) (TapDevice, error)

RelayTap mocks base method

func (*MockIRelay) RelayTapAudio

func (m *MockIRelay) RelayTapAudio(ctx context.Context, call *CallSession, ctrlID, direction string, device *TapDevice, payload **json.RawMessage) (TapDevice, error)

RelayTapAudio mocks base method

func (*MockIRelay) RelayTapStop

func (m *MockIRelay) RelayTapStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayTapStop mocks base method

func (*MockIRelay) RelayTaskDeliver

func (m *MockIRelay) RelayTaskDeliver(arg0 context.Context, arg1, arg2, arg3, arg4 string, arg5 []byte) error

RelayTaskDeliver mocks base method

type MockIRelayMockRecorder

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

MockIRelayMockRecorder is the mock recorder for MockIRelay

func (*MockIRelayMockRecorder) RelayCallAnswer

func (mr *MockIRelayMockRecorder) RelayCallAnswer(ctx, call, payload interface{}) *gomock.Call

RelayCallAnswer indicates an expected call of RelayCallAnswer

func (*MockIRelayMockRecorder) RelayCallEnd

func (mr *MockIRelayMockRecorder) RelayCallEnd(ctx, call, payload interface{}) *gomock.Call

RelayCallEnd indicates an expected call of RelayCallEnd

func (*MockIRelayMockRecorder) RelayConnect

func (mr *MockIRelayMockRecorder) RelayConnect(ctx, call, ringback, devices, payload interface{}) *gomock.Call

RelayConnect indicates an expected call of RelayConnect

func (*MockIRelayMockRecorder) RelayDetect

func (mr *MockIRelayMockRecorder) RelayDetect(ctx, call, controlID, detect, payload interface{}) *gomock.Call

RelayDetect indicates an expected call of RelayDetect

func (*MockIRelayMockRecorder) RelayDetectDigit

func (mr *MockIRelayMockRecorder) RelayDetectDigit(ctx, call, controlID, digits, payload interface{}) *gomock.Call

RelayDetectDigit indicates an expected call of RelayDetectDigit

func (*MockIRelayMockRecorder) RelayDetectFax

func (mr *MockIRelayMockRecorder) RelayDetectFax(ctx, call, controlID, faxtone, payload interface{}) *gomock.Call

RelayDetectFax indicates an expected call of RelayDetectFax

func (*MockIRelayMockRecorder) RelayDetectMachine

func (mr *MockIRelayMockRecorder) RelayDetectMachine(ctx, call, controlID, det, payload interface{}) *gomock.Call

RelayDetectMachine indicates an expected call of RelayDetectMachine

func (*MockIRelayMockRecorder) RelayDetectStop

func (mr *MockIRelayMockRecorder) RelayDetectStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayDetectStop indicates an expected call of RelayDetectStop

func (*MockIRelayMockRecorder) RelayOnInboundAnswer

func (mr *MockIRelayMockRecorder) RelayOnInboundAnswer(ctx interface{}) *gomock.Call

RelayOnInboundAnswer indicates an expected call of RelayOnInboundAnswer

func (*MockIRelayMockRecorder) RelayPhoneConnect

func (mr *MockIRelayMockRecorder) RelayPhoneConnect(ctx, call, fromNumber, toNumber, payload interface{}) *gomock.Call

RelayPhoneConnect indicates an expected call of RelayPhoneConnect

func (*MockIRelayMockRecorder) RelayPhoneDial

func (mr *MockIRelayMockRecorder) RelayPhoneDial(ctx, call, fromNumber, toNumber, timeout, payload interface{}) *gomock.Call

RelayPhoneDial indicates an expected call of RelayPhoneDial

func (*MockIRelayMockRecorder) RelayPlay

func (mr *MockIRelayMockRecorder) RelayPlay(ctx, call, controlID, play, payload interface{}) *gomock.Call

RelayPlay indicates an expected call of RelayPlay

func (*MockIRelayMockRecorder) RelayPlayAndCollect

func (mr *MockIRelayMockRecorder) RelayPlayAndCollect(ctx, call, controlID, playlist, collect, payload interface{}) *gomock.Call

RelayPlayAndCollect indicates an expected call of RelayPlayAndCollect

func (*MockIRelayMockRecorder) RelayPlayAndCollectStop

func (mr *MockIRelayMockRecorder) RelayPlayAndCollectStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayPlayAndCollectStop indicates an expected call of RelayPlayAndCollectStop

func (*MockIRelayMockRecorder) RelayPlayAndCollectVolume

func (mr *MockIRelayMockRecorder) RelayPlayAndCollectVolume(ctx, call, ctrlID, vol, payload interface{}) *gomock.Call

RelayPlayAndCollectVolume indicates an expected call of RelayPlayAndCollectVolume

func (*MockIRelayMockRecorder) RelayPlayAudio

func (mr *MockIRelayMockRecorder) RelayPlayAudio(ctx, call, ctrlID, url, payload interface{}) *gomock.Call

RelayPlayAudio indicates an expected call of RelayPlayAudio

func (*MockIRelayMockRecorder) RelayPlayPause

func (mr *MockIRelayMockRecorder) RelayPlayPause(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayPlayPause indicates an expected call of RelayPlayPause

func (*MockIRelayMockRecorder) RelayPlayResume

func (mr *MockIRelayMockRecorder) RelayPlayResume(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayPlayResume indicates an expected call of RelayPlayResume

func (*MockIRelayMockRecorder) RelayPlayRingtone

func (mr *MockIRelayMockRecorder) RelayPlayRingtone(ctx, call, ctrlID, name, duration, payload interface{}) *gomock.Call

RelayPlayRingtone indicates an expected call of RelayPlayRingtone

func (*MockIRelayMockRecorder) RelayPlaySilence

func (mr *MockIRelayMockRecorder) RelayPlaySilence(ctx, call, ctrlID, duration, payload interface{}) *gomock.Call

RelayPlaySilence indicates an expected call of RelayPlaySilence

func (*MockIRelayMockRecorder) RelayPlayStop

func (mr *MockIRelayMockRecorder) RelayPlayStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayPlayStop indicates an expected call of RelayPlayStop

func (*MockIRelayMockRecorder) RelayPlayTTS

func (mr *MockIRelayMockRecorder) RelayPlayTTS(ctx, call, ctrlID, text, language, gender, payload interface{}) *gomock.Call

RelayPlayTTS indicates an expected call of RelayPlayTTS

func (*MockIRelayMockRecorder) RelayPlayVolume

func (mr *MockIRelayMockRecorder) RelayPlayVolume(ctx, call, ctrlID, vol, payload interface{}) *gomock.Call

RelayPlayVolume indicates an expected call of RelayPlayVolume

func (*MockIRelayMockRecorder) RelayReceiveFax

func (mr *MockIRelayMockRecorder) RelayReceiveFax(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayReceiveFax indicates an expected call of RelayReceiveFax

func (*MockIRelayMockRecorder) RelayReceiveFaxStop

func (mr *MockIRelayMockRecorder) RelayReceiveFaxStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayReceiveFaxStop indicates an expected call of RelayReceiveFaxStop

func (*MockIRelayMockRecorder) RelayRecordAudio

func (mr *MockIRelayMockRecorder) RelayRecordAudio(ctx, call, ctrlID, rec, payload interface{}) *gomock.Call

RelayRecordAudio indicates an expected call of RelayRecordAudio

func (*MockIRelayMockRecorder) RelayRecordAudioStop

func (mr *MockIRelayMockRecorder) RelayRecordAudioStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayRecordAudioStop indicates an expected call of RelayRecordAudioStop

func (*MockIRelayMockRecorder) RelaySendDigits

func (mr *MockIRelayMockRecorder) RelaySendDigits(ctx, call, controlID, digits, payload interface{}) *gomock.Call

RelaySendDigits indicates an expected call of RelaySendDigits

func (*MockIRelayMockRecorder) RelaySendFax

func (mr *MockIRelayMockRecorder) RelaySendFax(ctx, call, ctrlID, fax, payload interface{}) *gomock.Call

RelaySendFax indicates an expected call of RelaySendFax

func (*MockIRelayMockRecorder) RelaySendFaxStop

func (mr *MockIRelayMockRecorder) RelaySendFaxStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelaySendFaxStop indicates an expected call of RelaySendFaxStop

func (*MockIRelayMockRecorder) RelaySendMessage

func (mr *MockIRelayMockRecorder) RelaySendMessage(ctx, msg, fromNumber, toNumber, signalwireContext, msgBody interface{}) *gomock.Call

RelaySendMessage indicates an expected call of RelaySendMessage

func (*MockIRelayMockRecorder) RelayStop

func (mr *MockIRelayMockRecorder) RelayStop(ctx interface{}) *gomock.Call

RelayStop indicates an expected call of RelayStop

func (*MockIRelayMockRecorder) RelayTap

func (mr *MockIRelayMockRecorder) RelayTap(ctx, call, controlID, tap, device, payload interface{}) *gomock.Call

RelayTap indicates an expected call of RelayTap

func (*MockIRelayMockRecorder) RelayTapAudio

func (mr *MockIRelayMockRecorder) RelayTapAudio(ctx, call, ctrlID, direction, device, payload interface{}) *gomock.Call

RelayTapAudio indicates an expected call of RelayTapAudio

func (*MockIRelayMockRecorder) RelayTapStop

func (mr *MockIRelayMockRecorder) RelayTapStop(ctx, call, ctrlID, payload interface{}) *gomock.Call

RelayTapStop indicates an expected call of RelayTapStop

func (*MockIRelayMockRecorder) RelayTaskDeliver

func (mr *MockIRelayMockRecorder) RelayTaskDeliver(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

RelayTaskDeliver indicates an expected call of RelayTaskDeliver

type MockISessionControl

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

MockISessionControl is a mock of ISessionControl interface

func NewMockISessionControl

func NewMockISessionControl(ctrl *gomock.Controller) *MockISessionControl

NewMockISessionControl creates a new mock instance

func (*MockISessionControl) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockISessionControlMockRecorder

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

MockISessionControlMockRecorder is the mock recorder for MockISessionControl

type MockITagToCallID

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

MockITagToCallID is a mock of ITagToCallID interface

func NewMockITagToCallID

func NewMockITagToCallID(ctrl *gomock.Controller) *MockITagToCallID

NewMockITagToCallID creates a new mock instance

func (*MockITagToCallID) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockITagToCallIDMockRecorder

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

MockITagToCallIDMockRecorder is the mock recorder for MockITagToCallID

type MsgDirection

type MsgDirection int

MsgDirection Message Direction (in or out)

const (
	MsgInbound MsgDirection = iota
	MsgOutbound
)

Call state constants

func (MsgDirection) String

func (s MsgDirection) String() string

type MsgObj

type MsgObj struct {
	I                    IMsgObj
	Messaging            *Messaging
	OnMessageStateChange func(*SendResult)
	OnMessageQueued      func(*SendResult)
	OnMessageInitiated   func(*SendResult)
	OnMessageSent        func(*SendResult)
	OnMessageDelivered   func(*SendResult)
	OnMessageUndelivered func(*SendResult)
	OnMessageFailed      func(*SendResult)
	// contains filtered or unexported fields
}

MsgObj is the external Message object (as exposed to the user)

func MsgObjNew

func MsgObjNew() *MsgObj

MsgObjNew TODO DESCRIPTION

func (*MsgObj) GetBody

func (msgobj *MsgObj) GetBody() string

GetBody TODO DESCRIPTION

func (*MsgObj) GetFrom

func (msgobj *MsgObj) GetFrom() string

GetFrom TODO DESCRIPTION

func (*MsgObj) GetMedia

func (msgobj *MsgObj) GetMedia() []string

GetMedia TODO DESCRIPTION

func (*MsgObj) GetTo

func (msgobj *MsgObj) GetTo() string

GetTo TODO DESCRIPTION

func (*MsgObj) SetMedia

func (msgobj *MsgObj) SetMedia(media []string)

SetMedia TODO DESCRIPTION

func (*MsgObj) SetRegion

func (msgobj *MsgObj) SetRegion(region string)

SetRegion TODO DESCRIPTION

func (*MsgObj) SetTags

func (msgobj *MsgObj) SetTags(tags []string)

SetTags TODO DESCRIPTION

type MsgParams

type MsgParams struct {
	MsgID     string
	Context   string
	NodeID    string
	Direction MsgDirection
	To        string
	From      string
	MsgState  MsgState
	Segments  uint     // number of segments of the message
	Body      string   // body of the message
	Tags      []string // optional client data this call is tagged with
	Media     []string // an array of URLs to send in the message
	Reason    string   // reason: present on undelivered and failed.
	Region    string   //  region of the world to originate the call from.
}

MsgParams TODO DESCRIPTION

type MsgSession

type MsgSession struct {
	MsgParams MsgParams
	Blade     *BladeSession
	sync.RWMutex
	I            IMsg
	ReplyMsgID   chan string
	MsgStateChan chan MsgState
}

MsgSession internal representation of a text message

func (*MsgSession) GetBody

func (m *MsgSession) GetBody() string

GetBody TODO DESCRIPTION

func (*MsgSession) GetFailureReason

func (m *MsgSession) GetFailureReason() string

GetFailureReason TODO DESCRIPTION

func (*MsgSession) GetFrom

func (m *MsgSession) GetFrom() string

GetFrom TODO DESCRIPTION

func (*MsgSession) GetMedia

func (m *MsgSession) GetMedia() []string

GetMedia TODO DESCRIPTION

func (*MsgSession) GetMsgID

func (m *MsgSession) GetMsgID() string

GetMsgID TODO DESCRIPTION

func (*MsgSession) GetSegments

func (m *MsgSession) GetSegments() uint

GetSegments TODO DESCRIPTION

func (*MsgSession) GetState

func (m *MsgSession) GetState() MsgState

GetState TODO DESCRIPTION

func (*MsgSession) GetTo

func (m *MsgSession) GetTo() string

GetTo TODO DESCRIPTION

func (*MsgSession) MsgCleanup

func (m *MsgSession) MsgCleanup(_ context.Context)

MsgCleanup close the channels, etc app writer should set m to nil to clean it up

func (*MsgSession) MsgInit

func (m *MsgSession) MsgInit(_ context.Context)

MsgInit creates the channels communicating msg states

func (*MsgSession) SetBody

func (m *MsgSession) SetBody(body string)

SetBody TODO DESCRIPTION

func (*MsgSession) SetContext

func (m *MsgSession) SetContext(c string)

SetContext TODO DESCRIPTION

func (*MsgSession) SetFailureReason

func (m *MsgSession) SetFailureReason(reason string)

SetFailureReason TODO DESCRIPTION

func (*MsgSession) SetFrom

func (m *MsgSession) SetFrom(from string)

SetFrom TODO DESCRIPTION

func (*MsgSession) SetMedia

func (m *MsgSession) SetMedia(media []string)

SetMedia TODO DESCRIPTION

func (*MsgSession) SetMsgID

func (m *MsgSession) SetMsgID(msgID string)

SetMsgID TODO DESCRIPTION

func (*MsgSession) SetParams

func (m *MsgSession) SetParams(msgID, to, from, signalwireContext string, direction MsgDirection)

SetParams TODO DESCRIPTION

func (*MsgSession) SetRegion

func (m *MsgSession) SetRegion(region string)

SetRegion TODO DESCRIPTION

func (*MsgSession) SetTags

func (m *MsgSession) SetTags(tags []string)

SetTags TODO DESCRIPTION

func (*MsgSession) SetTo

func (m *MsgSession) SetTo(to string)

SetTo TODO DESCRIPTION

func (*MsgSession) UpdateMsgState

func (m *MsgSession) UpdateMsgState(s MsgState)

UpdateMsgState TODO DESCRIPTION

type MsgState

type MsgState int

MsgState keeps the state of a text message (sms)

const (
	MsgQueued MsgState = iota
	MsgInitiated
	MsgSent
	MsgDelivered
	MsgUndelivered
	MsgFailed
	MsgReceived
)

Msg state constants

func (MsgState) String

func (s MsgState) String() string

type NotifParamsBladeBroadcast

type NotifParamsBladeBroadcast struct {
	BroadcasterNodeID string                    `json:"broadcaster_nodeid"`
	Protocol          string                    `json:"protocol"`
	Channel           string                    `json:"channel"`
	Event             string                    `json:"event"`
	Params            ParamsQueueingRelayEvents `json:"params"`
}

NotifParamsBladeBroadcast TODO DESCRIPTION

type NotifParamsBladeNetcast

type NotifParamsBladeNetcast struct {
	NetcasterNodeID string             `json:"netcaster_nodeid"`
	Command         string             `json:"command"`
	Params          ParamsNetcastEvent `json:"params"`
}

NotifParamsBladeNetcast TODO DESCRIPTION

type ParamsAuthStruct

type ParamsAuthStruct struct {
	RequesterNodeID string `json:"requester_node_id"`
	ResponderNodeID string `json:"responder_node_id"`
	OriginalID      string `json:"original_id"`
	NodeID          string `json:"node_id"`
	ConnectionID    string `json:"connection_id"`
}

ParamsAuthStruct TODO DESCRIPTION

type ParamsBladeExecuteStruct

type ParamsBladeExecuteStruct struct {
	Protocol string              `json:"protocol"`
	Method   string              `json:"method"`
	Params   ParamsCommandStruct `json:"params"`
}

ParamsBladeExecuteStruct TODO DESCRIPTION

type ParamsCallAnswer

type ParamsCallAnswer struct {
	CallID string `json:"call_id"`
	NodeID string `json:"node_id"`
}

ParamsCallAnswer TODO DESCRIPTION

type ParamsCallConnectStruct

type ParamsCallConnectStruct struct {
	Ringback *[]RingbackStruct `json:"ringback,omitempty"`
	Devices  *[][]DeviceStruct `json:"devices"`
	NodeID   string            `json:"node_id"`
	CallID   string            `json:"call_id"`
	Tag      string            `json:"tag,omitempty"`
}

ParamsCallConnectStruct TODO DESCRIPTION

type ParamsCallDetect

type ParamsCallDetect struct {
	CallID    string       `json:"call_id"`
	NodeID    string       `json:"node_id"`
	ControlID string       `json:"control_id"`
	Detect    DetectStruct `json:"detect"`
	Timeout   float64      `json:"timeout,omitempty"`
}

ParamsCallDetect TODO DESCRIPTION

type ParamsCallDetectStop

type ParamsCallDetectStop ParamsGenericAction

ParamsCallDetectStop TODO DESCRIPTION

type ParamsCallEndStruct

type ParamsCallEndStruct struct {
	CallID string `json:"call_id"`
	NodeID string `json:"node_id"`
	Reason string `json:"reason"`
}

ParamsCallEndStruct TODO DESCRIPTION

type ParamsCallPlay

type ParamsCallPlay struct {
	CallID    string       `json:"call_id"`
	NodeID    string       `json:"node_id"`
	ControlID string       `json:"control_id"`
	Volume    float64      `json:"volume,omitempty"`
	Play      []PlayStruct `json:"play"`
}

ParamsCallPlay TODO DESCRIPTION

type ParamsCallPlayAndCollect

type ParamsCallPlayAndCollect struct {
	CallID    string        `json:"call_id"`
	NodeID    string        `json:"node_id"`
	ControlID string        `json:"control_id"`
	Volume    float64       `json:"volume,omitempty"`
	Play      []PlayStruct  `json:"play"`
	Collect   CollectStruct `json:"collect"`
}

ParamsCallPlayAndCollect TODO DESCRIPTION

type ParamsCallPlayPause

type ParamsCallPlayPause ParamsGenericAction

ParamsCallPlayPause TODO DESCRIPTION

type ParamsCallPlayResume

type ParamsCallPlayResume ParamsGenericAction

ParamsCallPlayResume TODO DESCRIPTION

type ParamsCallPlayStop

type ParamsCallPlayStop ParamsGenericAction

ParamsCallPlayStop TODO DESCRIPTION

type ParamsCallPlayVolume

type ParamsCallPlayVolume struct {
	CallID    string  `json:"call_id"`
	NodeID    string  `json:"node_id"`
	ControlID string  `json:"control_id"`
	Volume    float64 `json:"volume,omitempty"`
}

ParamsCallPlayVolume TODO DESCRIPTION

type ParamsCallRecord

type ParamsCallRecord struct {
	CallID    string       `json:"call_id"`
	NodeID    string       `json:"node_id"`
	ControlID string       `json:"control_id"`
	Record    RecordStruct `json:"record"`
}

ParamsCallRecord TODO DESCRIPTION

type ParamsCallRecordStop

type ParamsCallRecordStop ParamsGenericAction

ParamsCallRecordStop TODO DESCRIPTION

type ParamsCallSendDigits

type ParamsCallSendDigits struct {
	CallID    string `json:"call_id"`
	NodeID    string `json:"node_id"`
	ControlID string `json:"control_id"`
	Digits    string `json:"digits"`
}

ParamsCallSendDigits TODO DESCRIPTION

type ParamsCallTap

type ParamsCallTap struct {
	CallID    string    `json:"call_id"`
	NodeID    string    `json:"node_id"`
	ControlID string    `json:"control_id"`
	Tap       TapStruct `json:"tap"`
	Device    TapDevice `json:"device"`
}

ParamsCallTap TODO DESCRIPTION

type ParamsCallTapStop

type ParamsCallTapStop ParamsGenericAction

ParamsCallTapStop TODO DESCRIPTION

type ParamsCallingBeginStruct

type ParamsCallingBeginStruct struct {
	Device DeviceStruct `json:"device"`
	Tag    string       `json:"tag"`
}

ParamsCallingBeginStruct TODO DESCRIPTION

type ParamsCommandStruct

type ParamsCommandStruct interface{}

ParamsCommandStruct TODO DESCRIPTION

type ParamsConnectStruct

type ParamsConnectStruct struct {
	Version        BladeVersionStruct `json:"version"`
	SessionID      string             `json:"session_id"`
	Authentication AuthStruct         `json:"authentication"`
	Agent          string             `json:"agent"`
}

ParamsConnectStruct TODO DESCRIPTION

type ParamsDisconnect

type ParamsDisconnect struct{}

ParamsDisconnect - empty

type ParamsEventCallingCallConnect

type ParamsEventCallingCallConnect struct {
	ConnectState string           `json:"connect_state"`
	CallID       string           `json:"call_id"`
	NodeID       string           `json:"node_id"`
	TagID        string           `json:"tag"`
	Peer         PeerDeviceStruct `json:"peer"`
}

ParamsEventCallingCallConnect TODO DESCRIPTION

type ParamsEventCallingCallDetect

type ParamsEventCallingCallDetect struct {
	CallID    string            `json:"call_id"`
	NodeID    string            `json:"node_id"`
	ControlID string            `json:"control_id"`
	Detect    DetectEventStruct `json:"detect"`
}

ParamsEventCallingCallDetect TODO DESCRIPTION

type ParamsEventCallingCallPlay

type ParamsEventCallingCallPlay struct {
	PlayState string `json:"state"`
	CallID    string `json:"call_id"`
	NodeID    string `json:"node_id"`
	ControlID string `json:"control_id"`
}

ParamsEventCallingCallPlay TODO DESCRIPTION

type ParamsEventCallingCallPlayAndCollect

type ParamsEventCallingCallPlayAndCollect struct {
	CallID    string        `json:"call_id"`
	NodeID    string        `json:"node_id"`
	ControlID string        `json:"control_id"`
	Final     bool          `json:"final,omitempty"`
	Result    ResultCollect `json:"result"`
}

ParamsEventCallingCallPlayAndCollect TODO DESCRIPTION

type ParamsEventCallingCallReceive

type ParamsEventCallingCallReceive struct {
	CallState string       `json:"call_state"`
	Context   string       `json:"context"`
	Direction string       `json:"direction"`
	Device    DeviceStruct `json:"device"`
	CallID    string       `json:"call_id"`
	NodeID    string       `json:"node_id"`
	TagID     string       `json:"tag"`
}

ParamsEventCallingCallReceive TODO DESCRIPTION

type ParamsEventCallingCallRecord

type ParamsEventCallingCallRecord struct {
	CallID      string       `json:"call_id"`
	NodeID      string       `json:"node_id"`
	ControlID   string       `json:"control_id"`
	TagID       string       `json:"tag"`
	Params      ParamsRecord `json:"params"`
	RecordState string       `json:"state"`
	Duration    uint         `json:"duration"`
	URL         string       `json:"url"`
	Size        uint         `json:"size"`
}

ParamsEventCallingCallRecord TODO DESCRIPTION

type ParamsEventCallingCallSendDigits

type ParamsEventCallingCallSendDigits struct {
	SendDigitsState string `json:"state"`
	CallID          string `json:"call_id"`
	NodeID          string `json:"node_id"`
	ControlID       string `json:"control_id"`
}

ParamsEventCallingCallSendDigits TODO DESCRIPTION

type ParamsEventCallingCallState

type ParamsEventCallingCallState struct {
	CallState string       `json:"call_state"`
	Direction string       `json:"direction"`
	Device    DeviceStruct `json:"device"`
	EndReason string       `json:"end_reason"`
	CallID    string       `json:"call_id"`
	NodeID    string       `json:"node_id"`
	TagID     string       `json:"tag"`
}

ParamsEventCallingCallState TODO DESCRIPTION

type ParamsEventCallingCallTap

type ParamsEventCallingCallTap struct {
	TapState  string    `json:"state"`
	CallID    string    `json:"call_id"`
	NodeID    string    `json:"node_id"`
	ControlID string    `json:"control_id"`
	Tap       TapStruct `json:"tap"`
	Device    TapDevice `json:"device"`
}

ParamsEventCallingCallTap TODO DESCRIPTION

type ParamsEventCallingFax

type ParamsEventCallingFax struct {
	CallID    string         `json:"call_id"`
	NodeID    string         `json:"node_id"`
	ControlID string         `json:"control_id"`
	Fax       FaxEventStruct `json:"fax"`
}

ParamsEventCallingFax TODO DESCRIPTION

type ParamsEventDetect

type ParamsEventDetect struct {
	Event string `json:"event"`
}

ParamsEventDetect TODO DESCRIPTION

type ParamsEventMessagingState

type ParamsEventMessagingState struct {
	ToNumber     string   `json:"to_number"`
	FromNumber   string   `json:"from_number"`
	Direction    string   `json:"direction"`
	Context      string   `json:"context"`
	Body         string   `json:"body"`
	Tags         []string `json:"tags"`
	Media        []string `json:"media"`
	Segments     uint     `json:"segments"`
	MessageState string   `json:"message_state"`
	Reason       string   `json:"reason"`
	MsgID        string   `json:"message_id"`
}

ParamsEventMessagingState TODO DESCRIPTION

type ParamsEventTaskingTask

type ParamsEventTaskingTask struct {
	SpaceID      string      `json:"space_id"`
	ProjectID    string      `json:"project_id"`
	Context      string      `json:"context"`
	Message      interface{} `json:"message"`
	Timestamp    float64     `json:"timestamp"`
	EventChannel string      `json:"event_channel"`
}

ParamsEventTaskingTask TODO DESCRIPTION

type ParamsFaxStop

type ParamsFaxStop ParamsGenericAction

ParamsFaxStop TODO DESCRIPTION

type ParamsGenericAction

type ParamsGenericAction struct {
	CallID    string `json:"call_id"`
	NodeID    string `json:"node_id"`
	ControlID string `json:"control_id"`
}

ParamsGenericAction TODO DESCRIPTION

type ParamsMessagingSend

type ParamsMessagingSend struct {
	ToNumber   string   `json:"to_number"`
	FromNumber string   `json:"from_number"`
	Context    string   `json:"context"`
	Body       string   `json:"body"`
	Tags       []string `json:"tags,omitempty"`
	Region     string   `json:"region,omitempty"`
	Media      []string `json:"media,omitempty"`
}

ParamsMessagingSend TODO DESCRIPTION

type ParamsNetcastEvent

type ParamsNetcastEvent struct {
	Protocol string `json:"protocol"`
}

ParamsNetcastEvent TODO DESCRIPTION

type ParamsQueueingRelayEvents

type ParamsQueueingRelayEvents struct {
	EventType    string          `json:"event_type,omitempty"`
	EventChannel string          `json:"event_channel,omitempty"`
	Timestamp    float64         `json:"timestamp,omitempty"`
	Project      string          `json:"project_id,omitempty"`
	Space        string          `json:"space_id,omitempty"`
	Context      string          `json:"context,omitempty"`
	Message      json.RawMessage `json:"message,omitempty"`
	Params       interface{}     `json:"params"`
}

ParamsQueueingRelayEvents TODO DESCRIPTION

type ParamsRecord

type ParamsRecord struct {
	Audio AudioStruct `json:"audio"`
}

ParamsRecord TODO DESCRIPTION

type ParamsSendFax

type ParamsSendFax struct {
	CallID     string `json:"call_id"`
	NodeID     string `json:"node_id"`
	ControlID  string `json:"control_id"`
	Document   string `json:"document"`
	Identity   string `json:"identity,omitempty"`
	HeaderInfo string `json:"header_info,omitempty"`
}

ParamsSendFax TODO DESCRIPTION

type ParamsSignalwireReceive

type ParamsSignalwireReceive struct {
	Contexts []string `json:"contexts"`
}

ParamsSignalwireReceive TODO DESCRIPTION

type ParamsSignalwireSetupStruct

type ParamsSignalwireSetupStruct struct {
}

ParamsSignalwireSetupStruct TODO DESCRIPTION

type ParamsSignalwireStruct

type ParamsSignalwireStruct struct {
	Params ParamsSignalwireSetupStruct `json:"params"`

	Protocol string `json:"protocol"`
	Method   string `json:"method"`
}

ParamsSignalwireStruct TODO DESCRIPTION

type ParamsSubscriptionStruct

type ParamsSubscriptionStruct struct {
	Command  string   `json:"command"`
	Protocol string   `json:"protocol"`
	Channels []string `json:"channels"`
}

ParamsSubscriptionStruct TODO DESCRIPTION

type PeerDeviceStruct

type PeerDeviceStruct struct {
	CallID string       `json:"call_id"`
	NodeID string       `json:"node_id"`
	Device DeviceStruct `json:"device"`
}

PeerDeviceStruct TODO DESCRIPTION

type PeerStruct

type PeerStruct struct {
	CallID string `json:"call_id"`
	NodeID string `json:"node_id"`
}

PeerStruct TODO DESCRIPTION

type PlayAction

type PlayAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    PlayResult
	State     PlayState
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

PlayAction TODO DESCRIPTION

func (*PlayAction) GetCompleted

func (playaction *PlayAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*PlayAction) GetControlID

func (playaction *PlayAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*PlayAction) GetError

func (playaction *PlayAction) GetError() error

GetError TODO DESCRIPTION

func (*PlayAction) GetEvent

func (playaction *PlayAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*PlayAction) GetPayload

func (playaction *PlayAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*PlayAction) GetResult

func (playaction *PlayAction) GetResult() PlayResult

GetResult TODO DESCRIPTION

func (*PlayAction) GetState

func (playaction *PlayAction) GetState() PlayState

GetState TODO DESCRIPTION

func (*PlayAction) GetSuccessful

func (playaction *PlayAction) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

func (*PlayAction) PlayPause

func (playaction *PlayAction) PlayPause() (*PlayVolumeResult, error)

PlayPause TODO DESCRIPTION

func (*PlayAction) PlayResume

func (playaction *PlayAction) PlayResume() (*PlayVolumeResult, error)

PlayResume TODO DESCRIPTION

func (*PlayAction) PlayVolume

func (playaction *PlayAction) PlayVolume(vol float64) (*PlayVolumeResult, error)

PlayVolume TODO DESCRIPTION

func (*PlayAction) Stop

func (playaction *PlayAction) Stop() StopResult

Stop TODO DESCRIPTION

type PlayAudio

type PlayAudio struct {
	URL string
}

PlayAudio TODO DESCRIPTION

type PlayAudioParams

type PlayAudioParams struct {
	URL string `json:"url"`
}

PlayAudioParams TODO DESCRIPTION

type PlayGenericParams

type PlayGenericParams struct {
	SpecificParams interface{}
}

PlayGenericParams TODO DESCRIPTION

type PlayParams

type PlayParams interface{}

PlayParams TODO DESCRIPTION

type PlayPauseResult

type PlayPauseResult struct {
	Successful bool
	Event      json.RawMessage
}

PlayPauseResult TODO DESCRIPTION

type PlayResult

type PlayResult struct {
	Successful bool
	Event      json.RawMessage
}

PlayResult TODO DESCRIPTION

type PlayResumeResult

type PlayResumeResult struct {
	Successful bool
	Event      json.RawMessage
}

PlayResumeResult TODO DESCRIPTION

type PlayRingtoneParams

type PlayRingtoneParams struct {
	Name     string  `json:"name"`
	Duration float64 `json:"duration"`
}

PlayRingtoneParams TODO DESCRIPTION

type PlaySilence

type PlaySilence struct {
	Duration float64
}

PlaySilence TODO DESCRIPTION

type PlaySilenceParams

type PlaySilenceParams struct {
	Duration float64 `json:"duration"`
}

PlaySilenceParams TODO DESCRIPTION

type PlayState

type PlayState int

PlayState keeps the state of a play action

const (
	PlayPlaying PlayState = iota
	PlayPaused
	PlayError
	PlayFinished
)

Call state constants

func (PlayState) String

func (s PlayState) String() string

type PlayStruct

type PlayStruct struct {
	Type   string     `json:"type"`
	Params PlayParams `json:"params"`
}

PlayStruct TODO DESCRIPTION

type PlayTTS

type PlayTTS struct {
	Text     string
	Language string
	Gender   string
}

PlayTTS TODO DESCRIPTION

type PlayTTSParams

type PlayTTSParams struct {
	Text     string `json:"text"`
	Language string `json:"language,omitempty"`
	Gender   string `json:"gender,omitempty"`
}

PlayTTSParams TODO DESCRIPTION

type PlayVolumeResult

type PlayVolumeResult struct {
	Successful bool
	Event      json.RawMessage
}

PlayVolumeResult TODO DESCRIPTION

type PromptAction

type PromptAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    CollectResult
	State     PlayState
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

PromptAction TODO DESCRIPTION

func (*PromptAction) GetCollectResult

func (action *PromptAction) GetCollectResult() string

GetCollectResult TODO DESCRIPTION

func (*PromptAction) GetCompleted

func (action *PromptAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*PromptAction) GetConfidence

func (action *PromptAction) GetConfidence() float64

GetConfidence TODO DESCRIPTION

func (*PromptAction) GetControlID

func (action *PromptAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*PromptAction) GetEvent

func (action *PromptAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*PromptAction) GetPayload

func (action *PromptAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*PromptAction) GetResult

func (action *PromptAction) GetResult() CollectResult

GetResult TODO DESCRIPTION

func (*PromptAction) GetResultType

func (action *PromptAction) GetResultType() CollectResultType

GetResultType TODO DESCRIPTION

func (*PromptAction) GetTerminator

func (action *PromptAction) GetTerminator() string

GetTerminator TODO DESCRIPTION

func (*PromptAction) Stop

func (action *PromptAction) Stop() StopResult

Stop TODO DESCRIPTION

func (*PromptAction) Volume

func (action *PromptAction) Volume(vol float64) (*PlayVolumeResult, error)

Volume TODO DESCRIPTION

type PromptResult

type PromptResult CollectResult

PromptResult TODO DESCRIPTION

type RecordAction

type RecordAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    RecordResult
	State     RecordState
	URL       string
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

RecordAction TODO DESCRIPTION

func (*RecordAction) GetCompleted

func (recordaction *RecordAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*RecordAction) GetControlID

func (recordaction *RecordAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*RecordAction) GetDuration

func (recordaction *RecordAction) GetDuration() uint

GetDuration TODO DESCRIPTION

func (*RecordAction) GetEvent

func (recordaction *RecordAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*RecordAction) GetPayload

func (recordaction *RecordAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*RecordAction) GetResult

func (recordaction *RecordAction) GetResult() RecordResult

GetResult TODO DESCRIPTION

func (*RecordAction) GetSize

func (recordaction *RecordAction) GetSize() uint

GetSize TODO DESCRIPTION

func (*RecordAction) GetState

func (recordaction *RecordAction) GetState() RecordState

GetState TODO DESCRIPTION

func (*RecordAction) GetSuccessful

func (recordaction *RecordAction) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

func (*RecordAction) GetURL

func (recordaction *RecordAction) GetURL() string

GetURL TODO DESCRIPTION

func (*RecordAction) Stop

func (recordaction *RecordAction) Stop() StopResult

Stop TODO DESCRIPTION

type RecordDirection

type RecordDirection int

RecordDirection keeps the direction of a recording

const (
	RecordDirectionListen RecordDirection = iota
	RecordDirectionSpeak
	RecordDirectionBoth
)

Recording state constants

func (RecordDirection) String

func (s RecordDirection) String() string

type RecordParams

type RecordParams struct {
	Format            string `json:"format,omitempty"`
	Direction         string `json:"direction,omitempty"`
	Terminators       string `json:"terminators,omitempty"`
	InitialTimeout    uint16 `json:"initial_timeout,omitempty"`
	EndSilenceTimeout uint16 `json:"end_silence_timeout,omitempty"`
	Beep              bool   `json:"beep,omitempty"`
	Stereo            bool   `json:"stereo,omitempty"`
}

RecordParams TODO DESCRIPTION

type RecordResult

type RecordResult struct {
	Successful bool
	URL        string
	Duration   uint
	Size       uint
	Event      json.RawMessage
}

RecordResult TODO DESCRIPTION

type RecordState

type RecordState int

RecordState keeps the state of a play action

const (
	RecordRecording RecordState = iota
	RecordFinished
	RecordNoInput
	RecordPaused
)

Recording state constants

func (RecordState) String

func (s RecordState) String() string

type RecordStruct

type RecordStruct struct {
	Audio RecordParams `json:"audio"`
}

RecordStruct TODO DESCRIPTION

type RelaySession

type RelaySession struct {
	Blade *BladeSession
	I     IRelay
}

RelaySession TODO DESCRIPTION

func RelayNew

func RelayNew() *RelaySession

RelayNew TODO DESCRIPTION

func (*RelaySession) RelayCallAnswer

func (relay *RelaySession) RelayCallAnswer(ctx context.Context, call *CallSession, payload **json.RawMessage) error

RelayCallAnswer TODO DESCRIPTION

func (*RelaySession) RelayCallEnd

func (relay *RelaySession) RelayCallEnd(ctx context.Context, call *CallSession, payload **json.RawMessage) error

RelayCallEnd TODO DESCRIPTION

func (*RelaySession) RelayConnect

func (relay *RelaySession) RelayConnect(ctx context.Context, call *CallSession, ringback *[]RingbackStruct, devices *[][]DeviceStruct, payload **json.RawMessage) error

RelayConnect TODO DESCRIPTION

func (*RelaySession) RelayDetect

func (relay *RelaySession) RelayDetect(ctx context.Context, call *CallSession, controlID string, detect DetectStruct, timeout float64, payload **json.RawMessage) error

RelayDetect TODO DESCRIPTION

func (*RelaySession) RelayDetectDigit

func (relay *RelaySession) RelayDetectDigit(ctx context.Context, call *CallSession, controlID string, digits string, timeout float64, payload **json.RawMessage) error

RelayDetectDigit TODO DESCRIPTION

func (*RelaySession) RelayDetectFax

func (relay *RelaySession) RelayDetectFax(ctx context.Context, call *CallSession, controlID string, faxtone string, timeout float64, payload **json.RawMessage) error

RelayDetectFax TODO DESCRIPTION

func (*RelaySession) RelayDetectMachine

func (relay *RelaySession) RelayDetectMachine(ctx context.Context, call *CallSession, controlID string, det *DetectMachineParamsInternal, timeout float64, payload **json.RawMessage) error

RelayDetectMachine TODO DESCRIPTION

func (*RelaySession) RelayDetectStop

func (relay *RelaySession) RelayDetectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayDetectStop TODO DESCRIPTION

func (*RelaySession) RelayOnInboundAnswer

func (relay *RelaySession) RelayOnInboundAnswer(ctx context.Context) (*CallSession, error)

RelayOnInboundAnswer TODO DESCRIPTION

func (*RelaySession) RelayPhoneConnect

func (relay *RelaySession) RelayPhoneConnect(ctx context.Context, call *CallSession, fromNumber string, toNumber string, payload **json.RawMessage) error

RelayPhoneConnect TODO DESCRIPTION

func (*RelaySession) RelayPhoneDial

func (relay *RelaySession) RelayPhoneDial(ctx context.Context, call *CallSession, fromNumber string, toNumber string, timeout uint, payload **json.RawMessage) error

RelayPhoneDial make outbound phone call

func (*RelaySession) RelayPlay

func (relay *RelaySession) RelayPlay(ctx context.Context, call *CallSession, controlID string, play []PlayStruct, payload **json.RawMessage) error

RelayPlay TODO DESCRIPTION

func (*RelaySession) RelayPlayAndCollect

func (relay *RelaySession) RelayPlayAndCollect(ctx context.Context, call *CallSession, controlID string, playlist *[]PlayStruct, collect *CollectStruct, payload **json.RawMessage) error

RelayPlayAndCollect TODO DESCRIPTION

func (*RelaySession) RelayPlayAndCollectStop

func (relay *RelaySession) RelayPlayAndCollectStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayAndCollectStop TODO DESCRIPTION

func (*RelaySession) RelayPlayAndCollectVolume

func (relay *RelaySession) RelayPlayAndCollectVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error

RelayPlayAndCollectVolume TODO DESCRIPTION

func (*RelaySession) RelayPlayAudio

func (relay *RelaySession) RelayPlayAudio(ctx context.Context, call *CallSession, ctrlID string, url string, payload **json.RawMessage) error

RelayPlayAudio TODO DESCRIPTION

func (*RelaySession) RelayPlayPause

func (relay *RelaySession) RelayPlayPause(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayPause TODO DESCRIPTION

func (*RelaySession) RelayPlayResume

func (relay *RelaySession) RelayPlayResume(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayResume TODO DESCRIPTION

func (*RelaySession) RelayPlayRingtone

func (relay *RelaySession) RelayPlayRingtone(ctx context.Context, call *CallSession, ctrlID string, name string, duration float64, payload **json.RawMessage) error

RelayPlayRingtone TODO DESCRIPTION

func (*RelaySession) RelayPlaySilence

func (relay *RelaySession) RelayPlaySilence(ctx context.Context, call *CallSession, ctrlID string, duration float64, payload **json.RawMessage) error

RelayPlaySilence TODO DESCRIPTION

func (*RelaySession) RelayPlayStop

func (relay *RelaySession) RelayPlayStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayPlayStop TODO DESCRIPTION

func (*RelaySession) RelayPlayTTS

func (relay *RelaySession) RelayPlayTTS(ctx context.Context, call *CallSession, ctrlID string, tts *TTSParamsInternal, payload **json.RawMessage) error

RelayPlayTTS TODO DESCRIPTION

func (*RelaySession) RelayPlayVolume

func (relay *RelaySession) RelayPlayVolume(ctx context.Context, call *CallSession, ctrlID *string, vol float64, payload **json.RawMessage) error

RelayPlayVolume TODO DESCRIPTION

func (*RelaySession) RelayReceiveFax

func (relay *RelaySession) RelayReceiveFax(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayReceiveFax TODO DESCRIPTION

func (*RelaySession) RelayReceiveFaxStop

func (relay *RelaySession) RelayReceiveFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayReceiveFaxStop TODO DESCRIPTION

func (*RelaySession) RelayRecordAudio

func (relay *RelaySession) RelayRecordAudio(ctx context.Context, call *CallSession, controlID string, rec *RecordParams, payload **json.RawMessage) error

RelayRecordAudio TODO DESCRIPTION

func (*RelaySession) RelayRecordAudioStop

func (relay *RelaySession) RelayRecordAudioStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayRecordAudioStop TODO DESCRIPTION

func (*RelaySession) RelaySendDigits

func (relay *RelaySession) RelaySendDigits(ctx context.Context, call *CallSession, controlID, digits string, payload **json.RawMessage) error

RelaySendDigits TODO DESCRIPTION

func (*RelaySession) RelaySendFax

func (relay *RelaySession) RelaySendFax(ctx context.Context, call *CallSession, ctrlID *string, fax *FaxParamsInternal, payload **json.RawMessage) error

RelaySendFax TODO DESCRIPTION

func (*RelaySession) RelaySendFaxStop

func (relay *RelaySession) RelaySendFaxStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelaySendFaxStop TODO DESCRIPTION

func (*RelaySession) RelaySendMessage

func (relay *RelaySession) RelaySendMessage(ctx context.Context, msg *MsgSession, fromNumber, toNumber, signalwireContext, msgBody string) (string, error)

RelaySendMessage send a text message (sms)

func (*RelaySession) RelayStop

func (relay *RelaySession) RelayStop(ctx context.Context) error

RelayStop TODO DESCRIPTION

func (*RelaySession) RelayTap

func (relay *RelaySession) RelayTap(ctx context.Context, call *CallSession, controlID string, tap TapStruct, device *TapDevice, payload **json.RawMessage) (TapDevice, error)

RelayTap TODO DESCRIPTION

func (*RelaySession) RelayTapAudio

func (relay *RelaySession) RelayTapAudio(ctx context.Context, call *CallSession, ctrlID, direction string, device *TapDevice, payload **json.RawMessage) (TapDevice, error)

RelayTapAudio TODO DESCRIPTION

func (*RelaySession) RelayTapStop

func (relay *RelaySession) RelayTapStop(ctx context.Context, call *CallSession, ctrlID *string, payload **json.RawMessage) error

RelayTapStop TODO DESCRIPTION

func (*RelaySession) RelayTaskDeliver

func (*RelaySession) RelayTaskDeliver(ctx context.Context, endpoint, project, token,
	signalwireContext string, taskMsg []byte) error

RelayTaskDeliver TODO DESCRIPTION

type ReplyAuthStruct

type ReplyAuthStruct struct {
	Project   string   `json:"project"`
	ExpiresAt string   `json:"expires_at"`
	Scopes    []string `json:"scopes"`
	Signature string   `json:"signature"`
}

ReplyAuthStruct TODO DESCRIPTION

type ReplyBladeConnect

type ReplyBladeConnect struct {
	Result ReplyResultConnect `json:"result"`
}

ReplyBladeConnect TODO DESCRIPTION

type ReplyBladeExecute

type ReplyBladeExecute struct {
	RequesterNodeID string                  `json:"requester_node_id"`
	ResponderNodeID string                  `json:"responder_node_id"`
	Result          ReplyBladeExecuteResult `json:"result"`
}

ReplyBladeExecute TODO DESCRIPTION

type ReplyBladeExecuteResult

type ReplyBladeExecuteResult struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

ReplyBladeExecuteResult TODO DESCRIPTION

type ReplyBladeExecuteResultSendMsg

type ReplyBladeExecuteResultSendMsg struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	MsgID   string `json:"message_id"`
}

ReplyBladeExecuteResultSendMsg TODO DESCRIPTION

type ReplyBladeExecuteResultTap

type ReplyBladeExecuteResultTap struct {
	Code         string    `json:"code"`
	Message      string    `json:"message"`
	CallID       string    `json:"call_id"`
	ControlID    string    `json:"control_id"`
	SourceDevice TapDevice `json:"source_device"`
}

ReplyBladeExecuteResultTap TODO DESCRIPTION

type ReplyBladeExecuteSendMsg

type ReplyBladeExecuteSendMsg struct {
	RequesterNodeID string                         `json:"requester_node_id"`
	ResponderNodeID string                         `json:"responder_node_id"`
	Result          ReplyBladeExecuteResultSendMsg `json:"result"`
}

ReplyBladeExecuteSendMsg TODO DESCRIPTION

type ReplyBladeExecuteTap

type ReplyBladeExecuteTap struct {
	RequesterNodeID string                     `json:"requester_node_id"`
	ResponderNodeID string                     `json:"responder_node_id"`
	Result          ReplyBladeExecuteResultTap `json:"result"`
}

ReplyBladeExecuteTap TODO DESCRIPTION

type ReplyBladeSetup

type ReplyBladeSetup struct {
	Result ReplyResultSetup
}

ReplyBladeSetup TODO DESCRIPTION

type ReplyResultConnect

type ReplyResultConnect struct {
	SessionRestored      bool            `json:"session_restored"`
	SessionID            string          `json:"sessionid"`
	NodeID               string          `json:"node_id"`
	MasterNodeID         string          `json:"master_nodeid"`
	Authorization        ReplyAuthStruct `json:"authorization"`
	Routes               []string        `json:"routes"`
	Protocols            []string        `json:"protocols"`
	Subscriptions        []string        `json:"subscriptions"`
	Authorities          []string        `json:"authorities"`
	Authorizations       []string        `json:"authorizations"`
	Accesses             []string        `json:"accesses"`
	ProtocolsUncertified []string        `json:"protocols_uncertified"`
}

ReplyResultConnect TODO DESCRIPTION

type ReplyResultDisconnect

type ReplyResultDisconnect struct{}

ReplyResultDisconnect - empty

type ReplyResultResultSetup

type ReplyResultResultSetup struct {
	Protocol string `json:"protocol"`
}

ReplyResultResultSetup TODO DESCRIPTION

type ReplyResultSetup

type ReplyResultSetup struct {
	RequesterNodeID string                 `json:"requester_node_id"`
	ResponderNodeID string                 `json:"responder_node_id"`
	Result          ReplyResultResultSetup `json:"result"`
}

ReplyResultSetup TODO DESCRIPTION

type ReplyResultSubscription

type ReplyResultSubscription struct {
	Protocol          string   `json:"protocol"`
	Command           string   `json:"command"`
	SubscribeChannels []string `json:"subscribe_channels"`
}

ReplyResultSubscription TODO DESCRIPTION

type ReqBladeAuthenticate

type ReqBladeAuthenticate struct {
	Method string           `json:"method"`
	Params ParamsAuthStruct `json:"params"`
}

ReqBladeAuthenticate TODO DESCRIPTION

type ReqBladeConnect

type ReqBladeConnect struct {
	Method string              `json:"method"`
	Params ParamsConnectStruct `json:"params"`
}

ReqBladeConnect TODO DESCRIPTION

type ReqBladeSetup

type ReqBladeSetup struct {
	Method string                 `json:"method"`
	Params ParamsSignalwireStruct `json:"params"`
}

ReqBladeSetup TODO DESCRIPTION

type ReqHandler

type ReqHandler struct {
}

ReqHandler TODO DESCRIPTION

func (ReqHandler) Handle

func (ReqHandler) Handle(ctx context.Context, c *jsonrpc2.Conn, req *jsonrpc2.Request)

Handle JSONRPC2.0 reply handler

type ResultAnswer

type ResultAnswer struct {
	Successful bool
}

ResultAnswer TODO DESCRIPTION

func (*ResultAnswer) GetSuccessful

func (resultAnswer *ResultAnswer) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

type ResultCollect

type ResultCollect struct {
	Type   string                 `json:"type"`
	Params map[string]interface{} `json:"params,omitempty"`
}

ResultCollect TODO DESCRIPTION

type ResultCollectDigitParams

type ResultCollectDigitParams struct {
	Digits     string `json:"digits"`
	Terminator string `json:"terminator"`
}

ResultCollectDigitParams TODO DESCRIPTION

type ResultCollectSpeechParams

type ResultCollectSpeechParams struct {
	Text       string  `json:"text"`
	Confidence float64 `json:"confidence"`
}

ResultCollectSpeechParams TODO DESCRIPTION

type ResultDial

type ResultDial struct {
	Successful bool
	Call       *CallObj
	I          ICalling
	// contains filtered or unexported fields
}

ResultDial TODO DESCRIPTION

func (*ResultDial) GetError

func (resultDial *ResultDial) GetError() error

GetError TODO DESCRIPTION

func (*ResultDial) GetSuccessful

func (resultDial *ResultDial) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

type ResultHangup

type ResultHangup struct {
	Successful bool
	Reason     CallDisconnectReason
	Event      *json.RawMessage
	// contains filtered or unexported fields
}

ResultHangup TODO DESCRIPTION

func (*ResultHangup) GetError

func (resultHangup *ResultHangup) GetError() bool

GetError TODO DESCRIPTION

func (*ResultHangup) GetEvent

func (resultHangup *ResultHangup) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*ResultHangup) GetReason

func (resultHangup *ResultHangup) GetReason() CallDisconnectReason

GetReason TODO DESCRIPTION

func (*ResultHangup) GetSuccessful

func (resultHangup *ResultHangup) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

type RingbackAudioParams

type RingbackAudioParams PlayAudioParams

RingbackAudioParams TODO DESCRIPTION

type RingbackRingtoneParams

type RingbackRingtoneParams PlayRingtoneParams

RingbackRingtoneParams TODO DESCRIPTION

type RingbackSilenceParams

type RingbackSilenceParams PlaySilenceParams

RingbackSilenceParams TODO DESCRIPTION

type RingbackStruct

type RingbackStruct struct {
	Type   string      `json:"type"`
	Params interface{} `json:"params"`
}

RingbackStruct TODO DESCRIPTION

type RingbackTTSParams

type RingbackTTSParams PlayTTSParams

RingbackTTSParams TODO DESCRIPTION

type SendDigitsAction

type SendDigitsAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    SendDigitsResult
	State     SendDigitsState
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

SendDigitsAction TODO DESCRIPTION

func (*SendDigitsAction) GetCompleted

func (action *SendDigitsAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*SendDigitsAction) GetControlID

func (action *SendDigitsAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*SendDigitsAction) GetEvent

func (action *SendDigitsAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*SendDigitsAction) GetPayload

func (action *SendDigitsAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*SendDigitsAction) GetResult

func (action *SendDigitsAction) GetResult() SendDigitsResult

GetResult TODO DESCRIPTION

func (*SendDigitsAction) GetSuccessful

func (action *SendDigitsAction) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

type SendDigitsResult

type SendDigitsResult struct {
	Successful bool
	Event      json.RawMessage
}

SendDigitsResult TODO DESCRIPTION

type SendDigitsState

type SendDigitsState int

SendDigitsState keeps the state of a SendDigits action

const (
	SendDigitsFinished SendDigitsState = iota
)

TODO DESCRIPTION

func (SendDigitsState) String

func (s SendDigitsState) String() string

type SendResult

type SendResult struct {
	I   IMessaging
	Msg *MsgObj

	sync.RWMutex
	Successful bool
	Completed  bool
	// contains filtered or unexported fields
}

SendResult TODO DESCRIPTION

func (*SendResult) GetMsgID

func (resultSend *SendResult) GetMsgID() string

GetMsgID TODO DESCRIPTION

func (*SendResult) GetReason

func (resultSend *SendResult) GetReason() string

GetReason TODO DESCRIPTION

func (*SendResult) GetSuccessful

func (resultSend *SendResult) GetSuccessful() bool

GetSuccessful TODO DESCRIPTION

type SessionState

type SessionState int

SessionState TODO DESCRIPTION

const (
	BladeOffline SessionState = 1 + iota
	BladeConnecting
	BladeConnected
	BladeSetup
	BladeSubscribed
	BladeRunning
	BladeClosing
	BladeClosed
	BladeShutdown
)

Blade Session Statuses

func (SessionState) String

func (s SessionState) String() string

type StopResult

type StopResult struct {
	Successful bool
}

StopResult TODO DESCRIPTION

type TTSParamsInternal

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

TTSParamsInternal TODO DESCRIPTION

type Tap

type Tap struct {
	TapType       TapType
	TapDirection  TapDirection
	TapDeviceType TapDeviceType
}

Tap TODO DESCRIPTION

type TapAction

type TapAction struct {
	CallObj   *CallObj
	ControlID string
	Completed bool
	Result    TapResult
	State     TapState
	Payload   *json.RawMessage

	sync.RWMutex
	// contains filtered or unexported fields
}

TapAction TODO DESCRIPTION

func (*TapAction) GetCompleted

func (tapaction *TapAction) GetCompleted() bool

GetCompleted TODO DESCRIPTION

func (*TapAction) GetControlID

func (tapaction *TapAction) GetControlID() string

GetControlID TODO DESCRIPTION

func (*TapAction) GetDestinationDevice

func (tapaction *TapAction) GetDestinationDevice() *TapDevice

GetDestinationDevice TODO DESCRIPTION

func (*TapAction) GetEvent

func (tapaction *TapAction) GetEvent() *json.RawMessage

GetEvent TODO DESCRIPTION

func (*TapAction) GetPayload

func (tapaction *TapAction) GetPayload() *json.RawMessage

GetPayload TODO DESCRIPTION

func (*TapAction) GetResult

func (tapaction *TapAction) GetResult() TapResult

GetResult TODO DESCRIPTION

func (*TapAction) GetSourceDevice

func (tapaction *TapAction) GetSourceDevice() *TapDevice

GetSourceDevice TODO DESCRIPTION

func (*TapAction) GetState

func (tapaction *TapAction) GetState() TapState

GetState TODO DESCRIPTION

func (*TapAction) GetTap

func (tapaction *TapAction) GetTap() *Tap

GetTap TODO DESCRIPTION

func (*TapAction) Stop

func (tapaction *TapAction) Stop() StopResult

Stop TODO DESCRIPTION

type TapAudioParams

type TapAudioParams struct {
	Direction string `json:"direction"`
}

TapAudioParams TODO DESCRIPTION

type TapDevice

type TapDevice struct {
	Type   string          `json:"type"`
	Params TapDeviceParams `json:"params"`
}

TapDevice TODO DESCRIPTION

type TapDeviceParams

type TapDeviceParams struct {
	Addr  string `json:"addr,omitempty"`
	Codec string `json:"codec,omitempty"`
	Port  uint16 `json:"port,omitempty"`
	Ptime uint8  `json:"ptime,omitempty"`
	Rate  uint   `json:"rate,omitempty"`
	URI   string `json:"uri,omitempty"`
}

TapDeviceParams TODO DESCRIPTION

type TapDeviceType

type TapDeviceType int

TapDeviceType TODO DESCRIPTION

const (
	TapRTP TapDeviceType = iota
	TapWS
)

Tap state constants

func (TapDeviceType) String

func (s TapDeviceType) String() string

type TapDirection

type TapDirection int

TapDirection TODO DESCRIPTION

const (
	TapDirectionListen TapDirection = iota
	TapDirectionSpeak
	TapDirectionBoth
)

Tap state constants

func (TapDirection) String

func (s TapDirection) String() string

type TapResult

type TapResult struct {
	Successful        bool
	SourceDevice      TapDevice
	DestinationDevice TapDevice
	Tap               Tap
	Event             json.RawMessage
}

TapResult TODO DESCRIPTION

type TapState

type TapState int

TapState keeps the state of a tap action

const (
	TapTapping TapState = iota
	TapFinished
)

Tap state constants

func (TapState) String

func (s TapState) String() string

type TapStruct

type TapStruct struct {
	Type   string         `json:"type"`
	Params TapAudioParams `json:"params"`
}

TapStruct TODO DESCRIPTION

type TapType

type TapType int

TapType TODO DESCRIPTION

const (
	TapAudio TapType = iota
)

Tap state constants

func (TapType) String

func (s TapType) String() string

type Tasking

type Tasking struct {
	Ctx      context.Context
	Cancel   context.CancelFunc
	Relay    *RelaySession
	Consumer *Consumer
	TaskChan chan ParamsEventTaskingTask
}

Tasking TODO DESCRIPTION

func (*Tasking) Deliver

func (tasking *Tasking) Deliver(signalwireContext string, b []byte) bool

Deliver TODO DESCRIPTION

Jump to

Keyboard shortcuts

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