You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openmeetings.apache.org by Vieri <re...@yahoo.com> on 2013/01/30 08:31:12 UTC

roomConnect

Hi,

I'd like to know which part of the OM source code is executed when a user clicks on the "Enter" button when trying to access a room. I believe it could be:

org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect

I also suppose that this method is called even when users enter a room via invitation hash.

I'm trying to find the right place in the source code to customize room access (allow/deny) according to custom requirements.
Is roomConnect always called before entering ANY conference room?

Are there any other classes/methods I should look for?

Thanks,

Vieri


Re: roomConnect

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Did you see the method signature in the ScopeApplicationAdapter?
public synchronized RoomStatus setRoomValues(Long room_id,
            Boolean becomeModerator, Boolean isSuperModerator,
            Long organization_id, String colorObj)

You have to specify the correct number and types of arguments, otherwise
you can't call this method.
Also to "kick" a user after the connection has been established the _best_
place to kick him is on server side.

Have a look at the method "setRoomValues" on the server side, it already
contains a lot of logic to set certain values depending on user rights and
default moderation role.
You could add your logic simply at the end of the method.
To kick any user you can trigger the method "logicalRoomLeave()" (again not
from the client, simply add this method call at the end of the Java method
on server side whenever you think the client should be kicked).

There is already an implementation to show a message box in the client when
you kick somebody out of the room but eventually you have to send an extra
event to the client upfront


2013/1/31 Fasil Mohammed <fa...@gmail.com>

> I get an error when I fire setRoomValues "MethodNotFound"
>
>
> conferenceServer = new NetConnection();
> conferenceServer.client = this;
> conferenceServer.objectEncoding = ObjectEncoding.AMF0;
> conferenceServer.connect(rmptUrlText.text +
> roomList.selectedItem.rooms_id);
> conferenceServer.addEventListener( NetStatusEvent.NET_STATUS,
> conferenceConnectionStatus_Changed );
> conferenceServer.addEventListener(IOErrorEvent.IO_ERROR, errorStatus);
>
>
> protected function
> conferenceConnectionStatus_Changed(event:NetStatusEvent):void
>  {
> if ( event.info.code == "NetConnection.Connect.Success" )
> {
>  *conferenceServer.call.apply(this, ["setRoomValues",
> textChatRoomConnectResp, _selectedRoomId]);*
> }
>  else if(event.info.code == "NetConnection.Call.Failed")
> {
>  }
> else
> {
>  }
> }
>
>
>
> any help please?
>
>
>
>
>
>
>
> On Wed, Jan 30, 2013 at 2:42 PM, Vieri <re...@yahoo.com> wrote:
>
> > Thanks Sebastian.
> >
> > So maybe I could add my custom logic in setRoomValues. Now I just need to
> > find the correct way to "auto-disconnect" the user from the room when my
> > custom logic decides to do so (basically depends on my network and cpu
> > resources at a given time).
> >
> > Any suggestions?
> >
> > Vieri
> >
> > --- On Wed, 1/30/13, seba.wagner@gmail.com <se...@gmail.com>
> wrote:
> >
> > > From: seba.wagner@gmail.com <se...@gmail.com>
> > > Subject: Re: roomConnect
> > > To: "dev" <de...@openmeetings.apache.org>
> > > Date: Wednesday, January 30, 2013, 2:36 AM
> > > Hallo Vieri
> > >
> > > roomConnect is an event handler that gets automatically
> > > called in the
> > > server interface. The client never actively "calls" this
> > > method. You can
> > > see that by the @Override annotation in the
> > > ScopeApplicationAdapter. Every
> > > Override is an event, not a actively called method.
> > >
> > > The client simply disconnects and uses the url:
> > > rtmp://host:port/openmeetings/1 (for room_id 1)
> > >
> > > And later on calls "setRoomValues" as soon as he has
> > > successfully connected.
> > >
> > > Sebastian
> > >
> > >
> > > 2013/1/30 Vieri <re...@yahoo.com>
> > >
> > > > Hi,
> > > >
> > > > I'd like to know which part of the OM source code is
> > > executed when a user
> > > > clicks on the "Enter" button when trying to access a
> > > room. I believe it
> > > > could be:
> > > >
> > > >
> > > org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
> > > >
> > > > I also suppose that this method is called even when
> > > users enter a room via
> > > > invitation hash.
> > > >
> > > > I'm trying to find the right place in the source code
> > > to customize room
> > > > access (allow/deny) according to custom requirements.
> > > > Is roomConnect always called before entering ANY
> > > conference room?
> > > >
> > > > Are there any other classes/methods I should look for?
> > > >
> > > > Thanks,
> > > >
> > > > Vieri
> > > >
> > > >
> > >
> > >
> > > --
> > > Sebastian Wagner
> > > https://twitter.com/#!/dead_lock
> > > http://www.webbase-design.de
> > > http://www.wagner-sebastian.com
> > > seba.wagner@gmail.com
> > >
> >
>
>
>
> --
> Regards,
> Mohammed Fasil
> TVM, Kerala, S.India
> +919746458831
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: roomConnect

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Did you see the method signature in the ScopeApplicationAdapter?
public synchronized RoomStatus setRoomValues(Long room_id,
            Boolean becomeModerator, Boolean isSuperModerator,
            Long organization_id, String colorObj)

