Matching touch tones to words offers an alternate way to retrieve data from a caller. For example, suppose that the requirement is to have the caller select a city. Active Call Center can prompt the caller to touch tone the first 5 letters of the city and then those tones could be matched to a list of potential cities.
There are two ways to implement this feature:
The COM object is named "ACCTools.TouchToneConverter", and it performs the task of converting touch tones into possible character combinations. The object has two methods:
NumberOfPossibilities("23") is equal to 9: "21" could represent "AD", "AE", "AF", "BD", "BE", "BF", "CD", "CE", or "CF" (since "2" could be "ABC" and "3" could be "DEF").
NumberOfPossibilities("234") is equal to 27, since there are 27 possible character combinations that could be represented by the numbers "234".
The NumberOfPossibilities function is used to obtain a count of the number of possibilities, then each possibility can be enumerated and checked for a possible match.
ConvertTone("23",1) = "AD"
ConvertTone("23",2) = "BD"
etc.
The COM object is used by first obtaining the number of possible character combinations a touch tone sequence may represent and then cycling through each one to check for a match. The sample code below should illustrate this point:
Dim Tools, n, Counter
' Create the TouchToneConverter object
Set Tools = CreateObject("ACCTools.TouchToneConverter")
' Just assume touch tones to compare are "234"
n = Tools.NumberOfPossibilities("234")
' Now cycle through all possibilities.
For Counter = 1 to n
' In a real application the MsgBox function
' would be replaced by a lookup function that
' attempt to match the converted tones to a
' list of names.
MsgBox Tools.ConvertTone("234", Counter)
Next
The ACCTools.TouchToneConverter object uses the following translation table to translate touch tones:
Tone Possible Characters
2 ABC
3 DEF
4 GHI
5 JKL
6 MNO
7 PQRS
8 TUV
9 WXYZ
0 Z