Daniellesmith31
Daniellesmith31

Reputation: 49

How to specify dial code in code using Twilio

I am currently developing a phone system using Twilio and want to set the dial code for GB automatically in my code without the user having to specify +44 and removing the 0 from the number when dialing out using Twilio

Upvotes: 0

Views: 52

Answers (1)

michaelbinks
michaelbinks

Reputation: 370

In its simplest form it will be something like the below. May need to expand on this if you are likely to make international calls.

//presuming your twilio callback is providing a To number in the request
if(To.startsWith("0"))
{
    To = To.Replace("0", "+44")
}

Upvotes: 1

Related Questions