This guide explains how to configure Local Presence dialling within your Outbound Routing Policy.
What It Does:
This Lua script dynamically alters the Outbound Caller ID (also known as the Presentation Number) based on the country code of the number your Agent is dialling.
When an agent places an outbound call, the script reads the destination number and resolves it into a 3-letter ISO country code. It then checks a predefined table of your regional phone numbers. If it finds a match for that country, it changes the CLI presented to the called party to that specific local number. If the country is not listed in your table, it gracefully falls back to a default global number so the call can still proceed.
Use Case:
Local Presence Dialling is primarily used by outbound sales and support teams to increase call answer rates. People are significantly more likely to answer a phone call if the incoming caller ID displays a familiar, local country code rather than an unknown international number.
Script:
DEFINE YOUR REGIONAL CLIs:
Make sure you update each entry on the Number table to reflect your own organizations phone numbers - *The numbers listed below are simply test numbers*
Add any additional countries and the related CLIs to the table below.The Country must be the 3-character ISO code [5].
enable_debug('email')
local numbersTable = {
['GBR'] = '442038123456',
['USA'] = '18446123456',
['ITA'] = '39800123456',
['MEX'] = '528002123456',
['CAN'] = '18885123456',
}
local dialledNumber = session.get('CalledNumber') or ""
if string.sub(dialledNumber, 1, 1) == "0" then
session.set("country", session.get('CalledCountryShort'))
else
session.set("country", resolve_country(session.get('E164CalledNumber')))
end
local countryCode = session.get("country")
print("Resolved Country Code: " .. tostring(countryCode))
if numbersTable[countryCode] then
local presentationNumber = '+' .. numbersTable[countryCode]
session.modify('PRESENTATION_NUMBER', presentationNumber)
print("Set Presentation Number to: " .. presentationNumber)
return true
else
-- FAILURE ROUTE: Apply the default number and return true
print("No matching CLI found for country code: " .. tostring(countryCode) .. ". Using default.")
session.modify('PRESENTATION_NUMBER', defaultNumber)
return true
endHow to configure in Policy:
Navigate to the default “Outbound Calls Policy”
Before the “Connect a call” component you will want to introduce a script app as shown below
Add in the above script (Once your Organization numbers have been added to the table)
Connect the Script App to the Connect a call component
.png?sv=2022-11-02&spr=https&st=2026-04-16T00%3A14%3A40Z&se=2026-04-16T00%3A26%3A40Z&sr=c&sp=r&sig=k8Sj6uhixd2zwQcVc%2BEC2VwnvdBECr2QxaZdtLvWnZA%3D)