fsswitch

package
v0.0.0-...-a325edb Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

go-switch is released under the MIT License <http://www.opensource.org/licenses/mit-license.php Copyright (C) Temlio Inc. All Rights Reserved.

Provides FreeSWITCH socket communication.

go-switch is released under the MIT License <http://www.opensource.org/licenses/mit-license.php Copyright (C) Temlio Inc. All Rights Reserved. Provides FreeSWITCH socket communication.

go-switch is released under the MIT License <http://www.opensource.org/licenses/mit-license.php Copyright (C) Temlio Inc. All Rights Reserved.

Provides FreeSWITCH socket communication.

go-switch is released under the MIT License <http://www.opensource.org/licenses/mit-license.php Copyright (C) Temlio Inc. All Rights Reserved.

Provides FreeSWITCH socket communication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventStrToMap

func EventStrToMap(fsevstr string) map[string]string

func OutboundServer

func OutboundServer(addr string, fn HandleFunc) error

Types

type Event

type Event struct {
	Header map[string]string // Event headers, key:val
	Body   string            // Raw body, available in some events
}

Event represents a FreeSWITCH event.

func (*Event) GetContentLength

func (self *Event) GetContentLength() int

func (*Event) GetContentType

func (self *Event) GetContentType() string

func (*Event) GetHeader

func (self *Event) GetHeader(key, defaultValue string) string

Get returns an Event value, or "" if the key doesn't exist.

func (*Event) GetInt

func (self *Event) GetInt(key string) (int, error)

GetInt returns an Event value converted to int, or an error if conversion is not possible.

func (*Event) GetReplyText

func (self *Event) GetReplyText() string

func (*Event) IsReplyTextSuccess

func (self *Event) IsReplyTextSuccess() bool

func (*Event) PrettyPrint

func (self *Event) PrettyPrint()

PrettyPrint prints Event headers and body to the standard output.

func (*Event) String

func (self *Event) String() string

type EventHeader

type EventHeader map[string]string

type EventSocket

type EventSocket struct {
	// contains filtered or unexported fields
}

func NewEventSocket

func NewEventSocket(c net.Conn, evntHandlers map[string][]func(*Event)) *EventSocket

func (*EventSocket) APICommand

func (e *EventSocket) APICommand(args string) (*Event, error)

func (*EventSocket) Answer

func (e *EventSocket) Answer(uuid string, islock bool) (*Event, error)

func (*EventSocket) AttXfer

func (e *EventSocket) AttXfer(url, uuid string, islock bool) (*Event, error)

func (*EventSocket) Auth

func (e *EventSocket) Auth(args string) (*Event, error)

func (*EventSocket) BgAPICommand

func (e *EventSocket) BgAPICommand(args string) (*Event, error)

func (*EventSocket) BindDigitAction

func (e *EventSocket) BindDigitAction(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) BindMetaApp

