@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());
    }
  }
 /** {@inheritDoc} */
 public IConnection lookupConnection(IClient client) {
   for (IClient cli : clients) {
     if (cli.equals(client)) {
       Set<IConnection> set = cli.getConnections();
       if (set.size() > 1) {
         log.warn("Client connections exceeded expected single count; size: {}", set.size());
       }
       return set.iterator().next();
     }
   }
   return null;
 }
Exemple #3
0
 /**
  * Return client connections to given scope
  *
  * @param scope Scope
  * @return Set of connections for that scope
  */
 public Set<IConnection> getConnections(IScope scope) {
   if (scope == null) {
     return getConnections();
   }
   Set<IClient> scopeClients = scope.getClients();
   if (scopeClients.contains(this)) {
     for (IClient cli : scopeClients) {
       if (this.equals(cli)) {
         return cli.getConnections();
       }
     }
   }
   return Collections.emptySet();
 }
 /** {@inheritDoc} */
 public Set<IConnection> getClientConnections() {
   Set<IConnection> result = new HashSet<IConnection>(3);
   log.debug("Client count: {}", clients.size());
   for (IClient cli : clients) {
     Set<IConnection> set = cli.getConnections();
     log.debug("Client connection count: {}", set.size());
     if (set.size() > 1) {
       log.warn("Client connections exceeded expected single count; size: {}", set.size());
     }
     for (IConnection conn : set) {
       result.add(conn);
     }
   }
   return result;
 }
  @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;
  }
 /** {@inheritDoc} */
 @Deprecated
 public Set<IConnection> lookupConnections(IClient client) {
   HashSet<IConnection> result = new HashSet<IConnection>(1);
   if (clients.contains(client)) {
     for (IClient cli : clients) {
       if (cli.equals(client)) {
         Set<IConnection> set = cli.getConnections();
         if (set.size() > 1) {
           log.warn("Client connections exceeded expected single count; size: {}", set.size());
         }
         result.add(set.iterator().next());
         break;
       }
     }
   }
   return result;
 }