Error in erizoController.js for removeSubscriptions

This thread is actually a confirmation of another post that was a reply to
an older off topic post on “unsure where to customize” thread listed here:

https://groups.google.com/forum/#!searchin/lynckia/removeSubscription/lynckia/dfNgOa0z2WA/YDFEF-7wfVoJ

Below is the post so you don’t have to go look it up.

Anyway, we ran into the same issue. The error “Cannot call method
‘removeSubscriptions’ of undefined” is because the “roomController” isn’t
defined in the deleteRoom function. In rooms[room] there is a “controller”
with that definition but there is no “roomController”.

We had to add code to get around this but we are not sure it is the correct
code as it just skips the removeSubscriptions call:

sockets = rooms[room].sockets;


for (id in sockets) {
    if (sockets.hasOwnProperty(id)) {
        if (rooms[room] === undefined) {
            log.info('rooms[room] is undefined ', room, rooms);
        } else {
            if (rooms[room].roomController === undefined) {
                log.info('rooms[room].roomController is undefined ', 

room, rooms);
} else {
rooms[room].roomController.removeSubscriptions(sockets[
id]);
}
}
}
}

We know that rooms[room] is defined as it is used on the first line to get
sockets. From the log.info you will see that roomController is undefined
but you will also see that controller is defined. The code we are using is
a few weeks so maybe this was fixed recently somewhere else in the code.
We are pretty stable with at the sha we have and would like to limit any
changes at this point so if someone could let us know if this is an
acceptable workaround that would be great?

Also, please note that below the code above the in erizoController.js there
is

streams = rooms[room].streams;


for (j in streams) {
    if (streams[j].hasAudio() || streams[j].hasVideo() || streams[j].

hasScreen()) {
if (!room.p2p) {
rooms[room].roomController.removePublisher(j);
}
}
}

Apparently there are no streams in the room as this code never gets
executed in our environment. So this will need to be reviewed as well
since is calling the same roomController.

Thanks,

roboOn Tuesday, October 14, 2014 6:13:49 AM UTC-7, SANDIP NALAWADE wrote:

Hi all!!!

I am running the licode video conferencing application. I can delete 

empty room when no one is connected to the room. But I want to delete rooms
if some user is connected their. It is possible to delete the room only
form room creator. But every time some one connected to the room. So how I
can delete that room. I tried it just like delete empty room. In this case
room get delete but if we refresh page. Page doesn’t respond for long time.
After refresh it gives following error.

Result: Room deleted
2014-10-14 18:09:05.856 - INFO: ErizoController - Deleting room
543d18aaead004c91648ce4b
2014-10-14 18:09:05.875 - ERROR: RPC - Error processing call:
[TypeError: Cannot call method ‘removeSubscriptions’ of undefined]
TypeError: Cannot call method ‘removeSubscriptions’ of undefined
at Object.exports.deleteRoom
(/licode/erizo_controller/erizoController/erizoController.js:791:40)
at Object.exports.deleteRoom
(/licode/erizo_controller/erizoController/rpc/rpcPublic.js:19:21)
at /licode/erizo_controller/common/rpc.js:96:47
at Message. (/licode/node_modules/amqp/lib/queue.js:190:28)
at Message.emit (events.js:92:17)
at Queue._onContent (/licode/node_modules/amqp/lib/queue.js:529:25)
at AMQPParser.self.parser.onContent
(/home/aloha/Projects/licode/node_modules/amqp/lib/connection.js:139:32)
at frameEnd (/licode/node_modules/amqp/lib/parser.js:100:18)
at frame (/licode/node_modules/amqp/lib/parser.js:78:14)
at header (/licode/node_modules/amqp/lib/parser.js:64:14)
at frameEnd (/licode/node_modules/amqp/lib/parser.js:111:16)

/licode/nuve/nuveAPI/rpc/rpc.js:86
map[corrID].fn(‘timeout’);
^
TypeError: Property ‘fn’ of object # is not a function
at callbackError (/licode/nuve/nuveAPI/rpc/rpc.js:86:17)
at timer._onTimeout (timers.js:219:16)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

If I want to proceed to delete room How should I proceed?.

Thanks,
Sandip Nalawade