Any thoughts on how to convert dialed words (through sip client) to numbers.
For example, dialing 1-800-gofedex or 1-800pickups would convert to the letters to their respective digits.
Thanks!
Any thoughts on how to convert dialed words (through sip client) to numbers.
For example, dialing 1-800-gofedex or 1-800pickups would convert to the letters to their respective digits.
Thanks!
The problem youâre going to find:
A guy a few years bought the number â1-800-FLACodeâ (he was starting a Florida based software company) without realizing that his number was the same as â1-800-FLA-COEDâ (a phone sex service).
While most digit strings translate to word, but you have to take into account the times when it doesnât.
I understand snafuâs can happen. Mainly Iâm looking for a simple way to just have the system convert the words into numbers, strip off anything in excess of 10 digits.
Words to digits is easy - itâs going the other way thatâs hard.
^^In terms a 5th grader can understand, elaborate on easy
You type 323
for DAD
but 323
can also be
DAD DAE DAF DBD DBE DBF DCD DCE DCF EAD EAE EAF EBD EBE EBF ECD ECE ECF FAD FAE FAF FBD FBE FBF FCD FCE FCF
pseudocoble
take the string,
remove anything but 0-9a-zA-Z
step through the string replacing
[abc2] with 2
[def3] with 3
.
.
.
remove any 1 from the beginning
select the first 10 characters
asterisk or bash or php can do that with some string manipulation and a case statement ,
a minimalist bashism
echo ${STRING}|tr [:upper:] [:lower:]|tr -cd 0-9a-x|tr abcdefghijklmnopqrstuvwxyz 1112223334445556667778889999|sed -r âs/1?([0-9]{10})/\1/â