Amazon Connect with Lex contact flow timeout - amazon-lex

I have a contact flow that is using a pre-recorded voice prompt with a lex bot for voice rec. This is the main menu verbiage:
“Thank you for calling. If you would like to use your keypad to select the menu options, say “keypad”, otherwise please listen to the following menu options. For billing questions, say “billing”. To report a missed pickup, say “missed pickup”. If you are a current customer with recycling or other account questions, say “other”. If you are not a current customer, and have questions, say “sales”. To hear the menu again, say “repeat menu”. For all other questions, please remain on the line.”
I have set the error handling in the Lex bot to speak "Sorry, I'm having a hard time understanding you. Let's try using the keypad instead to make sure we route your call properly."
This is working when an utterance is not matched or an invalid option is spoken or pressed. However, I cannot figure out if it's possible to allow the lex bot to timeout like in a normal DTMF contact flow and send the caller to the next step in the menu without playing the error handling in from the Lex bot.
Is this possible?

That's the thing, Lex is not meant to be used this way. It MUST have an input to process, and if it reaches Lex's timeout, then it will always return an error and deliver the error handling response.
So you will have to get fancy in the Connect Flow to catch the Lex error message, and turn it into your own handling of it. But it will be hard to know whether Lex is erroring because it didn't understand, or because the user chose not to respond.
Therefore, I would personally avoid building the bot in a way that allows the user to remain silent. The user must direct Lex every step of the way and have easy ways of backing out of an unwanted action.
Remember that Lex is much more powerful than the old automatic call systems, so trying to force Lex into that old system won't work well. Depending on how you design your bot, you can make the conversation much much more natural, accepting a very wide range of responses and directing those into proper actions.
Tips:
Things may have changed more recently, but when I was building Lex/Connect, it was not possible for the user to interrupt a playback message. So I had to also avoid what you are trying to do in the welcome message:
If you would like to use your keypad to select the menu options, say “keypad”, otherwise please listen...
Naturally, a user who does want to use the keypad will try to immediately say "keypad" and probably get frustrated by having to listen to the rest of the playback message. So I design every playback message to be short, deliver information first, and always end on the question. Often breaking the conversation up into more branching points to make the questions as specific as possible.
Don't worry about going back and forth with the user too many times. It gives the user comfort knowing they are on the right path to what they want and are able to control the conversation in smaller steps. They will get stressed, having to listen to long list of options and remembering what they are while figuring out which one best applies to them.
So make each question as clear as possible and avoid spoonfeeding options. It feels less natural to explicitly state to the user what they should say:
To report a missed pickup, say “missed pickup”.
That is unnatural.
A good middle ground would be asking one question with a list of options and pausing between each option. The user will understand that these are responses they should make, but won't feel unnaturally pressured into exact phrases. For example:
Would you like to, check your billing, report a missed pickup, ask about sales, or something else?
That is natural.
We are comfortable handling those types of questions because we often do that when speaking with humans. You may even want to use a question mark instead of commas so that the playback voice uses a questioning intonation with each option. It looks less natural in written form, but would probably sound more natural.
Last tip: Don't design your bot based on your experience talking with bots. Design your bot based on your experience talking with humans.

Related

How can I send a text message to multiple singular contacts in my Swift app?

