Search in sources :

Example 1 with IScope

use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.

the class ConnectionInvokerService method handleDisconnectAllClientsMessage.

private void handleDisconnectAllClientsMessage(DisconnectAllClientsMessage msg) {
    IScope meetingScope = getScope(msg.getMeetingId());
    if (meetingScope != null) {
        Set<IConnection> conns = meetingScope.getClientConnections();
        for (IConnection conn : conns) {
            if (conn.isConnected()) {
                String connId = (String) conn.getAttribute("USERID");
                log.info("Disconnecting client=[{}] from meeting=[{}]", connId, msg.getMeetingId());
                conn.close();
            }
        }
    }
}
Also used : IScope(org.red5.server.api.scope.IScope) IConnection(org.red5.server.api.IConnection)

Example 2 with IScope

use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.

the class ConnectionInvokerService method handlDisconnectClientMessage.

private void handlDisconnectClientMessage(DisconnectClientMessage msg) {
    IScope meetingScope = getScope(msg.getMeetingId());
    if (meetingScope != null) {
        IConnection conn = getConnection(meetingScope, msg.getUserId());
        if (conn != null) {
            if (conn.isConnected()) {
                log.info("Disconnecting user=[{}] from meeting=[{}]", msg.getUserId(), msg.getMeetingId());
                conn.close();
            }
        }
    }
}
Also used : IScope(org.red5.server.api.scope.IScope) IConnection(org.red5.server.api.IConnection)

Example 3 with IScope

use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.

the class SipPhoneApplication method appLeave.

@Override
public void appLeave(IClient client, IScope scope) {
    IConnection conn = Red5.getConnectionLocal();
    loginfo("Red5SIP Client leaving app " + client.getId());
    if (userNames.containsKey(client.getId())) {
        loginfo("Red5SIP Client closing client " + userNames.get(client.getId()));
        //            sipManager.closeSIPUser( userNames.get( client.getId() ) );
        userNames.remove(client.getId());
    }
}
Also used : IConnection(org.red5.server.api.IConnection)

Example 4 with IScope

use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.

the class SipPhoneApplication method appJoin.

@Override
public boolean appJoin(IClient client, IScope scope) {
    loginfo("Red5SIP Client joined app " + client.getId());
    IConnection conn = Red5.getConnectionLocal();
    IServiceCapableConnection service = (IServiceCapableConnection) conn;
    return true;
}
Also used : IServiceCapableConnection(org.red5.server.api.service.IServiceCapableConnection) IConnection(org.red5.server.api.IConnection)

Example 5 with IScope

use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.

the class ListenStream method startPublishing.

private void startPublishing(IScope aScope) {
    System.out.println("started publishing stream in " + aScope.getName());
    broadcastStream = new AudioStream(listenStreamName);
    broadcastStream.setPublishedName(listenStreamName);
    broadcastStream.setScope(aScope);
    IContext context = aScope.getContext();
    IProviderService providerService = (IProviderService) context.getBean(IProviderService.BEAN_NAME);
    if (providerService.registerBroadcastStream(aScope, listenStreamName, broadcastStream)) {
    // Do nothing.
    } else {
        log.error("could not register broadcast stream");
        throw new RuntimeException("could not register broadcast stream");
    }
    broadcastStream.start();
}
Also used : AudioStream(org.red5.app.sip.AudioStream) IContext(org.red5.server.api.IContext) IProviderService(org.red5.server.stream.IProviderService)

Aggregations

IScope (org.red5.server.api.scope.IScope)27 IConnection (org.red5.server.api.IConnection)9 ISharedObject (org.red5.server.api.so.ISharedObject)5 ArrayList (java.util.ArrayList)4 Gson (com.google.gson.Gson)3 ExecutionException (java.util.concurrent.ExecutionException)2 TimeoutException (java.util.concurrent.TimeoutException)2 HashMap (java.util.HashMap)1 IoBuffer (org.apache.mina.core.buffer.IoBuffer)1 AudioStream (org.red5.app.sip.AudioStream)1 IContext (org.red5.server.api.IContext)1 IServiceCapableConnection (org.red5.server.api.service.IServiceCapableConnection)1 IBroadcastStream (org.red5.server.api.stream.IBroadcastStream)1 IStreamListener (org.red5.server.api.stream.IStreamListener)1 IStreamPacket (org.red5.server.api.stream.IStreamPacket)1 AudioData (org.red5.server.net.rtmp.event.AudioData)1 IProviderService (org.red5.server.stream.IProviderService)1