Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 1.56 KB

call-events.md

File metadata and controls

60 lines (47 loc) · 1.56 KB

Call Events

Call ring event

The event is triggered when user receive a ringing call.

Receive by message event:

window.addEventListener('message', (e) => {
  const data = e.data;
  if (data.type === "MessageTransport-push") {
    if (data.payload.type === 'rc-ev-ringCall') {
      console.log(data.payload.call)
    }
    if (data.payload.type === 'rc-ev-sipRingCall') {
      console.log(data.payload) // Fired on Integrated softphone ringing, no call information
    }
  }
});

Or Receive event with RCAdapter global object: demo

New call event

The event is triggered when user start a new call or answer a call.

window.addEventListener('message', (e) => {
  const data = e.data;
  if (data.type === "MessageTransport-push") {
    if (data.payload.type === 'rc-ev-newCall') {
      console.log(data.payload.call)
    }
  }
});

Or Receive event with RCAdapter global object: demo

Call Ended event

The event is triggered when user's call is ended.

window.addEventListener('message', (e) => {
  const data = e.data;
  if (data.type === "MessageTransport-push") {
    if (data.payload.type === 'rc-ev-endCall') {
      console.log(data.payload.call);
    }
    if (data.payload.type === 'rc-ev-sipEndCall') {
      console.log(data.payload); // Fired on Integrated softphone call ended, no call information
    }
  }
});

Or Receive event with RCAdapter global object: demo