Make Local Calls with Nexmo Virtual Numbers and Call Forwarding
Published on May 10, 2021

If you have friends and family in more than one location, the ones that you are not spending Christmas with will probably complain about the costs of calling you at Christmas. At least, I'm pretty sure that's not just me! This post is an opportunity for me to share my favourite Nexmo trick for giving your dad (or whomever) a local rate number to call that won't cost you a small fortune if he decides to talk for an hour.

Vonage API Account

To complete this tutorial, you will need a Vonage API account. If you don’t have one already, you can sign up today and start building with free credit. Once you have an account, you can find your API Key and API Secret at the top of the Vonage API Dashboard.

This tutorial also uses a virtual phone number. To purchase one, go to Numbers > Buy Numbers and search for one that meets your needs.

You'll also need to add some credit in order to follow this tutorial (adding credit proves you're a real person, at which point you can buy a number). You will also need the Nexmo CLI installed.

Get a Number in the "Right" Geography

My family are at home in the UK - I'm at home this Christmas too, but as a Developer Advocate I travel a lot and use this trick for people (Hi Grandpa!) who can't be expected to keep track of me all the time and know which number to call. First, I'll look at the UK numbers that are available with the number:search command and the GB code for the UK:

nexmo number:search GB --voice

The country code is in ISO 3166-1 alpha-2 format so pick whatever country you'd like. The cost of renting a number varies depending upon the country the number is from, you can always find the most up-to-date prices on our pricing page. You can also use --pattern to look for particular digit sequences.

I've seen a number I want to use, so I'll copy and paste it into the number:buy command:

nexmo number:buy 447700900000

Now I've got my number I can set it up to forward to my real number.

Forward the Nexmo Number to the Phone You Want to Answer

Next, I'll set up the number I want to forward to. This is great because Nexmo has cheap calling rates everywhere, and if I need to forward to a different number because I'm using a local sim card somewhere, I can do so.

Here's the command that forwards the number I bought to the number I want to answer calls on (note to self: don't put your actual mobile number in the blog post this time!)

nexmo link:tel 447700900000 14155550100

All set! Test that everything is working by calling the Nexmo number you bought from another phone (or by asking a friend to call it). Rerun this command any time you want to update which phone the calls ring through to - much more straightforward than notifying every one of which number to use every few days!

With a little bit of Nexmo magic, you can very easily stay in touch with your favourite humans this Christmas.

Lorna MitchellVonage Alumni

Lorna is a software engineer with an incurable blogging habit. She tries to tame words and code in equal measure.

Ready to start building?

Experience seamless connectivity, real-time messaging, and crystal-clear voice and video calls-all at your fingertips.

Subscribe to Our Developer Newsletter

Subscribe to our monthly newsletter to receive our latest updates on tutorials, releases, and events. No spam.