fsclient

package
v0.0.0-...-7bfb671 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2018 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package fsclient provides a client for the Freeswitch Event Socket.

Index

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) API

func (client *Client) API(cmd string) (string, error)

API sends an api command (blocking mode).

func (*Client) BackgroundAPI

func (client *Client) BackgroundAPI(cmd string) (string, error)

BackgroundAPI sends a bgapi command (async mode). You need to subscribe to BACKGROUND_JOB events to get the actual response.

func (*Client) Execute

func (client *Client) Execute(app string, arg string, uuid string, lock bool) (string, error)

Execute is used to execute dialplan applications on a channel.

func (*Client) NextEvent

func (client *Client) NextEvent() map[string]string

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

func (client *Client) SendInternalEvent(event map[string]string)

SendInternalEvent function sends an event of type map[string]string into the event channel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL