Documentation ¶
Index ¶
- type Command
- type Connection
- func (con *Connection) Api(cmd string, args ...string) (string, error)
- func (con *Connection) Authenticate() error
- func (con *Connection) BgApi(cmd string, args ...string) (string, error)
- func (con *Connection) Close()
- func (con *Connection) ConnectRetry(MaxRetries int) error
- func (con *Connection) Execute(app string, uuid string, params ...string) (*Event, error)
- func (con *Connection) ExecuteSync(app string, uuid string, params ...string) (*Event, error)
- func (con *Connection) HandleEvents() error
- func (con *Connection) MustSendRecv(cmd string, args ...string) *Event
- func (con *Connection) SendEvent(cmd string, headers map[string]string, body []byte) (*Event, error)
- func (con *Connection) SendRecv(cmd string, args ...string) (*Event, error)
- func (con *Connection) Write(b []byte) (int, error)
- type ConnectionHandler
- type Event
- type EventName
- type EventType
- type MIMEMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Connection ¶
type Connection struct { Handler ConnectionHandler Address string Password string Connected bool MaxRetries int Timeout time.Duration UserData interface{} // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(host string, handler ConnectionHandler) (*Connection, error)
func (*Connection) Authenticate ¶
func (con *Connection) Authenticate() error
Authenticate handles freeswitch esl authentication
func (*Connection) Close ¶
func (con *Connection) Close()
func (*Connection) ConnectRetry ¶
func (con *Connection) ConnectRetry(MaxRetries int) error
func (*Connection) ExecuteSync ¶
func (*Connection) HandleEvents ¶
func (con *Connection) HandleEvents() error
func (*Connection) MustSendRecv ¶
func (con *Connection) MustSendRecv(cmd string, args ...string) *Event
type ConnectionHandler ¶
type ConnectionHandler interface { OnConnect(con *Connection) OnEvent(con *Connection, ev *Event) OnDisconnect(con *Connection, ev *Event) OnClose(con *Connection) }
type Event ¶
type Event struct { UId string Name EventName App string AppData string Stamp int Type EventType Header MIMEMap Body MIMEMap RawBody []byte }
func (Event) Get ¶
Get retrieves the value of header from Event header or (if not found) from Event body. The value is returned unescaped and is empty if not found anywhere.
func (*Event) GetTextBody ¶
type EventName ¶
type EventName int
const ( CUSTOM EventName = iota CLONE CHANNEL_CREATE CHANNEL_DESTROY CHANNEL_STATE CHANNEL_CALLSTATE CHANNEL_ANSWER CHANNEL_HANGUP CHANNEL_HANGUP_COMPLETE CHANNEL_EXECUTE CHANNEL_EXECUTE_COMPLETE CHANNEL_HOLD CHANNEL_UNHOLD CHANNEL_BRIDGE CHANNEL_UNBRIDGE CHANNEL_PROGRESS CHANNEL_PROGRESS_MEDIA CHANNEL_OUTGOING CHANNEL_PARK CHANNEL_UNPARK CHANNEL_APPLICATION CHANNEL_ORIGINATE CHANNEL_UUID API LOG INBOUND_CHAN OUTBOUND_CHAN STARTUP SHUTDOWN PUBLISH UNPUBLISH TALK NOTALK SESSION_CRASH MODULE_LOAD MODULE_UNLOAD DTMF MESSAGE PRESENCE_IN NOTIFY_IN PRESENCE_OUT PRESENCE_PROBE MESSAGE_WAITING MESSAGE_QUERY ROSTER CODEC BACKGROUND_JOB DETECTED_SPEECH DETECTED_TONE PRIVATE_COMMAND HEARTBEAT TRAP ADD_SCHEDULE DEL_SCHEDULE EXE_SCHEDULE RE_SCHEDULE RELOADXML NOTIFY PHONE_FEATURE PHONE_FEATURE_SUBSCRIBE SEND_MESSAGE RECV_MESSAGE REQUEST_PARAMS CHANNEL_DATA GENERAL COMMAND SESSION_HEARTBEAT CLIENT_DISCONNECTED SERVER_DISCONNECTED SEND_INFO RECV_INFO RECV_RTCP_MESSAGE CALL_SECURE NAT RECORD_START RECORD_STOP PLAYBACK_START PLAYBACK_STOP CALL_UPDATE FAILURE SOCKET_DATA MEDIA_BUG_START MEDIA_BUG_STOP CONFERENCE_DATA_QUERY CONFERENCE_DATA CALL_SETUP_REQ CALL_SETUP_RESULT CALL_DETAIL DEVICE_STATE ALL )
func EventNameString ¶
Click to show internal directories.
Click to hide internal directories.