voicemail

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package voicemail implements support for retrieving voicemails sent to mailboxes. It's possible to extract caller and target numbers from mail content and downloads attached audio files for later local playback.

Index

Constants

This section is empty.

Variables

View Source
var (
	AddToSchema = configBuilder.AddToSchema
)
View Source
var Spec = conf.SectionSpec(append([]conf.OptionSpec{
	{
		Name:        "Name",
		Type:        conf.StringType,
		Description: "The name of the voicemail",
		Required:    true,
	},
	{
		Name:        "Disabled",
		Type:        conf.BoolType,
		Default:     "no",
		Description: "Whether or not the watching of the specified mailbox is disabled.",
	},
	{
		Name:     "ExtractCallerRegexp",
		Type:     conf.StringType,
		Required: true,
	},
	{
		Name: "ExtractTargetRegexp",
		Type: conf.StringType,
	},
}, mailbox.MailboxInfoSpec...))

Spec defines the configuration stanzas used to configure a VoiceMail mailbox.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Name                string
	Disabled            bool
	ExtractCallerRegexp string
	ExtractTargetRegexp string
	mailbox.Config
}

Definition describes a mailbox that receives voice-mails.

type Mailbox

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

Mailbox handles voicmails.

func New

func New(
	ctx context.Context,
	customers customerdb.Database,
	voicemails voicemaildb.Database,
	country string,
	cfg Definition,
	mng *mailsync.Manager,
) (*Mailbox, error)

New creates a new voicmail mailbox. TODO(ppacher): move most parts of the setup routine into voicemail.Manager.

func (*Mailbox) Dispose

func (box *Mailbox) Dispose() error

func (*Mailbox) HandleMail

func (box *Mailbox) HandleMail(ctx context.Context, mail *mailbox.EMail)

HandleMail implements mailsync.MessageHandler.

func (*Mailbox) Stop

func (box *Mailbox) Stop() error

Stop stops the mailbox syncer.

type Manager

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

func NewManager

func NewManager(ctx context.Context, country string, syncManager *mailsync.Manager, customers customerdb.Database, voicemails voicemaildb.Database, rtcfg *runtime.ConfigSchema) (*Manager, error)

func (*Manager) NotifyChange

func (mng *Manager) NotifyChange(ctx context.Context, changeType, id string, sec *conf.Section) error

func (*Manager) Validate

func (mng *Manager) Validate(ctx context.Context, sec runtime.Section) error

Jump to

Keyboard shortcuts

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