Documentation
¶
Overview ¶
templ: version: v0.3.1001
templ: version: v0.3.1001
Package twilio integrates Conway with Twilio for inbound SMS and voicemail.
It exposes signature-verified webhook endpoints that Twilio calls when a call or text comes in, persists each message to a unified inbox table, asynchronously downloads voicemail recordings, and serves an admin inbox UI for leadership users. All messages and their recordings are deleted after a configurable retention window (default 30 days).
Index ¶
- type Config
- type Module
- func (m *Module) AttachRoutes(router *engine.Router)
- func (m *Module) AttachWorkers(mgr *engine.ProcMgr)
- func (m *Module) ConfigSpec() config.Spec
- func (m *Module) GetItem(ctx context.Context) (downloadJob, error)
- func (m *Module) ProcessItem(ctx context.Context, job downloadJob) error
- func (m *Module) SetConfigLoader(store *config.Store)
- func (m *Module) SetNavProvider(fn func() []*admin.NavTab)
- func (m *Module) UpdateItem(ctx context.Context, job downloadJob, success bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
AccountSid string `json:"account_sid" config:"label=Account SID,section=auth,help=From the Twilio console (Account Info). Starts with 'AC'."`
AuthToken string `` /* 164-byte string literal not displayed */
VoiceGreeting string `` /* 186-byte string literal not displayed */
TranscriptionEnabled bool `` /* 167-byte string literal not displayed */
RetentionDays int `` /* 172-byte string literal not displayed */
}
Config is the persisted Twilio configuration.
AccountSid + AuthToken come from the Twilio console (https://console.twilio.com). The auth token is used both as the basic-auth password for downloading recordings and as the HMAC-SHA1 key Twilio uses to sign webhook requests, so it MUST be kept secret.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module is the Twilio inbox module.
func (*Module) AttachRoutes ¶
AttachRoutes registers public webhook routes and admin inbox routes.
func (*Module) AttachWorkers ¶
AttachWorkers attaches the recording-downloader queue and the retention cleanup poll.
func (*Module) ConfigSpec ¶
ConfigSpec describes the Twilio configuration page in the admin UI.
func (*Module) GetItem ¶
GetItem finds the next voicemail row whose recording hasn't been downloaded yet, respecting the per-row backoff schedule.
func (*Module) ProcessItem ¶
ProcessItem downloads the recording bytes from Twilio.
func (*Module) SetConfigLoader ¶
SetConfigLoader wires up the typed config loader; called by the App after modules are registered with the config registry.
func (*Module) SetNavProvider ¶
SetNavProvider supplies a callback that returns the current admin navbar tabs. The inbox pages render the same navbar as the rest of the admin UI.