use of org.freeswitch.esl.client.transport.message.EslMessage in project openhab1-addons by openhab.
the class FreeswitchBinding method initMessageItems.
/**
* query freeswitch for the message count for VM accounts. This should
* be done every time we connect to the system.
*/
private void initMessageItems() {
mwiCache.clear();
for (FreeswitchBindingProvider provider : providers) {
for (String itemName : provider.getItemNames()) {
FreeswitchBindingConfig config = provider.getFreeswitchBindingConfig(itemName);
if (config.getType() == FreeswitchBindingType.MESSAGE_WAITING) {
String account = config.getArgument();
if (!mwiCache.containsKey(account) && clientValid()) {
EslMessage msg = inboudClient.sendSyncApiCommand("vm_boxcount", account);
if (msg.getBodyLines().size() == 1) {
try {
int messages = Integer.parseInt(msg.getBodyLines().get(0));
mwiCache.put(account, new MWIModel(messages > 0, messages));
updateMessageWaitingItem(config);
} catch (Exception e) {
logger.error("Could not parse messages", e);
}
}
}
}
}
}
}
use of org.freeswitch.esl.client.transport.message.EslMessage in project bigbluebutton by bigbluebutton.
the class ConnectionManager method hangUp.
public void hangUp(DeskShareHangUpCommand huCmd) {
Client c = manager.getESLClient();
if (c.canSend()) {
System.out.println("ConnectionManager: send to FS: hangUp " + huCmd.getCommandArgs());
EslMessage response = c.sendSyncApiCommand(huCmd.getCommand(), huCmd.getCommandArgs());
huCmd.handleResponse(response, conferenceEventListener);
}
}
use of org.freeswitch.esl.client.transport.message.EslMessage in project bigbluebutton by bigbluebutton.
the class ConnectionManager method record.
public void record(RecordConferenceCommand rcc) {
Client c = manager.getESLClient();
if (c.canSend()) {
EslMessage response = c.sendSyncApiCommand(rcc.getCommand(), rcc.getCommandArgs());
rcc.handleResponse(response, conferenceEventListener);
}
}
use of org.freeswitch.esl.client.transport.message.EslMessage in project bigbluebutton by bigbluebutton.
the class ConnectionManager method broadcastRTMP.
public void broadcastRTMP(DeskShareBroadcastRTMPCommand rtmp) {
Client c = manager.getESLClient();
if (c.canSend()) {
System.out.println("ConnectionManager: send to FS: broadcastRTMP " + rtmp.getCommandArgs());
EslMessage response = c.sendSyncApiCommand(rtmp.getCommand(), rtmp.getCommandArgs());
rtmp.handleResponse(response, conferenceEventListener);
}
}
use of org.freeswitch.esl.client.transport.message.EslMessage in project bigbluebutton by bigbluebutton.
the class Client method cancelLogging.
/**
* Disable any logging previously enabled with setLogLevel().
*
* @return a {@link CommandResponse} with the server's response.
*/
public CommandResponse cancelLogging() {
checkConnected();
InboundClientHandler handler = (InboundClientHandler) channel.getPipeline().getLast();
EslMessage response = handler.sendSyncSingleLineCommand(channel, "nolog");
return new CommandResponse("nolog", response);
}
Aggregations