You have to specify the correct number and types of arguments, otherwise
you can't call this method.
Also to "kick" a user after the connection has been established the _best_
place to kick him is on server side.

Have a look at the method "setRoomValues" on the server side, it already
contains a lot of logic to set certain values depending on user rights and
default moderation role.
You could add your logic simply at the end of the method.
To kick any user you can trigger the method "logicalRoomLeave()" (again not
from the client, simply add this method call at the end of the Java method
on server side whenever you think the client should be kicked).

There is already an implementation to show a message box in the client when
you kick somebody out of the room but eventually you have to send an extra
event to the client upfront "logicalRoomLeave()" call, so that the message
is broadcasted to the client as long as there is actually a connection
available.

Sebastian


2013/1/31 Fasil Mohammed <fa...@gmail.com>

> I get an error when I fire setRoomValues "MethodNotFound"
>
>
> conferenceServer = new NetConnection();
> conferenceServer.client = this;
> conferenceServer.objectEncoding = ObjectEncoding.AMF0;
> conferenceServer.connect(rmptUrlText.text +
> roomList.selectedItem.rooms_id);
> conferenceServer.addEventListener( NetStatusEvent.NET_STATUS,
> conferenceConnectionStatus_Changed );
> conferenceServer.addEventListener(IOErrorEvent.IO_ERROR, errorStatus);
>
>
> protected function
> conferenceConnectionStatus_Changed(event:NetStatusEvent):void
>  {
> if ( event.info.code == "NetConnection.Connect.Success" )
> {
>  *conferenceServer.call.apply(this, ["setRoomValues",
> textChatRoomConnectResp, _selectedRoomId]);*
> }
>  else if(event.info.code == "NetConnection.Call.Failed")
> {
>  }
> else
> {
>  }
> }
>
>
>
> any help please?
>
>
>
>
>
>
>
> On Wed, Jan 30, 2013 at 2:42 PM, Vieri <re...@yahoo.com> wrote:
>
> > Thanks Sebastian.
> >
> > So maybe I could add my custom logic in setRoomValues. Now I just need to
> > find the correct way to "auto-disconnect" the user from the room when my
> > custom logic decides to do so (basically depends on my network and cpu
> > resources at a given time).
> >
> > Any suggestions?
> >
> > Vieri
> >
> > --- On Wed, 1/30/13, seba.wagner@gmail.com <se...@gmail.com>
> wrote:
> >
> > > From: seba.wagner@gmail.com <se...@gmail.com>
> > > Subject: Re: roomConnect
> > > To: "dev" <de...@openmeetings.apache.org>
> > > Date: Wednesday, January 30, 2013, 2:36 AM
> > > Hallo Vieri
> > >
> > > roomConnect is an event handler that gets automatically
> > > called in the
> > > server interface. The client never actively "calls" this
> > > method. You can
> > > see that by the @Override annotation in the
> > > ScopeApplicationAdapter. Every
> > > Override is an event, not a actively called method.
> > >
> > > The client simply disconnects and uses the url:
> > > rtmp://host:port/openmeetings/1 (for room_id 1)
> > >
> > > And later on calls "setRoomValues" as soon as he has
> > > successfully connected.
> > >
> > > Sebastian
> > >
> > >
> > > 2013/1/30 Vieri <re...@yahoo.com>
> > >
> > > > Hi,
> > > >
> > > > I'd like to know which part of the OM source code is
> > > executed when a user
> > > > clicks on the "Enter" button when trying to access a
> > > room. I believe it
> > > > could be:
> > > >
> > > >
> > > org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
> > > >
> > > > I also suppose that this method is called even when
> > > users enter a room via
> > > > invitation hash.
> > > >
> > > > I'm trying to find the right place in the source code
> > > to customize room
> > > > access (allow/deny) according to custom requirements.
> > > > Is roomConnect always called before entering ANY
> > > conference room?
> > > >
> > > > Are there any other classes/methods I should look for?
> > > >
> > > > Thanks,
> > > >
> > > > Vieri
> > > >
> > > >
> > >
> > >
> > > --
> > > Sebastian Wagner
> > > https://twitter.com/#!/dead_lock
> > > http://www.webbase-design.de
> > > http://www.wagner-sebastian.com
> > > seba.wagner@gmail.com
> > >
> >
>
>
>
> --
> Regards,
> Mohammed Fasil
> TVM, Kerala, S.India
> +919746458831
>



