testnumber.org

Test a Phone Number's Interoperability, Caller Id, Reputation, and STIR/SHAKEN Attestation Level


How to create a Phone Service that will detect and repeat the Caller-Id


Login into Twilio’s Console and buy a Phone Number


Buy a Twilio Number

Buy a Twilio Number


Verify the purchased Number

Purchased Twilio Number


Create a Twilio Function


Find Twilio Functions and Assets in the Console

Find Twilio Functions and Assets in the Console


Create a new Service called incoming-number-detector

Create a New Service


Create a new Function in the incoming-number-detector Service called /main

Create a New Function called /main


Paste the following javascript in the Editor for the /main Function.

  exports.handler = function(context, event, callback) {  
    let twiml = new Twilio.twiml.VoiceResponse();        
    let fromNumber = event["Caller"]; // The From number is contained in this key 
    let speechFriendlyFromNumber = fromNumber.slice(1).split("").join(" "); // Format it better for speech

    // Add a few cosmetic pauses
    twiml.pause({
      length: 2
    });

    twiml.say({ voice: "alice" }, "Welcome to test number dot org.");

    twiml.pause({
      length: 1
    });

    // Tell the caller what we have detected as the From Number
    twiml.say({ voice: "alice" }, "You are calling from " + speechFriendlyFromNumber + ".");

    twiml.pause({
      length: 1
    });

    // Bid them farewell
    twiml.say({ voice: "alice" }, "Goodbye.");

    return callback(null, twiml);
  };    


Configure the Phone Number


Enable the Function for incoming calls to the new Number

Enable the Function for incoming calls to the new Number


Verify the Function is the default for the new Number

Verify the function is the default for the Number


Call your new Phone Number