重新发明拨号调制解调器 (2019)
Reinventing the dial-up modem (2019)

原始链接: https://saket.me/dtmf-tones/

在开发医疗健康应用“Simple”时,团队旨在通过用智能、注重隐私的系统取代纸质记录和固定电话,来现代化护士-患者随访。一个关键功能是屏蔽电话号码——像Uber和Zomato一样保护患者隐私——但该应用需要*离线*运行,这构成挑战,因为典型的号码屏蔽需要互联网连接。 解决方案?利用DTMF音调——按下电话键盘按钮发出的声音。当护士通过该应用发起呼叫时,它会拨打一个免费电话号码,并将患者ID作为DTMF音调发送出去。像Twilio这样的服务在服务器端解码这些音调,然后将护士连接到正确的患者。 虽然编码需要时间,但这种方法允许离线功能,这对于偏远地区至关重要。该方法利用现有的电信基础设施,并且出人意料地通用——甚至与历史上“电话黑客”有关。该团队还发现了一种潜在的解决方法,可以通过在电话号码后直接输入服务代码来绕过自动电话系统。

Hacker News新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交登录 重新发明拨号调制解调器 (2019) (saket.me) 6 分,by todsacerdoti 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 Animats 5 分钟前 [–] 音频样本的音调时间很奇怪。最小音调持续时间为 65 毫秒,音调之间的最小暂停持续时间为 65 毫秒。[1] 该示例的音调持续时间远长于暂停时间。如果你发送 100 毫秒长的音调,暂停 100 毫秒 [1] https://www.etsi.org/deliver/etsi_es/201200_201299/20123502/...回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

While working on a healthcare app called Simple at my previous company, we wanted to improve how nurses follow up with their patients. The aim was to replace traditional paper registers + landline phones with the app, which could intelligently suggest patients who are potentially at risk based on their medical history, age, and other important cues.

For protecting their privacy, we needed to route their phone calls through a proxy so that their personal numbers stayed hidden from their patients. This is referred to as “phone number masking” and is commonly used these days. When you take a ride with Uber, or order food with Zomato, both you and your driver/rider are assigned temporary numbers for privacy for the duration of the trip/task. When your driver dials your proxy number, Uber forwards the call to your actual phone number.

The plan was similar for Simple, but there was one problem with this approach: talking to the server required an internet connection. We wanted to keep Simple offline-first. While it’s nice to have a data connection, it was important for the app’s functionality to not degrade when a connection is unavailable, especially in remote villages.

We needed a way to send data to our server without an internet connection. A team member came up with this fantastic idea of using DTMF tones!

DTMF stands for Dual Tone – Multi Frequency. It’s the tone your phone plays when you press a number on the dial-pad during an ongoing phone call. Each number is assigned a combination of two sine waves for identifying its row and column indices on the dial-pad.

Turns out, DTMF tones are great. They are easy to implement and most communication-as-a-service platforms support them out of the box. On Android, DTMF tones can be played using a call Intent:

<span class="token keyword">val</span> dtmfTones <span class="token operator">=</span> patientNumber <span class="token operator">+</span> <span class="token string">"#"</span>
<span class="token keyword">val</span> numberToCall <span class="token operator">=</span> tollFreeNumber <span class="token operator">+</span> <span class="token string">","</span> <span class="token operator">+</span> dtmfTones

<span class="token keyword">val</span> numberUri <span class="token operator">=</span> Uri<span class="token punctuation">.</span><span class="token function">fromParts</span><span class="token punctuation">(</span><span class="token string">"tel"</span><span class="token punctuation">,</span> phoneNumber<span class="token punctuation">,</span> <span class="token keyword">null</span><span class="token punctuation">)</span>
context<span class="token punctuation">.</span><span class="token function">startActivity</span><span class="token punctuation">(</span><span class="token function">Intent</span><span class="token punctuation">(</span>Intent<span class="token punctuation">.</span>ACTION_CALL<span class="token punctuation">,</span> numberUri<span class="token punctuation">)</span>

When a nurse clicks a patient’s call button, the app dials our toll-free number and plays the patient’s number as DTMF tones. The server receives the patient’s number through Twilio (which does the job of decoding DTMF tones) and in turn, connects the nurse with the intended patient.

Here’s what the call sounds like:

It would have been nice if we could customize how DTMF tones are encoded because playing a phone number takes quite long, but it’s alright considering they’ll only be used when an internet connection is unavailable.

By now you’ve probably realized why this technology feels so familiar.

If you’re still not convinced that DTMF tones are cool then let me introduce you to “phone phreaking”: Before They Created Apple, Jobs And Wozniak Hacked The Phone System | FiveThirtyEight.

Exercise for the reader

If 1800-XXX-XXXX is your network company’s customer support number and 9 is the number you press on the dialpad after hearing a recorded message for 20s to reach a human, what happens if you dial 1800-XXX-XXXX,9 directly? The dialer may not let you enter a comma, but you can work around this by saving the number as a contact. I tested this with my network carrier, Fido, but your mileage may vary.

Cover photo by Akshay Verma.

联系我们 contact @ memedata.com