phone

package
v0.0.0-...-be1e383 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ref.Config
	Type     string            `json:"type"`
	Metadata map[string]string `json:"metadata"`
}

Config is the component's configuration

type Factory

type Factory struct {
	CompType      string
	FactoryMethod func() PhoneCallService
}

func NewFactory

func NewFactory(compType string, f func() PhoneCallService) *Factory

type PhoneCallService

type PhoneCallService interface {
	Init(context.Context, *Config) error

	SendVoiceWithTemplate(context.Context, *SendVoiceWithTemplateRequest) (*SendVoiceWithTemplateResponse, error)
}

type Registry

type Registry interface {
	Register(fs ...*Factory)
	Create(compType string) (PhoneCallService, error)
}

func NewRegistry

func NewRegistry(info *info.RuntimeInfo) Registry

type SendVoiceWithTemplateRequest

type SendVoiceWithTemplateRequest struct {
	// If your system uses multiple IVR services at the same time,
	// you can specify which service to use with this field.
	ComponentName string `json:"component_name,omitempty"`
	// Required
	Template *VoiceTemplate `json:"template,omitempty"`
	// Required
	ToMobile []string `json:"to_mobile,omitempty"`
	// This field is required by some cloud providers.
	FromMobile string `json:"from_mobile,omitempty"`
}

The request of SendVoiceWithTemplate method

type SendVoiceWithTemplateResponse

type SendVoiceWithTemplateResponse struct {
	// Id of this request.
	RequestId string `json:"request_id,omitempty"`
}

The response of `SendVoiceWithTemplate` method

type VoiceTemplate

type VoiceTemplate struct {
	// Required
	TemplateId string `json:"template_id,omitempty"`
	// Required
	TemplateParams map[string]string `json:"template_params,omitempty"`
}

VoiceTemplate

Jump to

Keyboard shortcuts

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