Versions in this module Expand all Collapse all v1 v1.0.0 Apr 26, 2019 Changes in this version + var AvailableMessageTypes = []string + var ECouldNotCreateMessage = "Error while creating new message: %s" + var ECouldNotDecode = "Could not decode/unescape message: %s" + var ECouldNotReadMIMEHeaders = "Error while reading MIME headers: %s" + var ECouldNotReadyBody = "Got error while reading reader body: %s" + var ECouldNotSendEvent = "Must send at least one event header, detected `%d` header" + var ECouldNotStartListener = "Got error while attempting to start listener: %s" + var EInvalidCommandProvided = "Invalid command provided. Command cannot contain \\r and/or \\n. Provided command is: %s" + var EInvalidContentLength = "Unable to get size of content-length: %s" + var EInvalidPassword = "Could not authenticate against freeswitch with provided password: %s" + var EInvalidServerAddr = "Please make sure to pass along valid address. You've passed: \"%s\"" + var EListenerConnection = "Listener connection error: %s" + var EUnexpectedAuthHeader = "Expected auth/request content type. Got %s" + var EUnsuccessfulReply = "Got error while reading from reply command: %s" + var EUnsupportedMessageType = "Unsupported message type! We got '%s'. Supported types are: %v " + var ReadBufferSize = 1024 << 6 + func Debug(message string, args ...interface{}) + func Error(message string, args ...interface{}) + func Info(message string, args ...interface{}) + func Notice(message string, args ...interface{}) + func StringInSlice(str string, list []string) bool + func Warning(message string, args ...interface{}) + type Client struct + Addr string + Passwd string + Proto string + Timeout int + func NewClient(host string, port uint, passwd string, timeout int) (*Client, error) + func (c *Client) Authenticate() error + func (c *Client) EstablishConnection() error + type Message struct + Body []byte + Headers map[string]string + func (m *Message) Dump() (resp string) + func (m *Message) GetCallUUID() string + func (m *Message) GetHeader(key string) string + func (m *Message) Parse() error + func (m *Message) String() string + type OutboundServer struct + Addr string + Conns chan SocketConnection + Proto string + func NewOutboundServer(addr string) (*OutboundServer, error) + func (s *OutboundServer) Start() error + func (s *OutboundServer) Stop() + type SocketConnection struct + func (c *SocketConnection) Close() error + func (c *SocketConnection) Dial(network string, addr string, timeout time.Duration) (net.Conn, error) + func (c *SocketConnection) Execute(command, args string, sync bool) (m *Message, err error) + func (c *SocketConnection) ExecuteUUID(uuid string, command string, args string, sync bool) (m *Message, err error) + func (c *SocketConnection) Handle() + func (c *SocketConnection) OriginatorAddr() net.Addr + func (c *SocketConnection) ReadMessage() (*Message, error) + func (c *SocketConnection) Send(cmd string) error + func (c *SocketConnection) SendEvent(eventHeaders []string) error + func (c *SocketConnection) SendMany(cmds []string) error + func (c *SocketConnection) SendMsg(msg map[string]string, uuid, data string) (m *Message, err error) + func (sc *SocketConnection) Api(command string) error + func (sc *SocketConnection) BgApi(command string) error + func (sc *SocketConnection) Connect() error + func (sc *SocketConnection) ExecuteAnswer(args string, sync bool) (m *Message, err error) + func (sc *SocketConnection) ExecuteHangup(uuid string, args string, sync bool) (m *Message, err error) + func (sc *SocketConnection) ExecuteSet(key string, value string, sync bool) (m *Message, err error) + func (sc *SocketConnection) Exit() error