Periodically, I like to send friendly text messages to large groups of people in my contacts. Sending the same message to lots of people is tedious, but I've never been fully satisfied with solutions offered by existing apps. So, I started developing my own.
I started with a Shortcut that works pretty well and has a few defining characteristics:
Messages can have "tags", such as for swapping in a contact's name, for a more personal touch.
Contacts receive their own personal text message. They are not part of a group message. No publicized phone numbers or delete-me-from-the-group bombs.
I can leave the process alone while it works; I don't have to confirm each message to send.
The whole process is serialized and persisted. If the process halts due to a faulty contact (like a disconnected phone number), I can resume the process right where I left off. No contact gets sent a duplicate message.
Shortcuts are a poor man's programming, though, and I was aching for a proper development experience. So I started learning Swift and writing an app to give me a more robust, UI friendly version of the Shortcut.
Alas, I fear I may have been eager. I haven't been able to find any documentation or examples of sending an iMessage or SMS text message to a contact without the need of some UI. MSMessageAppViewController is not what I want, because that sort of defeats the purpose of my automation goal here.
It seems very odd to me that Shortcuts would allow me to send text messages to a bunch of contacts without needing to confirm each message, and yet I can't do the same in a Swift program. Maybe I'm missing something?
This isn’t really an answer to your issue (I believe you can only use MSMessageViewController to send messages), but I did discover you can disable iMessage and Group Messaging and make it so when you send a message to a large group of people it sends them as individual, direct SMS messages.
I used this to send a text out to a group of 90 people without inciting a mass group thread. It was annoying to setup (and if you don’t set it up properly you’ll end up making a giant group thread which is scary) and you have to remember to undo the changes after, but it worked like a charm!
See this q/a: https://discussions.apple.com/thread/5211685?answerId=22908620022#22908620022

Twilio: Don't want to keep logs of voice callers' numbers

I use Twilio to operate an automated phone line that connects callers to resources for some very sensitive topics. If the phone numbers of callers were revealed due to a data breach or subpoena, it could have negative consequences for them. There's no need for us to log callers' numbers, and ideally I'd like to not store that information at all. However, these numbers show up in my usage logs:
I've searched for ways to prevent these numbers from being logged or to delete them after they've been logged, but I can't find anything documented. Is there a way to do this?
Partial answer: You can delete the record of a call using the API DELETE functionality:
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json
You can have a script periodically request all calls made to the number and call DELETE for each one. If your system involves recordings, transcriptions, or texts, you need to do the same for them.
This is an acceptable solution for our needs, but it would be ideal if the numbers weren't logged in the first place, so I'm still interested in hearing others' answers.

TwiML: create an automatic navigation & wait before playing the message

I am using Twilio to call Shops land-lines and play a message.
Some of the shops are using answering-machine with navigation to a specific departed: "press 3 for customer service..."
I would like to create an automatic navigation: When the system will recognize an answering machine I will use a digits sequence for each shop to reach the right department.
My problem is that after the system finished navigating
to the right department I don't know how long it will take the person in that department to pickup the phone and only after that to play the message.
This is what I am trying to do:
<Play>
<digits="wwww3">
</play>
<Pause length="?"/> // I don't know how long to wait.
<Play>
https://mySite/message.mp3
</play>
Is there an option to know when this person picks up the phone?
There is no easy answer. This is why most telemarketing companies use call screening (see below), or just play their message no matter what when someone answers.
Telemarketing is a multi-million dollar industry, and if this type of system was readily available or easy to develop companies would use it, however, they do not.
The only way you can be 100% sure a human has answered the phone and is listening is call screening as explained here: https://www.twilio.com/docs/tutorials/walkthrough/ivr-screening/php/laravel
While not a complete match for your query it is also covered here
https://www.twilio.com/help/faq/voice/can-twilio-tell-whether-a-call-was-answered-by-a-human-or-machine where it says
One alternative to AMD is Call Screening, aka “Human Detection”.
That is it for easy implementation. Outside of that you could code your own machine that could listen into the call via conference to try to identify when a human speaks and then process it. However, this type of system is very expensive and complex from what I have seen and even then it is not 100% reliable.

What is the best way to implement dynamic search on the server from iOS application?

