Documentation
¶
Overview ¶
utils.go is released under the MIT License <http://www.opensource.org/licenses/mit-license.php Copyright (C) ITsysCOM. All Rights Reserved.
Provides FreeSWITCH socket communication.
Index ¶
- Constants
- Variables
- func EventToMap(event string) (result map[string]string)
- func FSEventStrToMap(fsevstr string, headers []string) map[string]string
- func HeadersToMap(headers string) (result map[string]string)
- func MapChanData(chanInfoStr string) (chansInfoMap []map[string]string)
- type FSock
- func (self *FSock) Connect() error
- func (self *FSock) Connected() (ok bool)
- func (self *FSock) Disconnect() (err error)
- func (self *FSock) LocalAddr() net.Addr
- func (self *FSock) ReadEvents() (err error)
- func (self *FSock) ReconnectIfNeeded() (err error)
- func (self *FSock) SendApiCmd(cmdStr string) (string, error)
- func (self *FSock) SendBgapiCmd(cmdStr string) (out chan string, err error)
- func (self *FSock) SendCmd(cmdStr string) (string, error)
- func (self *FSock) SendCmdWithArgs(cmd string, args map[string]string, body string) (string, error)
- func (self *FSock) SendEvent(eventSubclass string, eventParams map[string]string) (string, error)
- func (self *FSock) SendEventWithBody(eventSubclass string, eventParams map[string]string, body string) (string, error)
- func (self *FSock) SendMsgCmd(uuid string, cmdargs map[string]string) error
- func (self *FSock) SendMsgCmdWithBody(uuid string, cmdargs map[string]string, body string) error
- type FSockPool
- type LogHandler
Constants ¶
View Source
const EventBodyTag = "EvBody"
Variables ¶
View Source
var ( FS *FSock // Used to share FS connection via package globals DelayFunc func() func() int ErrConnectionPoolTimeout = errors.New("ConnectionPool timeout") )
Functions ¶
func EventToMap ¶
func FSEventStrToMap ¶
Convert fseventStr into fseventMap
func HeadersToMap ¶
func MapChanData ¶
Converts string received from fsock into a list of channel info, each represented in a map
Types ¶
type FSock ¶
type FSock struct {
// contains filtered or unexported fields
}
Connection to FreeSWITCH Socket
func NewFSock ¶
func NewFSock(fsaddr, fspaswd string, reconnects int, eventHandlers map[string][]func(string, int), logHandler *LogHandler, eventFilters map[string][]string, l *syslog.Writer, connIdx int) (fsock *FSock, err error)
Connects to FS and starts buffering input
func (*FSock) ReadEvents ¶
ReadEvents reads events from socket, attempt reconnect if disconnected
func (*FSock) ReconnectIfNeeded ¶
If not connected, attempt reconnect if allowed
func (*FSock) SendApiCmd ¶
Send API command
func (*FSock) SendBgapiCmd ¶
Send BGAPI command
func (*FSock) SendCmdWithArgs ¶
func (*FSock) SendEventWithBody ¶
func (self *FSock) SendEventWithBody(eventSubclass string, eventParams map[string]string, body string) (string, error)
SendEventWithBody command
func (*FSock) SendMsgCmd ¶
SendMsgCmd command
type FSockPool ¶
type FSockPool struct {
// contains filtered or unexported fields
}
Connection Handler for commands sent to FreeSWITCH
Click to show internal directories.
Click to hide internal directories.