1.3.0 • Published 12 months ago

telecmi-call-feed v1.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

TeleCMI live call feed

TeleCMI live call feed SDK for Browser and NodeJS

Documents

Install

npm

npm install telecmi-call-feed

yarn

yarn add telecmi-call-feed

Add to your page

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

Get Started

Create Telecmi Object

var telecmi = new TeleCMI(); 

Method

Register Using our Admin Login API you can get access token. Using feed access token you can connect with TeleCMI platform.

telecmi.start('access token')

Call Barge Barge ongoing call using call uuid and supervisor ID

  telecmi.barge('uuid','Supervisor ID');

Subscribe

Live Call Subscribe live call's events

  telecmi.subscribeCalls();

Example

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

Ongoing Call Subscribe ongoing call's events

  telecmi.monitorCalls();

Example

  telecmi.onConnect=function(data){
  if(data.status=='connected'){
   //subscribe 
       elecmi.monitorCalls();
     }else if(data.status=='error')
     {
        // Invalid token please check your token
     }
 };

Agent Subscribe Agents status and list

  telecmi.subscribeAgents();

Example

  telecmi.onConnect=function(data){
  if(data.status=='connected'){
   // subscribe 
       telecmi.subscribeAgents();
     }else if(data.status=='error')
     {
        // Invalid token please check your token
     }
 };

Callback

Connect

This callback function update the status of connection.

syntax

  telecmi.onConnect=function(data){
  //data - JSON object
  };

Disconnected

This callback function invoked when socket connection disconnected.

syntax

  telecmi.onDisconnect=function(){
  //data - JSON object
  };

Calls

This callback function invoked when call started.

syntax

  telecmi.onCalls=function(data){
  //data - JSON object
  };

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
   console.log(data.uuid) //Call UUID for call barge
 };

List of Response

actionagentgroupfromidinetnoleguidnameuuidstate
It's define channel property "ch-c" = channel create ."ch-s" = channel state change like early,answer. "ch-d" = channel deletedAgent idCall receiving team idcustomer numberrecord isYour app idcustomer channel uuidcustomer name if you savedagent call uuidcall status is it answered or ringing 'early' = Call ringing to agent 'answer' = Call answered by agent 'bridged' = Call established between customer and agent 'hangup' = Call disconnected

Agents

This callback function invoked when Users/Agents update their status .

syntax

  telecmi.onAgents=function(data){
  //data - JSON object
  };

Example

  telecmi.onAgents=function(data){
  
 };
1.3.0

12 months ago

1.2.0

2 years ago