I'm struggling with a problem of implementing dynamic search.
Here what i want to achieve:
In my application there is an option that user (program manager) will be able to search his team members. Each PM has its account on the server side (web service) where it is a table team_members which contains all the team members that correspond to this manager.
Their amount can be more than hundreds.
And client side app which I develop has an option search team members.
I want to implement it dynamically:
e.g When the user print first letter a I make a query to the server and get all the matches with a letter: Antuan, BArrow, etc.
Then user print ab and I make a query which must return Abraham, Abdulla, etc. And so on. All the matching results is shown in UITableView.
HTTP query to server is made each time text in UITextField shanges. I implement it with dispatch_async: on UITextFieldTextDidChangeNotification I create a dispatch_async where i make an HTTP request with searchbar.text.
The problem: it works very slow. I often get an exception bad selector was sent to the instance.
So my question:
Why is my approach bad? What is a better solution for this?
Or dynamic search it is a VERY bad idea and I must do search only on clicking some button?
Thanks. I hope some experienced iOS developers will give me good advice.
Making an HTTP request every time someone types a character is probably never going to be fast enough (nor does it really make sense -- read on). For a certain size of list, the answer would be to pull over the whole list in the background as soon as you present the field (but before the user starts typing in it). Once you have the list, you can start matching, in memory, on the local device. "More than hundreds" isn't very specific, and it depends on network speed, but I'd guess that if your list is less than 50K in payload size, pulling the whole thing will be the easiest way.
If the list is too big for that to be practical, but the list limited by the first character the user types is not too big, then the best approach might be to wait for the first character, fire off your HTTP request asynchronously, and only start the dynamic match once you've received the response containing all items that start with that letter. One thing to keep in mind is this: if you have the list limited by the first character, that's the only HTTP request you ever have to make (unless the user changes the first character) because all possibilities starting with that letter will be in that list. From there, you can pare down the list locally without any further HTTP requests.
As for why you're getting exceptions, it's hard to say without seeing your actual code. Try setting an exception breakpoint in Xcode. This will allow you to stop in the debugger when the exception is thrown, which will show you what's causing it.

Instant Messaging With Priority For Developer Communication

My team communicates a lot with IM. We'll sometimes use IM to ask a question even to someone who's in the next cube over. The reason for this is that we all find that answering an IM is much less disrupting than talking.
Still, I find that the blinking message window can be disrupting when I'm heads down coding. I can't help but look at what people have written and it often keeps me from finishing my thought. This type of multitasking is a productivity killer. I've therefore turned off the alert feature (I'm using Pidgin). My Windows task bar is hidden so I need to drag my cursor to the bottom of the screen, let the task bar pop up, and look if the pidgin tray icon is flashing orange to find out about new messages.
This works well except that sometimes people have a quick question to ask for which they need a quick answer.
It would be great to have the ability to send priorities on messages:
Priority 3: Check this out when you can
Priority 2: Normal chat
Priority 1: Please reply quickly
The priority level would then be used to determine the alert method. E.g. (1)Give focus to window, (2)blink in task bar, (3)blink in tray.
Any ideas on an easy way of accomplishing this?
Thanks
We use e-mail or internal twitter for your Priority 3.
We use IM for Priority 2.
We use walking over to someone's desk for Priority 1.
Edit: I'm sorry I didn't realize you were asking an implementation question. If you didn't want to institute new policies/standards for methods of contact (ala introducing an internal twitter or the like), you would need to standardize everyone in the office on the same IM application/protocol. And then you'd need to modify one. Trying to add something into the jabber spec (if it doesn't have it, I don't know) would be tedious and not worth the effort.
If you really wanted to pursue that route, you would probably be better off moving to IRC and using scripts to alert you if people talk to you while preceding their message with a pound! or something similar.
I think that as soon as you introduce a "priority message" function, all messages will start to be high priority. Human nature. I just set my status to "busy" and don't reply to messages that come in when i'm "busy" unless it is important. People get the point quickly.
While I agree with the statement that being able to make certain messages a higher priority will result in ALL messages being high-priority, you can always just shut off the IM, and then people will have to actually talk to you. If they are on your team, they should know when you are heads-down, and take some personal responsibility in making the decision to disrupt you.
I do roughly the same thing that Codingscape does - I set my status to Away. Many clients will display an 'away text' message when your status changes, so I just use "I'm very busy" or a similar message.

Resources