-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com

Re: roomConnect

Posted by Fasil Mohammed <fa...@gmail.com>.
I get an error when I fire setRoomValues "MethodNotFound"


conferenceServer = new NetConnection();
conferenceServer.client = this;
conferenceServer.objectEncoding = ObjectEncoding.AMF0;
conferenceServer.connect(rmptUrlText.text + roomList.selectedItem.rooms_id);
conferenceServer.addEventListener( NetStatusEvent.NET_STATUS,
conferenceConnectionStatus_Changed );
conferenceServer.addEventListener(IOErrorEvent.IO_ERROR, errorStatus);


protected function
conferenceConnectionStatus_Changed(event:NetStatusEvent):void
 {
if ( event.info.code == "NetConnection.Connect.Success" )
{
 *conferenceServer.call.apply(this, ["setRoomValues",
textChatRoomConnectResp, _selectedRoomId]);*
}
 else if(event.info.code == "NetConnection.Call.Failed")
{
 }
else
{
 }
}



any help please?







On Wed, Jan 30, 2013 at 2:42 PM, Vieri <re...@yahoo.com> wrote:

> Thanks Sebastian.
>
> So maybe I could add my custom logic in setRoomValues. Now I just need to
> find the correct way to "auto-disconnect" the user from the room when my
> custom logic decides to do so (basically depends on my network and cpu
> resources at a given time).
>
> Any suggestions?
>
> Vieri
>
> --- On Wed, 1/30/13, seba.wagner@gmail.com <se...@gmail.com> wrote:
>
> > From: seba.wagner@gmail.com <se...@gmail.com>
> > Subject: Re: roomConnect
> > To: "dev" <de...@openmeetings.apache.org>
> > Date: Wednesday, January 30, 2013, 2:36 AM
> > Hallo Vieri
> >
> > roomConnect is an event handler that gets automatically
> > called in the
> > server interface. The client never actively "calls" this
> > method. You can
> > see that by the @Override annotation in the
> > ScopeApplicationAdapter. Every
> > Override is an event, not a actively called method.
> >
> > The client simply disconnects and uses the url:
> > rtmp://host:port/openmeetings/1 (for room_id 1)
> >
> > And later on calls "setRoomValues" as soon as he has
> > successfully connected.
> >
> > Sebastian
> >
> >
> > 2013/1/30 Vieri <re...@yahoo.com>
> >
> > > Hi,
> > >
> > > I'd like to know which part of the OM source code is
> > executed when a user
> > > clicks on the "Enter" button when trying to access a
> > room. I believe it
> > > could be:
> > >
> > >
> > org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
> > >
> > > I also suppose that this method is called even when
> > users enter a room via
> > > invitation hash.
> > >
> > > I'm trying to find the right place in the source code
> > to customize room
> > > access (allow/deny) according to custom requirements.
> > > Is roomConnect always called before entering ANY
> > conference room?
> > >
> > > Are there any other classes/methods I should look for?
> > >
> > > Thanks,
> > >
> > > Vieri
> > >
> > >
> >
> >
> > --
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
> >
>



