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 ¶
- func EventStrToMap(fsevstr string) map[string]string
- func OutboundServer(addr string, fn HandleFunc) error
- type Event
- func (self *Event) GetContentLength() int
- func (self *Event) GetContentType() string
- func (self *Event) GetHeader(key, defaultValue string) string
- func (self *Event) GetInt(key string) (int, error)
- func (self *Event) GetReplyText() string
- func (self *Event) IsReplyTextSuccess() bool
- func (self *Event) PrettyPrint()
- func (self *Event) String() string
- type EventHeader
- type EventSocket
- func (e *EventSocket) APICommand(args string) (*Event, error)
- func (e *EventSocket) Answer(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) AttXfer(url, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Auth(args string) (*Event, error)
- func (e *EventSocket) BgAPICommand(args string) (*Event, error)
- func (e *EventSocket) BindDigitAction(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) BindMetaApp(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Bridge(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) ChannelConnect() (*Event, error)
- func (e *EventSocket) ClearDigitAction(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Conference(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Connected() bool
- func (e *EventSocket) DigitActionSetRealm(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Disconnect() (err error)
- func (e *EventSocket) DivertEvents(flag string) (*Event, error)
- func (e *EventSocket) EndlessPlayback(filename, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Event(args string) (*Event, error)
- func (e *EventSocket) EventJson(args string) (*Event, error)
- func (e *EventSocket) EventPlain(args string) (*Event, error)
- func (e *EventSocket) Exit() (*Event, error)
- func (e *EventSocket) Export(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Filter(args string) (*Event, error)
- func (e *EventSocket) FilterDelete(args string) (*Event, error)
- func (e *EventSocket) FlushDtmf(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Hangup(cause, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Hupall(args string) (*Event, error)
- func (e *EventSocket) Linger() (*Event, error)
- func (e *EventSocket) MyEvent(uuid string) (*Event, error)
- func (e *EventSocket) PlayAndGetDigits(minDigits, maxDigits, maxTries, timeout int, ...) (*Event, error)
- func (e *EventSocket) PlayFsv(filename, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Playback(filename, terminators, uuid string, islock bool, loops int) (*Event, error)
- func (e *EventSocket) PreAnswer() (*Event, error)
- func (e *EventSocket) ProtocolSend(command, args string) (*Event, error)
- func (e *EventSocket) ProtocolSendMsg(name, args, uuid string, Lock bool, loop int, asyn bool) (*Event, error)
- func (e *EventSocket) QueueDtmf(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Record(fileName, timeLimit, silenceThresh, silenceHit, terminators, uuid string, ...) (*Event, error)
- func (e *EventSocket) RecordFsv(filename, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) RecordSession(filename, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Resume() (*Event, error)
- func (e *EventSocket) RingReady(cause, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Say(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) SchedHangup(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) SchedTransfer(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) SendEvent(args string) (*Event, error)
- func (e *EventSocket) Set(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) SetGlobal(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Sleep(milliseconds, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Speak(text, uuid string, islock bool, loop int) (*Event, error)
- func (e *EventSocket) StartDtmf(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) StartDtmfGenerate(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) StopDtmf(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) StopDtmfGenerate(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Transfer(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Unset(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) VerboseEvents(uuid string, islock bool) (*Event, error)
- func (e *EventSocket) Vmd(args, uuid string, islock bool) (*Event, error)
- func (e *EventSocket) WaitForSilence(args, uuid string, islock bool) (*Event, error)
- type HandleFunc
- type InboundSocket
- type OutboundSocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventStrToMap ¶
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 (*Event) GetContentType ¶
func (*Event) GetInt ¶
GetInt returns an Event value converted to int, or an error if conversion is not possible.
func (*Event) GetReplyText ¶
func (*Event) IsReplyTextSuccess ¶
func (*Event) PrettyPrint ¶
func (self *Event) PrettyPrint()
PrettyPrint prints Event headers and body to the standard output.
type EventHeader ¶
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) AttXfer ¶
func (e *EventSocket) AttXfer(url, uuid string, islock bool) (*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) 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) 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) Linger ¶
func (e *EventSocket) Linger() (*Event, error)
func (*EventSocket) PlayAndGetDigits ¶
func (*EventSocket) PlayFsv ¶
func (e *EventSocket) PlayFsv(filename, uuid string, islock bool) (*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 (*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) 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) 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) 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) 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 ¶
type OutboundSocket ¶
type OutboundSocket struct { Channel *Event *EventSocket // contains filtered or unexported fields }
func NewOutboundSocket ¶
func NewOutboundSocket(conn net.Conn) *OutboundSocket