7 ms·
A former employer had a system that consumed phone calls from Twilio. The phonecall table had a touchtoneinput column for the sequence of digits a caller pushed
by xxr 4y ago
A former employer had a system that consumed phone calls from Twilio. The phonecall table had a touchtoneinput column for the sequence of digits a caller pushed after the call connected (press 1 for English, press 3 to dispute a charge, etc.). We would sporadically get these query errors on inserts--turned out the touchtoneinput column was defined as a bigint, and the rare occasions where a caller pressed the # or * keys were sending input that obviously could not be parsed as an integer.
Good rule of thumb: if a reasonable person calls it a number, but your application is never going to perform arithmetic on it[0], it should probably just be a string.
[0]: Yes, a credit card number can be checksummed, but that's more in the sense of a CC# being a sequence of numbers rather than one int.
- londons_explore 4y agoThere are actually 4 more touch tones possible - A, B, C and D. Sometimes you can get into secret menus if you play the tones for them...
- jbverschoor 4y agoHow do I enter these from an iphone? Or should I just let my laptop output the dtmf tones? I'm def. gonna try this out. I usually pres & and # a couple of times, because it often skips the useless menus and takes me to a person
- sshine 4y ago> should I just let my laptop output the dtmf tones? Yes. Depending on your OS, it might even have the sound files: https://osxdaily.com/2016/03/31/play-dtmf-tones-mac/ https://osxdaily.com/2016/03/31/play-dtmf-tones-mac/
- jbverschoor 4y agoCool!, but that doesn't include ABCD. https://pbxbook.com/other/dtmftone.html https://pbxbook.com/other/dtmftone.html does. I'll try a company I know takes at least 40 minutes usually : Also, something that annoys me about VOIP is that they don't take into account the different tones in different regions. Here in the Netherlands we use 425Hz fo dial tone etc. It always feels very emulated because it's a different tone.
- hnuser123456 4y agoI've found pressing 0 or 1 usually works too
- Someone 4y agoHistorically, you whistled them (https://en.wikipedia.org/wiki/Phreaking https://en.wikipedia.org/wiki/Phreaking), or you bought a hardware ‘whistle’ from the likes of Steve Jobs (https://en.wikipedia.org/wiki/Blue_box https://en.wikipedia.org/wiki/Blue_box)
- staticassertion 4y agoFirst thing I do when I call an automated line is spam # because that seems to escalate to a human 9x/10.
- JadeNB 4y agoI've noticed a lot more evil choose-your-own-adventure phone menus these days resort to "Sorry, I couldn't understand" / "Sorry, I still couldn't understand" / "Sorry, your input could not be processed. Goodbye."
- 9dev 4y agoYep, ye tricks of olde like repeatedly saying „help“ or „customer service“ don’t seem to work on those… i recently dealt with an especially frustrating case when moving and buying a brand-new fiber connection. Turns out, they got the activation date wrong, so I called the support hotline mentioned in the confirmation mail. The menu prompted me for my customer ID - which I didn’t yet have - and wouldn’t let me through, even after trying all possible options. In the end, I just called the sales hotline and let them handle the transfer…
- deleted 4y ago[deleted]
- JadeNB 4y agoI particularly hate the ones that just hang up if you guess wrong three times.
- cableshaft 4y agoYep, we had a few IVRs set up like that for clients at an old job. The reality was there for those was that there was no pool of agents we could transfer those calls to, it was set up to be an entirely automated system by request from the client. It was mainly for doctor appointment reminders, though, so hopefully those called still had their appointments written down somewhere (or also signed up for email reminders).
- 4y ago
- themenomen 4y agoMayor issue here seems to be not validating and sanitizing inputs before a DB insert.
- nightpool 4y agoOr not even being able to log errors and see what the error message says. You don't need to do ahead-of-time sanitization to realize that "Invalid literal for type 'bigint': "120380123#"" means that you should fix your DB type.
- xxr 4y ago>being able to log errors and see what the error message says A faculty that was, of course, lacking at this particular organization
- jbverschoor 4y agoA string of digits instead of a string of characters to be precise
- deleted 4y ago[deleted]
- yarg 4y agoCertainly not an Integer, but all that you're saying when you go with String is that the data has no constraints at all. There's almost always a regular language more constrained and useful than .* that contains the entire set of acceptable terms (although sometimes it'll be a strict superset, in which case DFA acceptance cannot constitute complete validation).
- stormbrew 4y agoWhen humans do the input there is often not a single regular language that works, and imposing only one will often frustrate a lot of users. A really small example of this is postal codes in Canada. For a long time the norm was to put a hyphen between the two clusters: A1B-2C3 but then at some point a lot of websites decided that's bad and they started rejecting it, often with really obtuse messages. This is just annoying and no one is really well served by it. Canada post doesn't care. And that's not even getting into 0 vs O and the fact that yelling at the user for entering the wrong one is rarely helpful. I think most of the time the better thing to do is attempt to normalize and ask the user if the normalization is correct. For a numeric thing like a phone number this is probably stripping out non-numbers (other than + at the start) and putting hyphens back in and validating the number of digits you get back, and presenting it to the user if it differs. More work but feels way less hostile to the user.
- jenny91 4y agoThe regular language should include the fact that you might include a dash between those sets of numbers, e.g. "A1B-2C3". I really can't think of any case where changing a "0" to an "O" is a good idea (or vice versa), except like base 58 whre you're explicitly avoiding both. Either way if you're going to normalize you need a regular language, so I think you're kinda missing the point here on what regular languages mean in this context?
- stormbrew 4y agoThat was just a simple example. If you take addresses as a whole, it gets a hell of a lot more complicated. I do agree that you can just `[ -]` in the middle of that one, but simple examples are simple. Also, it's telling that very few sites actually do this. The real point is that you want to have one regular form for the input in your database, but imposing that one that you prefer on your users creates friction when their experience of the world differs. As for 0 vs. O, in a Canadian postal code it doesn't matter, because there is indeed a very regular language to them: letters alternated with numbers. A round circly thing in a numeric position is a 0 and a round circly thing in a letter position is an O. No matter what. The only time this actually indicates a problem is if the pattern ceases to hold after the round circly thing, in which case it may or may not be the 0/O confusion that's the problem but it was wrong anyways. I'm not saying you should store it wrong, but if a user enters "HOH-OH0" and you ask "did you mean 'H0H 0H0'?"[1] and they say yes then you've given the user a much better and helpful flow than "Invalid Postal Code, please fill out the form again." [1] This is a 'real' postal code btw and it goes to a weird santa-letter black hole even though it doesn't indicate a geographical location that corresponds to the north (an H prefix is for Montreal).