calls

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERR_UNAUTHORIZED      = fmt.Errorf("unauthorized")
	ERR_EXPIRED_TOKEN     = fmt.Errorf("token expired")
	ERR_NO_TOKEN_PROVIDED = fmt.Errorf("no token provided")
)

Functions

This section is empty.

Types

type AddPraticipantRequest

type AddPraticipantRequest struct {
	ParticipantToAdd     ParticipantToAdd     `json:"participantToAdd"`
	OperationContext     string               `json:"operationContext"`
	SourceCallerIDNumber SourceCallerIDNumber `json:"sourceCallerIdNumber"`
	OperationCallbackURI string               `json:"operationCallbackUri"`
}

type Call

type Call interface {
	CreateOutBoundCall(
		ctx context.Context,
		options *CreateOutboundCallOptions,
	) (*OutboundCall, error)
	AddParticipant(
		ctx context.Context,
		callId string,
		info AddPraticipantRequest,
	) error
	WithToken(
		token string,
		ExpiresAt time.Time,
	) Call
	GetToken() (string, error)
	SetTokenFetcher(
		fetcher func() (string, error),
	)
}

func New

func New(host string, key string) (Call, error)

func NewWithLogger added in v0.2.0

func NewWithLogger(host string, key string, Logger logger.Logger) (Call, error)

func NewWithToken

func NewWithToken(host string, token string, expiresAt time.Time) (Call, error)

type CommunicationUser

type CommunicationUser struct {
	ID string `json:"id"`
}

type CreateOutboundCallOptions

type CreateOutboundCallOptions struct {
	Targets     []Target `json:"targets"`
	CallbackURI string   `json:"callbackUri"`
}

type OutboundCall

type OutboundCall struct {
	CallConnectionID    string   `json:"callConnectionId"`
	ServerCallID        string   `json:"serverCallId"`
	Source              Source   `json:"source"`
	Targets             []Source `json:"targets"`
	CallConnectionState string   `json:"callConnectionState"`
	CallbackURI         string   `json:"callbackUri"`
}

type ParticipantToAdd

type ParticipantToAdd struct {
	Kind              string            `json:"kind"`
	CommunicationUser CommunicationUser `json:"communicationUser"`
}

type Source

type Source struct {
	Kind              string            `json:"kind"`
	CommunicationUser CommunicationUser `json:"communicationUser"`
}

type SourceCallerIDNumber

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

type Target

type Target struct {
	Kind              string            `json:"kind"`
	CommunicationUser CommunicationUser `json:"communicationUser"`
}

Jump to

Keyboard shortcuts

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