1.0.0 • Published 8 years ago

chub-js-sdk v1.0.0

Weekly downloads
-
License
TeleCMI SDK Licen...
Repository
github
Last release
8 years ago

ContactHUB JavaScript SDK

ContactHUB ! Indian First True Cloud Telephony Platform Enable Web IVR in your Website using our Javascript SDK, Were your customer directly talk from Browser,Now your custamer can make call to your sales,technical and support team from browser, You agent answer the call in Mobile/Landline from anywhere in the world .

Documents

Install

Bower

bower install chub-js-sdk

npm

npm install chub-js-sdk

CDN

<script src="https://app.telecmi.com/1.0/telecmi-sdk.min.js"></script>

Get Started

Create Telecmi Object

var chub = new Telecmi(); 

Method

Register

chub.startCHUB(agentusername,agentpassword)
//For agent use your agent username and password
//For web ivr just use username: telecmi ,password: telecmi

Calls

Make Call

  chub.call('destination number');

Accept Call

  chub.answer();

Hangup/Reject call

  chub.hangup();

Mute/Unmute MIC

  chub.mic();
  //When you call this method first time it will mute your mic ,if you call second time it will unmute your mic

Send DTMF

  chub.dtmf('1');

Logout

  telecmi.logout();

CallBack

Status .

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

Example

  telecmi.onStatus=function(data){
  if(data.event=='register'&& data.status==true){
   //register successfully do your stuff here
     }else if(data.event=='incoming'&& data.status==true)
     {
         //You have new incoming call just accept it
         telecmi.accept()
     }
 };

Events

List of event and status

EventStatusDescription
wsopenThis event fired when websocket connection open
wscloseThis event fired when websocket connection close
registertrueThis event fired when you successfully register
registerfalseThis event fired when your registration fails
tryingtrueThis event fired when you make call
ringingtrueThis event fired when you get Incomming call
mediatrueThis event fired when your destination ringing (Early Media)
connectedtrueThis event fired when call successfully connected
answertrueThis event fired when call chage into answer state
hanguptrueThis event fired when call disconnected
1.0.0

8 years ago