|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.freeswitch.esl.client.inbound.Client
public class Client
Entry point to connect to a running FreeSWITCH Event Socket Library module, as a client.
This class provides what the FreeSWITCH documentation refers to as an 'Inbound' connection to the Event Socket module. That is, with reference to the socket listening on the FreeSWITCH server, this client occurs as an inbound connection to the server.
See http://wiki.freeswitch.org/wiki/Mod_event_socket
| Constructor Summary | |
|---|---|
Client()
|
|
| Method Summary | |
|---|---|
CommandResponse |
addEventFilter(String eventHeader,
String valueToFilter)
Add an event filter to the current set of event filters on this connection. |
void |
addEventListener(IEslEventListener listener)
|
CommandResponse |
cancelEventSubscriptions()
Cancel any existing event subscription. |
CommandResponse |
cancelLogging()
Disable any logging previously enabled with setLogLevel(). |
boolean |
canSend()
|
CommandResponse |
close()
Close the socket connection |
void |
connect(String host,
int port,
String password,
int timeoutSeconds)
Attempt to establish an authenticated connection to the nominated FreeSWITCH ESL server socket. |
CommandResponse |
deleteEventFilter(String eventHeader,
String valueToFilter)
Delete an event filter from the current set of event filters on this connection. |
String |
sendAsyncApiCommand(String command,
String arg)
Submit a FreeSWITCH API command to the server to be executed in background mode. |
CommandResponse |
sendMessage(SendMsg sendMsg)
Send a SendMsg command to FreeSWITCH. |
EslMessage |
sendSyncApiCommand(String command,
String arg)
Sends a FreeSWITCH API command to the server and blocks, waiting for an immediate response from the server. |
CommandResponse |
setEventSubscriptions(String format,
String events)
Set the current event subscription for this connection to the server. |
CommandResponse |
setLoggingLevel(String level)
Enable log output. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client()
| Method Detail |
|---|
public boolean canSend()
public void addEventListener(IEslEventListener listener)
public void connect(String host,
int port,
String password,
int timeoutSeconds)
throws InboundConnectionFailure
host - can be either ip address or hostnameport - tcp port that server socket is listening on (set in event_socket_conf.xml)password - server event socket is expecting (set in event_socket_conf.xml)timeoutSeconds - number of seconds to wait for the server socket before aborting
InboundConnectionFailure
public EslMessage sendSyncApiCommand(String command,
String arg)
EslMessage object.
command - API command to sendarg - command arguments
EslMessage containing command results
public String sendAsyncApiCommand(String command,
String arg)
command - API command to sendarg - command arguments
public CommandResponse setEventSubscriptions(String format,
String events)
ALL CHANNEL_CREATE CHANNEL_DESTROY HEARTBEAT CUSTOM conference::maintenance CHANNEL_CREATE CHANNEL_DESTROY CUSTOM conference::maintenance sofia::register sofia::expireSubsequent calls to this method replaces any previous subscriptions that were set. Note: current implementation can only process 'plain' events.
format - can be { plain | xml }events - { all | space separated list of events }
CommandResponse with the server's response.public CommandResponse cancelEventSubscriptions()
CommandResponse with the server's response.
public CommandResponse addEventFilter(String eventHeader,
String valueToFilter)
eventHeader valueToFilter
----------------------------------
Event-Name CHANNEL_EXECUTE
Channel-State CS_NEW
eventHeader - to filter onvalueToFilter - the value to match
CommandResponse with the server's response.
public CommandResponse deleteEventFilter(String eventHeader,
String valueToFilter)
Client.addEventFilter
eventHeader - to removevalueToFilter - to remove
CommandResponse with the server's response.public CommandResponse sendMessage(SendMsg sendMsg)
SendMsg command to FreeSWITCH. This client requires that the SendMsg
has a call UUID parameter.
sendMsg - a SendMsg with call UUID
CommandResponse with the server's response.public CommandResponse setLoggingLevel(String level)
level - using the same values as in console.conf
CommandResponse with the server's response.public CommandResponse cancelLogging()
CommandResponse with the server's response.public CommandResponse close()
CommandResponse with the server's response.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||