Professional > Interview scripting > Writing interview scripts > Interactive Voice Response interviews > Creating an IVR script to receive UNICOM Intelligence Interviewer - Server data > DTMF string
 
DTMF string
The DTMF string is a string of characters that UNICOM Intelligence Interviewer - Server passes to the IVR system. It contains an instruction to IVR to start the interview, and it may also contain UNICOM Intelligence Interviewer - Server data that you want to use in the IVR interview or store in the IVR database. Suppose your UNICOM Intelligence Interviewer - Server metadata script is as follows:
' Questions to pass to IVR
UsedEver "Have you ever used breath fresheners on a regular basis?"
categorical [1..1] {Yes, No};
UseNow "And are you using a breath freshener regularly now?"
categorical [1..1] {Yes, No};
WeeklyUsage "How many times a week do/did you use a breath freshener?"
long [1..99];
Type "Which type of breath freshener do you mainly use or have you mainly
used in the past" categorical [1..1]
{
Spray, Mouthwash, Tablets, Gum, Other
};
IVROK "The rest of the interview will be conducted as an automated
survey. A machine will ask the questions, and you can answer by typing
numbers on your telephone keypad.<br/>
Are you willing to be interviewed in this way?"
categorical [1..1]
{Yes, No};
and the DTMF string is defined as:
DTMF = ",," + IVRID + "#" + _
  CText(IOM.UsedEver.DefinedCategories().Find(UsedEver)) + _
  CText(IOM.UseNow.DefinedCategories().Find(UseNow)) + _
  CText(IOM.WeeklyUsage) + "#" + _
  CText(IOM.Type.DefinedCategories().Find(Type)) + "#"
If respondent number 681 has used breath freshener regularly in the past (0) but does not currently use it (1), used to use it 12 times a week, mainly in tablet form, the DTMF string that UNICOM Intelligence Interviewer - Server passes to the IVR system is:
,,681#0112#3#
The two commas are the two-second pause and the # at the end of the string tells IVR to proceed to the first non-blank question. The IVR system speaks the question text for this question and waits for the respondent to answer using the telephone keypad. To test this script you need to write an IVR questionnaire that contains at least four blank questions to hold the data you are passing from the UNICOM Intelligence Interviewer - Server script, plus at least one non-blank question so that the IVR interview can take place.
Look again at how the responses are added to the DTMF string. Notice the following:
Since the string is a text, all the responses in it need to be read as text. The CText function converts non-text values into text values.
With categorical responses that can be represented by a single digit, we need to extract a suitable value from the interview object model. The DefinedCategories function returns a list of category numbers, while the Find function returns the position in that list of the value representing the respondent’s answer. Note that position numbering starts at 0 not 1.
See also
IVR basics
Practical suggestions for a test script
Creating an IVR script to receive UNICOM Intelligence Interviewer - Server data