I am creating a twilio video room using the rest api and setting up a statusCallback:
classroomRouter.route('/room/:id')
.get(function (req, res) {
client.video.rooms
.create({
uniqueName: req.params.id,
statusCallback: 'localhost:3000/classrooms/listen'
})
.then(function (room) {
console.log('room.sid');
console.log(room.sid);
});
});
Twilio will be sending requests to the statusCallback whenever an event happens in the room right? To the best of my knowledge, refreshing the window on which the room is rendered constitutes a participantdisconnected and participantConnected event.
But the route I setup(localhost:3000/classrooms/listen) didnt recieve any requests when i refreshed the window. Why is this?
I have a few other queries too: Q1: Can two rooms have the same uniqueName?
(The twilio docs say that you can query a list of rooms using their uniquename. If the names are unique, how can it be a 'list' of rooms?)
Q2: If the names are indeed unique, what happens if a room already exists with uniquename I provide? Will it return the already existing room?
Q3: How can I issue this command only if the room doesnt exist?