12-08-2022 05:12 AM
Hi Team,
We have developed custom Cisco finesse agent desktop using rest API and using BOSH (XAMPP) to make connection with Finesse server. Everything is working fine but when logged in agent is in idle for couple of minutes BOSH connection gets closed with following error in logs.
closed: <stream:error xmlns:stream="http://etherx.jabber.org/streams"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error>
Please help me to understatnd why this error comes and how we can resolve this issue.
Regards,
Pravin
12-09-2022 05:22 AM
BOSH is being deprecated, so would you want to try another method?
https://developer.cisco.com/docs/finesse/#!deprecated-features
01-04-2023 11:15 AM
Hi @pravin1 ,
Could you please try the ping mechanism mentioned here: https://community.cisco.com/t5/contact-center/finesse-custom-cti-toolbar-integration-with-finesse-12-6/m-p/4667350#M13204
Regards,
Renjith
02-04-2023 10:58 PM
Hi Renjith,
We have used Non gadget sample for development. In this sample where and how we can use ping mechanism mentioned below.
conn.sendPacket(new Packet() {
public String toXML() {
return "<iq type='get'><ping xmlns='urn:xmpp:ping' /></iq>
}
});
Our .connect method code as below.
function _eventConnect() {
if (window.jabberwerx) {
var
//Construct JID with username and domain.
jid = _username + "@" + _domain,
//Create JabbwerWerx object.
_jwClient = new jabberwerx.Client("cisco");
console.log(_domain);
console.log(jid);
//Arguments to feed into the JabberWerx client on creation.
jwArgs = {
//Defines the BOSH path. Should match the path pattern in the proxy
//so that it knows where to forward the BOSH request to.
httpBindingURL: "/http-bind",
//Calls this function callback on successful BOSH connection by the
//JabberWerx library.
errorCallback: onClientError,
successCallback: function () {
//Get the server generated resource ID to be used for subscriptions.
_finesse.setResource(_jwClient.resourceName);
//var adlCti for event handling for CRM;
_adlCti = new ADLCTI();
}
};
jabberwerx._config.unsecureAllowed = true;
//Bind invoker function to any events that is received. Only invoke
//handler if XMPP message is in the specified structure.
_jwClient.event("messageReceived").bindWhen(
"event[xmlns='http://jabber.org/protocol/pubsub#event'] items item notification",
_eventHandler);
_jwClient.event("clientStatusChanged").bind(function (evt) {
if (evt.data.next == jabberwerx.Client.status_connected) {
/* var state = $(data).find("state");
var userState = $(data).find("data > user > state");
console.log("Agent state : " + userState);
var userState = $(data).find('state').text();
console.log("Agent state :---- " );
if (state.length > 0 && state[0].innerHTML == 'LOGOUT') { */
_finesse.sysInfo(false,
(data)=>{
var userState = $(data).find('state').text();
console.log("Agent state :---- " );
console.log("Agent state : " + userState);
console.log("sysInfo");
sysInformation = data;
console.log(data);
_finesse.sysInfo(true, _sysInfohandler, _sysInfohandler);
setTimeout(()=>{
console.log("----------------");
console.log(data);
sysInformation = data;
},30);
},
()=>{console.log("sysInfo")});
// ()=>{console.log("sysInfo")});getsignca
// _finesse.getState(_username, _getStateHandler, _agentGetStatehandler);
// attempt to login the agent
}
else if (evt.data.next == jabberwerx.Client.status_disconnected) {
console.log(evt.data.next);
// _finesse.signOut(_username, _extension, 'Sign out3', _signOutHandler, _signOutHandler);
}
});
//Connect to BOSH connection.
_jwClient.connect(jid, _password, jwArgs);
} else {
alert("CAXL library not found. Please download from http://developer.cisco.com/web/xmpp/resources")
}
}
Regards,
Pravin
06-15-2023 10:11 PM
You must be hitting the defect - CSCvx68660. All the latest browsers throttle requests when the application is idle to optimise resources. Finesse Desktop has solved this issue in all the versions. Please consider fixing the same in your custom client.
-Brinal
06-15-2023 10:51 PM
Hi Brinal,
I would like to request you please send me the details what is fix applied in Finesse desktop to overcome from this issue or please send the code details which we need to implement.
Regards,
Pravin
06-16-2023 05:42 AM
We have used the WebWorker thread to run in the background, which does ping-pong with the main thread responsible for doing the XMPP ping. In your case, it would be Jabberwerx, which has the default HeartBeat mechanism implemented in its implementation. You need to plug in the ping-pong from the WebWorker thread into Jabbberwerx heartbeat functionality so that even while the desktop is inactive, the WebWorker thread will ensure the client sends heartbeats w/o any throttling.
P.S: Luckily, as of today, browsers do not throttle WebWorker interval callbacks.
07-09-2023 10:12 PM
Hi,
Do you have sample code or any steps to check how web worker thread code or some guidance to how we can implement in our code.
07-24-2023 06:57 AM
Hi @pravin1 , please load the Finesse OOB desktop and look for the source (in debug console) TimedCallbackWorker.js and its invocation in openfire.js to know how we have implemented the above.
Hope that should help you out to implement the same.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide