Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

API CTI  – Shuttle 2.4.0 onwards

...

Important: after the download, remember to rename the template.js file!

xcally API - CTI CustomImage Removed


 Image Added


Event Ringing

Panel
bgColor#E6E6FA
languagejs
event.ringing = function(data) {
 console.log('ringing');
 wakeup('http://www.google.it', data.peer, 'new_tab');
 };

...

Code Block
languagejs
titleData sample
{ event: 'up',
queue: 'CC-SIPP',
agentname: 'John Doe',
agentnum: '1007',
peer: 'SIP/john.doe',
direction: 'inbound',
uniqueid: '1437069264.914',
context: 'from-sip',
extension: '9999',
trunk: 'SIP/demo.trunk-00000392',
callernum: '998',
holdtime: '2',
ringtime: '0',
up: true }

...


Event Hang Up

Panel
bgColor#E6E6FA
event.hangup = function(data) {
  console.log('hangup');
  wakeup('http://www.google.it', data.peer, 'new_tab');
};

 


Event Outbound

Panel
bgColor#E6E6FA
event.outbound = function(data) {
  console.log('outbound');
  wakeup('http://www.zendesk.it', data.peer, 'new_window');
};

...


Open CTI to an Agent

...


Panel
bgColor#E6E6FA

var wakeup = function(url, peer, mode) {

  socket.emit('AgentCTI', {
    url: url,
    peer: peer,
    mode: mode
  });
};

...

mode: how the CTI form will be opened. Values: new_tab, new_window, new_frame

 


Push a notification to the Agent

...


Panel
bgColor#E6E6FA
var notification = function(peer, type, title, body) {
  socket.emit('AgentCTINotification', {
    peer: peer,
    type: type,
    title: title,
    body: body
  });
};

...

body: the message of the toast that will be displayed to the Agent 


Push the event into the Integration Realtime section of the Administrator

These data will populate the following section of xCALLY Realtime:

Image RemovedImage Added

 


Panel
bgColor#E6E6FA
var pushevent = function(appname, data, reference, url) {
  data.time = new Date();
  socket.emit('RealtimeCTI', {
    type: appname,
    channel: data,
    reference: reference,
    url: url
  });
};

...


where
appname: name of the Integration
data: object containing information about the call
reference:  CTI creation id
url: the address of the CTI


Example

 

For each event you can define which action you want the integration to perform.

 

In this example we associate to the UP event the CTI opening to an Agent, if the call belongs to the Sales Queue.

 

We also pass to the Agent a custom variable called ordernumber that we have created into the Shuttle -> Settings -> Integrations -> Custom variables section.

ordernumberImage RemovedImage Added

 


Panel
bgColor#E6E6FA

event.up = function(data) {
    var order = customvariables[data.uniqueid]['ordernumber'];
    if(data.queue == ‘Sales’){
         wakeup('http://webservice1/sales?ordernumber='+order, data.peer, 'new_frame');}
    }
};

...


Add a custom integration service

...