Tropo is part of CiscoLearn More

Handling regular users vs casual users via the text channel

Posted on February 15, 2011 by jdyer

Typically you will find that your applications have two types of users, the regular user and the casual user.  The difference is based on experience, some users know how to interact with the application because they are regular users, others need some instructions.  This is especially evident in a Text channel application, such as an Instant Message or SMS, where the regular user might message with the expected value right away – for example, providing the answer to the expected question before you actually asked the question, such as a zip code:

In this scenario we can save ourselves, and the user, the trouble of sending them instructions. However, the uneducated user may send a “hi” or “hello” or any number of initial responses to your application; you will need to handle each type of user appropriately in your application.

Doing so is pretty simple, you just need to use the $currentCall object’s initalText parameter, and check the value to see if it’s what your looking for. I fashioned a quick example below that can help get you started!

fruit_list = "apples, oranges, pears"

log "@"*10 + " " + $currentCall.initialText

if fruit_list.include?($currentCall.initialText)
result = ask "What's your favorite fruit? apples, oranges, or pears?", {:choices => fruit_list}
else
ask "",{:choices=>'[ANY]'}
say "Hello and welcome to the fruit guessing game"
result = ask "What's your favorite fruit? apples, oranges, or pears?", {:choices => fruit_list}
end
say "I like #{result.value} to"
say "see ya later!"

All we do here is check the value in initialText to determine if we need to handle it as an acceptable utterance against our choice / grammar. If it’s a zipcode, you could just check to see if its numeric. You can get as complicated or as simple as you want, the choice is really entirely up to you.

I do hope this helps!

-John

One Response

  1. […] examples, tutorials and videos. As I was catching up on my Twitter feed this morning, I noticed a great post there about responding differently to different types of users and a short video about using SMS to find the time and date of tweetchats. Cool […]

Leave a Reply