func (e *EventSocket) BindMetaApp(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Bridge

func (e *EventSocket) Bridge(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) ChannelConnect

func (e *EventSocket) ChannelConnect() (*Event, error)

func (*EventSocket) ClearDigitAction

func (e *EventSocket) ClearDigitAction(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Conference

func (e *EventSocket) Conference(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Connected

func (e *EventSocket) Connected() bool

func (*EventSocket) DigitActionSetRealm

func (e *EventSocket) DigitActionSetRealm(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Disconnect

func (e *EventSocket) Disconnect() (err error)

Disconnects from socket

func (*EventSocket) DivertEvents

func (e *EventSocket) DivertEvents(flag string) (*Event, error)

func (*EventSocket) EndlessPlayback

func (e *EventSocket) EndlessPlayback(filename, uuid string, islock bool) (*Event, error)

func (*EventSocket) Event

func (e *EventSocket) Event(args string) (*Event, error)

func (*EventSocket) EventJson

func (e *EventSocket) EventJson(args string) (*Event, error)

func (*EventSocket) EventPlain

func (e *EventSocket) EventPlain(args string) (*Event, error)

func (*EventSocket) Exit

func (e *EventSocket) Exit() (*Event, error)

func (*EventSocket) Export

func (e *EventSocket) Export(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Filter

func (e *EventSocket) Filter(args string) (*Event, error)

func (*EventSocket) FilterDelete

func (e *EventSocket) FilterDelete(args string) (*Event, error)

func (*EventSocket) FlushDtmf

func (e *EventSocket) FlushDtmf(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Hangup

func (e *EventSocket) Hangup(cause, uuid string, islock bool) (*Event, error)

func (*EventSocket) Hupall

func (e *EventSocket) Hupall(args string) (*Event, error)

func (*EventSocket) Linger

func (e *EventSocket) Linger() (*Event, error)

func (*EventSocket) MyEvent

func (e *EventSocket) MyEvent(uuid string) (*Event, error)

func (*EventSocket) PlayAndGetDigits

func (e *EventSocket) PlayAndGetDigits(minDigits, maxDigits, maxTries, timeout int, terminators, invalidFile, digitVarName, validDigits, digitTimeout, uuid string,
	playBeep bool, soundFiles []string) (*Event, error)

func (*EventSocket) PlayFsv

func (e *EventSocket) PlayFsv(filename, uuid string, islock bool) (*Event, error)

func (*EventSocket) Playback

func (e *EventSocket) Playback(filename, terminators, uuid string, islock bool, loops int) (*Event, error)

func (*EventSocket) PreAnswer

func (e *EventSocket) PreAnswer() (*Event, error)

func (*EventSocket) ProtocolSend

func (e *EventSocket) ProtocolSend(command, args string) (*Event, error)

func (*EventSocket) ProtocolSendMsg

func (e *EventSocket) ProtocolSendMsg(name, args, uuid string, Lock bool, loop int, asyn bool) (*Event, error)

func (*EventSocket) QueueDtmf

func (e *EventSocket) QueueDtmf(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Record

func (e *EventSocket) Record(fileName, timeLimit, silenceThresh, silenceHit, terminators, uuid string, loops int) (*Event, error)

func (*EventSocket) RecordFsv

func (e *EventSocket) RecordFsv(filename, uuid string, islock bool) (*Event, error)

func (*EventSocket) RecordSession

func (e *EventSocket) RecordSession(filename, uuid string, islock bool) (*Event, error)

func (*EventSocket) Resume

func (e *EventSocket) Resume() (*Event, error)

func (*EventSocket) RingReady

func (e *EventSocket) RingReady(cause, uuid string, islock bool) (*Event, error)

func (*EventSocket) Say

func (e *EventSocket) Say(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) SchedHangup

func (e *EventSocket) SchedHangup(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) SchedTransfer

func (e *EventSocket) SchedTransfer(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) SendEvent

func (e *EventSocket) SendEvent(args string) (*Event, error)

func (*EventSocket) Set

func (e *EventSocket) Set(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) SetGlobal

func (e *EventSocket) SetGlobal(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Sleep

func (e *EventSocket) Sleep(milliseconds, uuid string, islock bool) (*Event, error)

func (*EventSocket) Speak

func (e *EventSocket) Speak(text, uuid string, islock bool, loop int) (*Event, error)

func (*EventSocket) StartDtmf

func (e *EventSocket) StartDtmf(uuid string, islock bool) (*Event, error)

func (*EventSocket) StartDtmfGenerate

func (e *EventSocket) StartDtmfGenerate(uuid string, islock bool) (*Event, error)

func (*EventSocket) StopDtmf

func (e *EventSocket) StopDtmf(uuid string, islock bool) (*Event, error)

func (*EventSocket) StopDtmfGenerate

func (e *EventSocket) StopDtmfGenerate(uuid string, islock bool) (*Event, error)

func (*EventSocket) Transfer

func (e *EventSocket) Transfer(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) Unset

func (e *EventSocket) Unset(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) VerboseEvents

func (e *EventSocket) VerboseEvents(uuid string, islock bool) (*Event, error)

func (*EventSocket) Vmd

func (e *EventSocket) Vmd(args, uuid string, islock bool) (*Event, error)

func (*EventSocket) WaitForSilence

func (e *EventSocket) WaitForSilence(args, uuid string, islock bool) (*Event, error)

type HandleFunc

type HandleFunc func(*OutboundSocket)

HandleFunc is the function called on new incoming connections.

type InboundSocket

type InboundSocket struct {
	*EventSocket
	// contains filtered or unexported fields
}

func NewInboundSocket

func NewInboundSocket(address string, password string, reconnects int, isEventJson bool, eventHandlers map[string][]func(*Event)) (*InboundSocket, error)

func (*InboundSocket) Start

func (self *InboundSocket) Start()

Reads events from socket

type OutboundSocket

type OutboundSocket struct {
	Channel *Event
	*EventSocket
	// contains filtered or unexported fields
}

func NewOutboundSocket

func NewOutboundSocket(conn net.Conn) *OutboundSocket

func (*OutboundSocket) Connect

func (self *OutboundSocket) Connect(eventHandlers map[string][]func(*Event), isEventJson bool) error

func (*OutboundSocket) Start

func (self *OutboundSocket) Start()

Reads events from socket

Jump to

Keyboard shortcuts

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