How often did you consider masking your private phone number? At first, this question may seem odd but imagine the situation when you order a taxi and, after the trip, the driver starts calling you. That’s not what you normally expect from a taxi service, right? The same is true for the driver: it wouldn’t be great if previous customers would call and distract the driver on the ride or (even worse) on vacation.
First, having a delicate distance between yourself and service workers is much better than having no distance at all. Second, it is important that both parties have the fastest way to contact each other. The Voximplant cloud can easily address these requirements with a phone number masking approach. This article will guide you through all the necessary steps to implement this feature for a simplified case of a single driver and a few customers. Note that this solution is scalable for any number of drivers and customers.
WHAT YOU NEED
To implement the solution, you will need:
- Voximplant developer account. If you don’t have one, sign up here.
- A simple backend. We will use the node.js server.
- A phone number that is purchased from Voximplant. It will be our “call center” number. We will use a “virtual” phone number for demonstration.
- A JS scenario. It will be created during this tutorial.
To get things done quickly, we suggest using the Express framework for node.js.
Then create the index.js file with the following code:
Now we have the backend server that could store and give the number of the last caller (customer). Note that we use different request methods for saving/giving.
2. PHONE NUMBER
In the VoxImplant control panel, on the top menu, select Phone numbers and then click Buy new phone number in the drop-down list.
The Available numbers page will be displayed. Click the Real number switch to change it to Test number. Then click Buy to buy a virtual phone number.
3. JS SCENARIO AND APPLICATION
As was mentioned above, our example includes only one driver, that’s why this number won’t be changed. Therefore we can save the driver’s number right in the JS scenario for demonstration purpose.
For every incoming call, we need to check the caller’s number:
- If the incoming call number doesn’t match the driver’s number, we will save this number to the backend, call the driver and establish a connection with the customer.
- If the incoming call number matches the driver’s number, we will retrieve the last customer’s number from the backend, call the customer and establish a connection with the driver
The logic is simple but effective in our context. Let’s see how to implement this logic in the Voximplant JS scenario. Pay attention to the callPSTN method call, the second argument should be the number you bought (see paragraph 2).
That’s it! To create the scenario, go to the Scenarios tab of the VoxImplant control panel and add the scenario with the code above. Let’s name it call-handling.
As you might know, there is an Applications concept in Voximplant. The Applications allow linking scenarios, phone numbers, users, and call queues. Even if there’s only one scenario, we need to create an application because the phone numbers and scenarios are linked via applications. Go to the Applications tab, click Create application, type the name of a new application (“Taxi”, for example) and then click Create.
Then add a new rule to your Taxi application; you can name it Incoming call. Use the created JS scenario in the rule and leave the default call pattern ( .* ).
For more information about rules and applications, see the corresponding articles:
4. NUMBER + APPLICATION + RULE
Finally, go to the My phone numbers tab, locate your number and select the Taxi application with the Incoming call rule in the drop-down list next to your phone number. Select the corresponding checkbox to confirm the operation.
Well done! We’ve just linked the phone number to the JS scenario! Actually, our solution is ready to serve customers.
5. HOW TO USE THE DEMO
First of all, start your backend server. As our backend initially has no customer number, it would be better if a customer made the first call.
When a customer calls the purchased number, our cloud receives the call and executes the JS scenario to handle it. According to the JS scenario:
- The customer’s number will be saved to the backend.
- The cloud will call the driver.
- When the driver answers the call, a connection to the customer will be established.
Since the backend now stores the customer number, the driver can call the customer. The driver calls the purchased number and the JS scenario causes the following to happen:
- The cloud requests the customer number from the backend.
- If the backend successfully returns the customer number, the cloud will call the customer.
- When the customer answers the call, a connection to the driver will be established.
6. NEXT STEPS
This demo is pretty simple but represents the general idea of phone number masking. There’s no magic but the power of cloud telephony. The described approach allows you to create safe, convenient, and – what’s hugely important – scalable solutions. Add the additional checks in the scenario, make the cloud play music while establishing a connection, build a sophisticated backend structure, etc. Do whatever you need to provide the best service. Make the machine suffer for the sake of satisfied customers!
- Jan 10, 2018 01:19
- Making Video Calls in Safari
- Dec 14, 2017 12:45
- Phone Number Masking
- Oct 16, 2017 12:59
- Sep 21, 2017 12:03
- Safari 11 support
- Aug 17, 2017 11:59
- Messaging update
- Aug 14, 2017 03:22
- Hot Summer Speech-to-Text Updates
- Aug 02, 2017 12:47
- Screen Sharing in VoxImplant
- May 02, 2017 12:08
- H.264 video call recording is now available (in mp4 format)
- Apr 17, 2017 10:58
- Voximplant mobile SDK for Unity in now available
- Feb 13, 2017 10:22
- Authorization using tokens instead of passwords
- January 2018
- December 2017
- October 2017
- September 2017
- August 2017
- May 2017
- April 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- July 2016
- June 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- September 2015
- August 2015
- July 2015
- May 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- July 2014
- June 2014
- May 2014
- April 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013