Receiving calls

First of all, we want to know when there is an incoming call to user connected to the VoxImplant Cloud using Web SDK. There is a special event for that - VoxImplant.Events.IncomingCall , adding event listener to VoxImplant.Client instance lets us handle this event.

  1. var currentCall;
  2. VoxImplant.getInstance().addEventListener(VoxImplant.Events.IncomingCall, onIncomingCall);
  3. function onIncomingCall(event) {
  4. currentCall = event.call;
  5. currentCall.answer(); // answer the incoming call , or currentCall.decline() to decline
  6. // event.call.number() will return Caller ID
  7. }