Documentation ¶
Overview ¶
Package fsclient provides a client for the Freeswitch Event Socket.
Index ¶
- type Client
- func (client *Client) API(cmd string) (string, error)
- func (client *Client) BackgroundAPI(cmd string) (string, error)
- func (client *Client) Execute(app string, arg string, uuid string, lock bool) (string, error)
- func (client *Client) NextEvent() map[string]string
- func (client *Client) SendEvent(eventName string, eventParams map[string]string, eventBody string) (string, error)
- func (client *Client) SendInternalEvent(event map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Freeswitch client. Contains the event socket connection.
func NewClient ¶
func NewClient(addr string, password string, filters []string, subs []string, initFunc func(*Client)) *Client
NewClient creates a new Freeswitch client with filters, subscriptions and an init function.
func (*Client) BackgroundAPI ¶
BackgroundAPI sends a bgapi command (async mode). You need to subscribe to BACKGROUND_JOB events to get the actual response.
func (*Client) NextEvent ¶
NextEvent function blocks until there is an event received from Freeswitch.
func (*Client) SendEvent ¶
func (client *Client) SendEvent(eventName string, eventParams map[string]string, eventBody string) (string, error)
SendEvent is used to send an event into the event system.
func (*Client) SendInternalEvent ¶
SendInternalEvent function sends an event of type map[string]string into the event channel.
Click to show internal directories.
Click to hide internal directories.