-- 
Regards,
Mohammed Fasil
TVM, Kerala, S.India
+919746458831

Re: roomConnect

Posted by Vieri <re...@yahoo.com>.
My simple workaround was to change the setRoomValues method and insert my custom logic there. I run some system checks (CPU, MEM and network usage, also look for current active users within conference rooms) and decide whether to allow the user to enter a room or not. If I decide that the user can't enter then I do something like roomStatus.setRoomFull(true).

Could it be possible for the native OM to include a "hook" in the setRoomValues method (such as a system call or a plug-in) so that any other system admin/programmer can run their own checks and decide to allow or not access to a room without the need to modify OM's source code?
The simplest hack would be to run an external process from setRoomValues (via process/exec) and read its output. So admins would only have to write scripts or programs in any language and output either 1 or 0 (in this case). According to the exit code setRoomValues would then decide to set the room as full/inaccessible or not.

Could this be useful?

--- On Wed, 1/30/13, Vieri <re...@yahoo.com> wrote:

> Thanks Sebastian.
> 
> So maybe I could add my custom logic in setRoomValues. Now I
> just need to find the correct way to "auto-disconnect" the
> user from the room when my custom logic decides to do so
> (basically depends on my network and cpu resources at a
> given time).
> 
> Any suggestions?
> 
> Vieri
> 
> --- On Wed, 1/30/13, seba.wagner@gmail.com
> <se...@gmail.com>
> wrote:
> 
> > From: seba.wagner@gmail.com
> <se...@gmail.com>
> > Subject: Re: roomConnect
> > To: "dev" <de...@openmeetings.apache.org>
> > Date: Wednesday, January 30, 2013, 2:36 AM
> > Hallo Vieri
> > 
> > roomConnect is an event handler that gets
> automatically
> > called in the
> > server interface. The client never actively "calls"
> this
> > method. You can
> > see that by the @Override annotation in the
> > ScopeApplicationAdapter. Every
> > Override is an event, not a actively called method.
> > 
> > The client simply disconnects and uses the url:
> > rtmp://host:port/openmeetings/1 (for room_id 1)
> > 
> > And later on calls "setRoomValues" as soon as he has
> > successfully connected.
> > 
> > Sebastian
> > 
> > 
> > 2013/1/30 Vieri <re...@yahoo.com>
> > 
> > > Hi,
> > >
> > > I'd like to know which part of the OM source code
> is
> > executed when a user
> > > clicks on the "Enter" button when trying to access
> a
> > room. I believe it
> > > could be:
> > >
> > >
> >
> org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
> > >
> > > I also suppose that this method is called even
> when
> > users enter a room via
> > > invitation hash.
> > >
> > > I'm trying to find the right place in the source
> code
> > to customize room
> > > access (allow/deny) according to custom
> requirements.
> > > Is roomConnect always called before entering ANY
> > conference room?
> > >
> > > Are there any other classes/methods I should look
> for?
> > >
> > > Thanks,
> > >
> > > Vieri
> > >
> > >
> > 
> > 
> > -- 
> > Sebastian Wagner
> > https://twitter.com/#!/dead_lock
> > http://www.webbase-design.de
> > http://www.wagner-sebastian.com
> > seba.wagner@gmail.com
> > 
> 

