Using the SharingServices Package, the Agent can logout active Avaya Co-Browsing session.
To logout Avaya Co-Browsing session, you must complete the following activities.
You must register onSuccess and onFailure callbacks. The onSuccess callback is called to report that the Agent is logged out successfully. Customer gets notification that Agent is logged out. The onFailure callback is called to report a failure in logout session
var onSuccess = function (data) {
// Called to report agent is
// logged out successfully
// Add code here to notify agent
};
var onFailure = function (error) {
// Called to report failure in ,logout session
// Add code here to notify agent
};
To logout a Avaya Co-Browsing session, you can provide logout reason (Optional).
_cbinstance.logoutSession().then(onSuccess, onFailure);
$(window).bind("beforeunload", function() {
var reason = "Customer closed window.";
var onSuccess = function ()
{ console.log("success"); }
;
var onFailure = function (error)
{ console.log("fail"); }
;
_cbinstance.logoutSession(reason).then(onSuccess.bind(this), onFailure);
})