Table of Contents

onMaintenanceMessage()

wrtc.onMaintenanceMessage() is an event function called when a maintenance message is received from IXNX server.

Maintenance messages can be broadcasted to all clients connected to an IXNX server.

You should use this event to display the message to the user.

Occurs

Maintenance message received from IXNX server.

Arguments

wrtc.onMaintenanceMessage(arg)

Return value

Ignored.

Maintenance actions

By adding parse of received messages you can make your clients perform tasks upon receiving special maintenance messages. Below code makes all clients refresh themselves upon receiving maintenance message REFRESH or RELOAD. This way you can easily update all connected clients to the latest version.

function waitNreload() {          // wait until no calls in progress then reload webpage
  if (wrtc.getCall())
	setTimeout("waitNreload()", 2000);
  else
	location.reload(true);
}

wrtc.onMaintenanceMessage = function(arg) {
  if ((arg.msg == "REFRESH") || (arg.msg == "RELOAD"))
	waitNreload();
  else if (arg.start)
	window.alert("Maintenance mode: " + arg.msg);
  else
	window.alert("End of maintenance mode: " + arg.msg);
}