jivo_api.chatMode();
function jivo_onCallEnd(res) {
  if (res.result == 'ok') {
  // call finished successfully
  }
  if (res.result == 'fail') {
  // call finished with errors or can not started
  console.log(res.reason); // reason for the unsuccessfull call
  }
}