Rate this page:

Click-to-call web widget

Click-to-call widget is a button for your website that allows your customers to make a call over VoIP without leaving the website.

Key features:

  • Call a Voximplant user / SIP address / phone number

  • You can dial an extention number after the call establishes

  • You can mute/unmute your microphone during the call

  • You can choose the microphone and test it by recording your voice and playing it back

  • You can see the connection status and quality

Widget connection
Microphone settings

How to use

The setup consists of two parts: VoxEngine cloud setup and the widget's source code setup.

VoxEngine setup

  1. Create an application
  2. Create a user to log into the widget
  3. Create a scenario for the microphone check. Copy this code into your scenario and save it:
Microphone check scenario

Microphone check scenario

  1. Create another scenario for the call itself. You can call a phone number, a Voximplant user, or a SIP address. Depending on your destination, copy the suitable code example into your scenario.

Use this code if you are going to call a user:

Destination — a Voximplant user

Destination — a Voximplant user

Use this code if you are going to call a phone number:

Destination — a phone number

Destination — a phone number

Use this code if you are going to call a SIP address:

Destination — a SIP address

Destination — a SIP address

CallerID notice

If you want to call a phone number, you need a verified Caller ID. You can buy a phone number from Voximplant or use any phone number that is verified via an automated call from Voximplant and confirmation code.

  1. Make a routing rule for the microphone testing scenario. Set the mask pattern to testmic and place the rule to the top.
  2. Make another routing rule for the call scenario. Place the rule below the microphone testing scenario.

The VoxEngine setup is done, now start with the widget itself.

Application setup

  1. Download the widget repository
  2. Run yarn install or npm install in the widget directory
  3. Rename the .env.example file to .env
  4. In the .env file:
  • Fill your user credentials into the VUE_APP_USER and VUE_APP_PASSWORD properties

  • Add the number to call to the VUE_APP_NUMBER property

  • Fill the testmic string to the VUE_APP_TEST_NUMBER property

  1. Run yarn serve or npm run serve to run the development build
  2. Open the http://localhost:8080/ URL to test the application
  3. Once the application works correctly, you can assemble the application
  4. If you do not plan to upload the application to the webserver root folder, set up the publicPath property in the vue.config.js file. See the instruction
  5. To make a production build, run yarn build or npm run build
  6. The dist directory will contain the production build ready to upload to the server.

Folder descriptions

  • public — Project's static materials, such as favicon and the index.html template, where you can add any additional code, such as action counters

  • src — Zingaya project code

  • src/assets — Assets: images and sounds

  • src/components — Application source code

  • src/router — Application routing files

  • src/views — Application pages: Home.vue is the default page, Button.vue is the button page to be placed on the website

Miscellaneous

  • The get parameters starting with x- are sent as headers to the VoxEngine scenario

  • You can see the widget example in new window at: http://localhost:8080/button