Overview
Phone number masking hides the phone numbers of parties in a call from each other. Many businesses find it advantageous to anonymize communication between two parties — for example, between a customer and a delivery agent on a food delivery service platform or a driver and a rider using a ride-hailing application. Businesses can implement phone number masking by sending calls through an intermediate phone number that acts as a proxy between the two parties. A Plivo number can serve as the intermediate number to connect the two parties while keeping their contact information private.How it works

- Create a customer-to-agent phone number mapping in your application’s back end.
- Create the number masking application using Plivo.
- Assign the number masking application to a Plivo number.
Prerequisites
To get started, you need a Plivo account — sign up with your work email address if you don’t have one already. You must have a voice-enabled Plivo phone number to receive incoming calls; you can rent numbers from the Numbers page of the Plivo console, or by using the Numbers API. If this is your first time using Plivo APIs, follow our instructions to set up a Node.js development environment and a web server and safely expose that server to the internet.Create a 1:1 map with actual numbers
Create customer-to-agent phone number mapping for the application. Whenever a customer places an order, their phone number should be stored in a database for your application to access. A delivery agent will be assigned for the order, and the agent’s number will also be stored in your database, and will be mapped to the customer’s number:Create an Express application for number masking
Create a file callednumber_masking.js
and paste into it this code.14156667777
— then Plivo will send the XML response to process the incoming call as below, and you can check the XML document in your browser.
14156667778
— then Plivo will send the XML response to process the incoming call as below, and you can check the XML document in your browser.
Create a Plivo application
Associate the Express application you created with Plivo by creating a Plivo application. Visit Voice > Applications in the Plivo console and click on Add New Application, or use Plivo’s Application API.Give your application a name — we called oursNumber Masking
. Enter the server URL you want to use (for example, https://<ngrok_identifier>.ngrok.io/handleincoming/) in the Answer URL
field and set the method as GET
. Click Create Application to save your application.
Assign a Plivo number to your application
Navigate to the Numbers page and select the phone number you want to use for this application.From the Application Type drop-down, selectXML Application
.From the Plivo Application drop-down, select Number Masking
(the name we gave the application).Click Update Number to save.