Re: roomConnect

Posted by Vieri <re...@yahoo.com>.
Thanks Sebastian.

So maybe I could add my custom logic in setRoomValues. Now I just need to find the correct way to "auto-disconnect" the user from the room when my custom logic decides to do so (basically depends on my network and cpu resources at a given time).

Any suggestions?

Vieri

--- On Wed, 1/30/13, seba.wagner@gmail.com <se...@gmail.com> wrote:

> From: seba.wagner@gmail.com <se...@gmail.com>
> Subject: Re: roomConnect
> To: "dev" <de...@openmeetings.apache.org>
> Date: Wednesday, January 30, 2013, 2:36 AM
> Hallo Vieri
> 
> roomConnect is an event handler that gets automatically
> called in the
> server interface. The client never actively "calls" this
> method. You can
> see that by the @Override annotation in the
> ScopeApplicationAdapter. Every
> Override is an event, not a actively called method.
> 
> The client simply disconnects and uses the url:
> rtmp://host:port/openmeetings/1 (for room_id 1)
> 
> And later on calls "setRoomValues" as soon as he has
> successfully connected.
> 
> Sebastian
> 
> 
> 2013/1/30 Vieri <re...@yahoo.com>
> 
> > Hi,
> >
> > I'd like to know which part of the OM source code is
> executed when a user
> > clicks on the "Enter" button when trying to access a
> room. I believe it
> > could be:
> >
> >
> org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
> >
> > I also suppose that this method is called even when
> users enter a room via
> > invitation hash.
> >
> > I'm trying to find the right place in the source code
> to customize room
> > access (allow/deny) according to custom requirements.
> > Is roomConnect always called before entering ANY
> conference room?
> >
> > Are there any other classes/methods I should look for?
> >
> > Thanks,
> >
> > Vieri
> >
> >
> 
> 
> -- 
> Sebastian Wagner
> https://twitter.com/#!/dead_lock
> http://www.webbase-design.de
> http://www.wagner-sebastian.com
> seba.wagner@gmail.com
> 

Re: roomConnect

Posted by "seba.wagner@gmail.com" <se...@gmail.com>.
Hallo Vieri

roomConnect is an event handler that gets automatically called in the
server interface. The client never actively "calls" this method. You can
see that by the @Override annotation in the ScopeApplicationAdapter. Every
Override is an event, not a actively called method.

The client simply disconnects and uses the url:
rtmp://host:port/openmeetings/1 (for room_id 1)

And later on calls "setRoomValues" as soon as he has successfully connected.

Sebastian


2013/1/30 Vieri <re...@yahoo.com>

> Hi,
>
> I'd like to know which part of the OM source code is executed when a user
> clicks on the "Enter" button when trying to access a room. I believe it
> could be:
>
> org.apache.openmeetings.remote.red5.ScopeApplicationAdapter#roomConnect
>
> I also suppose that this method is called even when users enter a room via
> invitation hash.
>
> I'm trying to find the right place in the source code to customize room
> access (allow/deny) according to custom requirements.
> Is roomConnect always called before entering ANY conference room?
>
> Are there any other classes/methods I should look for?
>
> Thanks,
>
> Vieri
>
>


-- 
Sebastian Wagner
https://twitter.com/#!/dead_lock
http://www.webbase-design.de
http://www.wagner-sebastian.com
seba.wagner@gmail.com