Browser SDK

TeleCMI Agent Call Feed

Our browser based javascript agent call feed SDK, send ongoing call notification status directly to your browser using websocket.

You can install our agent call feed SDK directly from npm or yarn.

Install

npm

npm install telecmi-live-agent

yarn

yarn add telecmi-live-agent

Add a agent call feed library to your webpage

<script src="dist/agent-call-feed.min.js"></script>

Get Started

Initialize Telecmi Object

var telecmi = new TeleCMI();

Register

Register using our Agent Login API. Once you sucessfully registered with our platform, our platform will create websocket connection between your browser and our TeleCMI platform.

telecmi.start('token')

Connection status Callback

onConnect This callback will trigger when agent live call feed connection will try to establish with our TeleCMI platform.

Connect

telecmi.onConnect=function(data){
//Data is JSON it contain event and status
};

Samples

telecmi.onConnect=function(data){
if(data.status=='connected'){
//Live call feed ready start subscribe
telecmi.subscribeCalls();
}else if(data.status=='error')
{
// Invalid token please check your token
}
};

List of response

StatusDescription
connectedAgent live call feed connection established
errorAuthentication failed

Subscribe

Call Events

Subscribe all incoming and outgoing calls events.

telecmi.subscribeCalls();

receive incoming and outgoing callbacks

This callback will fire when you receive or make the call.

telecmi.onCalls=function(data){
//Data is JSON it contain customer number,group id,time and call uuid
};

Example

telecmi.onCalls=function(data){
console.log(data.from) //customer number
console.log(data.agent) //Agent Id
console.log(data.time) //Incomming call time
console.log(data.status) // incomming call status is it answered or still ringing
};

Values

KeyDescription
actionIt defines channel property
  • "ch-c" = call started
  • "ch-s" = call status changed like early,answer
  • "ch-d" = call disconnected
agentA unique Id of the user(agent)
groupA unique Id of the team
fromThe number the call came from
inetnoA unique id of your app
leguuidcustomer channel uuid
namecustomer name if you saved
uuidA unique identifier for this call
statecall status is answered or ringing
  • 'early' = Call ringing to agent
  • 'answer' = Call answered by agent
  • 'bridged' = Call established between customer and agent
  • 'hangup' = Call disconnected