Documentation ¶
Index ¶
- Variables
- func AppendLog(filename string, v ...interface{}) (err error)
- func AppendTo(filename string, line string) (err error)
- func DynamicConfigBool(value string) (result bool)
- func EncodeParams(baudrate uint, ecm bool) uint
- func FreeSwitchDBDelete(c *eventsocket.Connection, realm string, key string) error
- func FreeSwitchDBExists(c *eventsocket.Connection, realm string, key string) (bool, error)
- func FreeSwitchDBInsert(c *eventsocket.Connection, realm string, key string, value string) error
- func FreeSwitchDBSelect(c *eventsocket.Connection, realm string, key string) (string, error)
- func GetSeqFor(subdir string) (seq uint64, err error)
- func GetSoftmodemFallback(c *eventsocket.Connection, cidnum string) (bool, error)
- func LoadConfig(filename string)
- func SendFIFO(filename string, msg string) error
- func SetSoftmodemFallback(c *eventsocket.Connection, cidnum string, enabled bool) error
- type EventStream
- type FaxResult
- type FifoStream
- type HylaConfig
- type PageResult
- type Resolution
- type SessionLogger
- type XFRecord
- Bugs
Constants ¶
This section is empty.
Variables ¶
var (
// Config is the global configuration struct
Config config
)
var (
// Faxq provides functionalty to send notification messages to faxq's FIFO
Faxq *faxqfifo
)
Functions ¶
func DynamicConfigBool ¶
DynamicConfigBool interprets a DynamicConfig string value as truth value
func EncodeParams ¶
EncodeParams encodes given baud rate and ecm status to the status byte used in HylaFAX's xferfaxlog. This only encodes bitrate and ECM use right now.
func FreeSwitchDBDelete ¶
func FreeSwitchDBDelete(c *eventsocket.Connection, realm string, key string) error
FreeSwitchDBDelete deletes a value from FreeSWITCH's mod_db key/value database
func FreeSwitchDBExists ¶
func FreeSwitchDBExists(c *eventsocket.Connection, realm string, key string) (bool, error)
FreeSwitchDBExists checks if a value exists in FreeSWITCH's mod_db key/value database
func FreeSwitchDBInsert ¶
func FreeSwitchDBInsert(c *eventsocket.Connection, realm string, key string, value string) error
FreeSwitchDBInsert inserts a value into FreeSWITCH's mod_db key/value database
func FreeSwitchDBSelect ¶
func FreeSwitchDBSelect(c *eventsocket.Connection, realm string, key string) (string, error)
FreeSwitchDBSelect retreives a value from FreeSWITCH's mod_db key/value database
func GetSoftmodemFallback ¶
func GetSoftmodemFallback(c *eventsocket.Connection, cidnum string) (bool, error)
GetSoftmodemFallback checks if fallback to SpanDSP's softmodem (no T.38) should be enabled for the given callerid number
func LoadConfig ¶
func LoadConfig(filename string)
LoadConfig loads the configuration from given file path
func SetSoftmodemFallback ¶
func SetSoftmodemFallback(c *eventsocket.Connection, cidnum string, enabled bool) error
SetSoftmodemFallback saves the given softmodem fallback setting for a caller id to FreeSWITCH's mod_db
Types ¶
type EventStream ¶
type EventStream interface { Events() <-chan *eventsocket.Event Errors() <-chan error Close() }
EventStream is a stream of FreeSWITCH Event Socket events provided through channels.
func NewEventStream ¶
func NewEventStream(conn *eventsocket.Connection) EventStream
NewEventStream creates a EventStream that continuously reads events from a FreeSWITCH Event Socket connection into channes.
type FaxResult ¶
type FaxResult struct { StartTs time.Time EndTs time.Time Hangupcause string TotalPages uint TransferredPages uint Ecm bool RemoteID string ResultCode int // SpanDSP, not HylaFAX! ResultText string Success bool TransferRate uint NegotiateCount uint PageResults []PageResult // contains filtered or unexported fields }
FaxResult is the result of a completed or aborted Fax transmission
func NewFaxResult ¶
func NewFaxResult(uuid uuid.UUID, sessionlog SessionLogger) *FaxResult
NewFaxResult creates a new FaxResult structure
func (*FaxResult) AddEvent ¶
func (f *FaxResult) AddEvent(ev *eventsocket.Event)
AddEvent parses a FreeSWITCH EventSocket event and merges contained information into the FaxResult
type FifoStream ¶
FifoStream provides a channel of messages received on a FIFO
func NewFifoStream ¶
func NewFifoStream(name string) FifoStream
NewFifoStream creates a FifoStream reading from a FIFO with given filename
type HylaConfig ¶
type HylaConfig struct {
// contains filtered or unexported fields
}
HylaConfig holds a set of HylaFAX configuration parameters
func DynamicConfig ¶
func DynamicConfig(command string, args ...string) (*HylaConfig, error)
DynamicConfig executes the given command and parses the output compatible to HylaFAX' DynamicConfig
func (*HylaConfig) GetFirst ¶
func (h *HylaConfig) GetFirst(tag string) string
GetFirst returns the first Value found matching given Tag
type PageResult ¶
type PageResult struct { Ts time.Time Page uint BadRows uint LongestBadRowRun uint EncodingName string ImagePixelSize Resolution FilePixelSize Resolution ImageResolution Resolution FileResolution Resolution ImageSize uint }
PageResult is the result of a transmitted Fax page as reported by SpanDSP
func (PageResult) String ¶
func (p PageResult) String() string
type Resolution ¶
Resolution is the image resolution of a fax
func (Resolution) String ¶
func (r Resolution) String() string
type SessionLogger ¶
type SessionLogger interface { CommSeq() uint64 CommID() string Logfile() string Log(v ...interface{}) }
SessionLogger is a logger that logs messages both to the processes log facility and a HylaFax session log file
func NewSessionLogger ¶
func NewSessionLogger() (SessionLogger, error)
NewSessionLogger assigns a CommID and opens a session log file
type XFRecord ¶
type XFRecord struct { Ts time.Time Commid string Modem string Jobid uint Jobtag string Filename string Sender string Destnum string RemoteID string Params uint Pages uint Jobtime time.Duration Conntime time.Duration Reason string Cidname string Cidnum string Owner string Dcs string }
XFRecord holds all data for a HylaFAX xferfaxlog record
func NewXFRecord ¶
NewXFRecord creates a new xferfaxlog record for a FaxResult
func (*XFRecord) SaveReceptionReport ¶
SaveReceptionReport appends a reception record to the configured xferfaxlog file
func (*XFRecord) SaveTransmissionReport ¶
SaveTransmissionReport appends a transmisison record to the configured xferfaxlog file
Notes ¶
Bugs ¶
split at null or \n until EOF