Random Caller ID (CLI) on Voice calls
Last updated
Last updated
This article provides details and instructions for placing calls with CLIs (calling line identifications, aka Caller ID) selected randomly among a pre-defined set of numbers.
In this case, Voice relies on a “Number Pool”. MessageBird’s Number Pool is a pre-defined set of numbers with a Pool Service (what defines the way a number is selected in a pool) and additional configuration.
Currently, MessageBird supports Random CLI service, which will pick a random number within the pool, with a configuration option to pick only numbers belonging to the same destination country. To place a call with a Random CLI, our Voice product will get the CLI from the Number service.
Let’s see how to set up a number pool and how to use it with both Voice API and SIP trunking calls.
First, you need to create a new Random CLI Number Pool. You can create it using the dashboard interface or the Numbers API.
For example:
Then, you can add a couple of numbers. Both Verified and Owned (purchased at MessageBird) numbers are allowed.
You are now ready to place a call with a random CLI using Voice API. In order to do it, you will use the attribute `sourcePool` instead of `source` in the call object.
WARNING: Do not set both `sourcePool` and `source` fields, otherwise the API will return a 400 error that, “Both source and sourcePool cannot be set at the same time”.
First, you must enable number pooling by activating the option “Randomise caller ID” in the SIP trunk settings. By default, this is not enabled. You can either create a new trunk or just edit an existing one.
Then, click Save.
WARNING: once Randomise caller ID is enabled, you must specify a number pool to use otherwise the call won’t be placed.
Now, you can place calls using that SIP trunk. You can define which pool to use passing its name with one of the following methods:
Using the custom SIP header `X-MB-NPS` in the INVITE
Using the Display portion of the From header in the INVITE. For example, `From: “my_pool” <sip:12345@mytrunk.sip.messagebird.com>`
Setting a default number pool in the SIP trunk page.
MessageBird will try all the above methods from higher to lower priority to find what pool to use and pick a random number from it.
You can place calls selecting a random number among only the ones from the same country in a pool.
In order to do this, enable the `byCountry` option in the pool’s configuration and place a call using the methods described above. NOTE: be sure to have numbers belonging to the countries you want to dial, otherwise, the call will fail.
Property
Value
Name
my_pool
Service
randomcli
ByCountry
false