Browser SDK
TeleCMI Agent Live Feed
Our browser based javascript agent live feed SDK, send ongoing calls and agent activity status directly to your browser using websocket.
You can install our agent live feed SDK directly from npm or yarn.
Install
npm
npm install telecmi-agent-livefeed
yarn
yarn add telecmi-agent-livefeed
Add a agent live feed library to your webpage
<script src="dist/telecmi-agent-livefeed.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
Status | Description |
---|---|
connected | Agent live call feed connection established |
error | Authentication failed |
Set Agent status
Online
Make agent status online
telecmi.setOnline();
Break
Make agent status break/Away
telecmi.setBreak();
Dialer
Make agent status dialer
telecmi.setDialer();
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
Key | Description |
---|---|
action | It defines channel property
|
agent | A unique Id of the user(agent) |
group | A unique Id of the team |
from | The number the call came from |
inetno | A unique id of your app |
leguuid | customer channel uuid |
name | customer name if you saved |
uuid | A unique identifier for this call |
state | call status is answered or ringing
|