use of org.asteriskjava.manager.ResponseEvents in project openmeetings by apache.
the class SipDao method execEvent.
private ResponseEvents execEvent(EventGeneratingAction action) {
if (factory == null) {
log.warn("There is no Asterisk configured");
return null;
}
ManagerConnection con = getConnection();
try {
con.login("on");
ResponseEvents r = con.sendEventGeneratingAction(action);
if (r != null) {
log.debug(r.getResponse().toString());
}
return (r == null || r.getResponse() instanceof ManagerError) ? null : r;
} catch (Exception e) {
log.error("Error while executing EventGeneratingAction: " + action, e);
} finally {
try {
con.logoff();
} catch (Exception e) {
// no-op
}
}
return null;
}
use of org.asteriskjava.manager.ResponseEvents in project openmeetings by apache.
the class SipDao method countUsers.
public Integer countUsers(String confno) {
if (confno == null) {
return null;
}
ConfbridgeListAction da = new ConfbridgeListAction(confno);
ResponseEvents r = execEvent(da);
if (r != null) {
log.debug("SipDao::countUsers size == " + r.getEvents().size());
// "- 1" here means: ListComplete event
return r.getEvents().size() - 1;
}
return 0;
}
Aggregations