i360-modules-button-call

1.0.1 • Public • Published

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'

Readme

Keywords

none

Package Sidebar

Install

npm i i360-modules-button-call

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.28 kB

Total Files

5

Last publish

Collaborators

  • pbojeda