1.0.1 • Published 3 years ago

i360-modules-button-call v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

i360-module-button-call

Usefull module to make calls using Twilio framework.

CREATED BY PABLO OJEDA Last update: 07/09/21

Steps to use:

  • 1.- import { createDevice, callCustomer, hangUp, mute } from i360-modules-button-call'
  • 2.- Get twilio access token from server. You will need a bearer token before
  • 3.- Call method createDevice with twilio token as a parameter
  • 4.- Call method callCustomer with phoneNumber callCustomer(+34620825001)
  • 5.- If you needed, you can call mute method
  • 6.- Call method hangUp to finish the call

Recommendations:

Add event listeners for all the events:

    document.addEventListener("twilio-event-ready", function(e) {
        console.log(e.detail); // Prints "Example of an event"
    });

List of events:

Device events

  • twilio-device-event-registered'
  • twilio-device-event-registering'
  • twilio-device-event-unregistered'
  • twilio-device-event-destroyed'
  • twilio-device-event-incoming'
  • twilio-device-event-error'

Call events

  • twilio-call-event-accept'
  • twilio-call-event-cancel'
  • twilio-call-event-disconnected'
  • twilio-call-event-error'
  • twilio-call-event-mute'
  • twilio-call-event-reject'