}
public synchronized void setSipTransport(Long room_id, String publicSID, String broadCastId) {
log.debug("----------- setSipTransport");
IConnection current = Red5.getConnectionLocal();
IClient c = current.getClient();
String streamid = c.getId();
// Notify all clients of the same scope (room)
Client currentClient = sessionManager.getClientByStreamId(streamid, null);
currentClient.setSipTransport(true);
currentClient.setRoom_id(room_id);
currentClient.setRoomEnter(new Date());
currentClient.setFirstname("SIP Transport");
currentClient.setLastname(getSipTransportLastname(room_id));
currentClient.setBroadCastID(Long.parseLong(broadCastId));
currentClient.setIsBroadcasting(true);
currentClient.setPublicSID(publicSID);
currentClient.setVWidth(120);
currentClient.setVHeight(90);
currentClient.setPicture_uri("phone.png");
sessionManager.updateClientByStreamId(streamid, currentClient, false, null);
SessionVariablesUtil.initClient(c, false, publicSID);
Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
IClient client = conn.getClient();
if (SessionVariablesUtil.isScreenClient(client)) {
// screen sharing clients do not receive events
continue;
} else if (SessionVariablesUtil.isAVClient(client)) {
// AVClients or potential AVClients do not receive events
continue;
}
if (!client.getId().equals(current.getClient().getId())) {
// It is not needed to send back that event to the actual Moderator
// as it will be already triggered in the result of this Function in the Client
if (conn instanceof IServiceCapableConnection) {
((IServiceCapableConnection) conn).invoke("addNewUser", new Object[] { currentClient }, this);
log.debug("sending setSipTransport to " + conn);