使用 iPhone SDK 以编程方式拨打电话号码并传递 DTMF
如何通过 iPhone SDK 以编程方式执行以下操作:
通过 iPhone SDK 以编程方式拨打电话号码
绕过拨号/取消
strong> iPhone 弹出的提示在拨打号码后发送额外的 DTMF,就像您将暂停编程为暂停一样普通电话。
我知道您可以拨打 tel://
呼叫,但问题是它会弹出拨号/取消提示,之后会阻止发送任何未来的 DTMF。
How do you programmatically do the following from the iPhone SDK:
Programmatically Dial a Phone Number through the iPhone SDK
Bypass the dial / cancel prompt that the iPhone brings up
Send additional DTMF after the number is dialed just like how you would program pauses into a regular phone.
I know you can make a tel://
call but the issue is that it brings up the dial / cancel prompt and after that it prevents any future DTMF from being sent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
你不能这样做。 SDK 不允许您以这种详细程度控制电话功能。
You can't do this. The SDK does not allow you control the phone function in this level of detail.
iPhone SDK 不允许您直接访问拨号号码(想象一下,如果您的手机上安装了一个“不良”程序,并在静音状态下拨打了按分钟付费的号码,因此您没有注意到)。
但是,如果您使用电话链接,那么您应该能够向其发送插入暂停的“,”字符。
因此,要拨打 555-1212,然后等待 4 秒钟,然后在按键音上输入 12345#,您将使用 tel:5551212,,12345#
查看
https://developer.apple.com/library/archive/精选文章/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html
The iPhone SDK does NOT give you direct access to dial numbers (imagine if a 'bad' program got on your phone and dialed a pay per minute number on mute so you didn't notice).
However, if you use the tel link, then you should be able to send it "," characters which inserts pauses.
So to dial 555-1212, then wait 4 seconds, then do 12345# on the touch tone you would use tel:5551212,,12345#
Check out
https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html
我不知道为什么每个人都说你不能......你可以!
这将绕过拨号/取消提示拨打电话号码...接听电话后 1 秒,dtmfAfterPickup字符串。
检测是否设备支持通话
I dont know why everyone says you cant... you CAN!
This will dial the phoneNumber bypassing the dial/cancel prompt... 1 second after the call is answered, the dtmfAfterPickup string will be automatically dialed.
Its a good idea to detect whether or not the device support phone calls
根据上面的 Adam's Apple 开发人员链接,有一个 RFC 链接详细解释了 iPhone 支持的电话链接方案的不同选项 -
http://www.ietf.org/rfc/rfc2806.txt
这至少允许您在 URL 中插入带有“p”的暂停,但指定了很多选项(但并非全部都是必需的)根据 RFC。 还有什么作用?
Per Adam's Apple developer link above, there's this RFC link that explains more about the different options for a telephone link scheme that the iPhone supports -
http://www.ietf.org/rfc/rfc2806.txt
This at least allows you to insert pauses with a 'p' in the URL, but plenty of the options are specified (but not all are required) per the RFC. What else works?
我尝试在 iPhone 上使用 CoronaSDK 和 openurl API。
效果非常好!
只需执行:system.openURL("tel:[phonenumber],123")。
您可以使用附加逗号等待更多。
使用 Corona SDK/iOS7 进行测试。
I tried with my iPhone using CoronaSDK and openurl API.
It works very well!
Just do: system.openURL("tel:[phonenumber],123").
You can wait more with additinal commas.
Tested with Corona SDK / iOS7.
实际上,我只是尝试了以下 555-555-4822 EXT 8030
即使在按下拨号键后,它似乎也确实传输了一些音调(p 的数字代表延迟的秒数)。 然而,远端并未按预期响应音调,因此仍然存在问题。
然而,这确实有效,尽管它更容易出现计时问题电话:555-555-4822, 8030。连接后仅暂停一秒(,,将是两秒),然后播放 8030 音调
Actually, I just tried the following 555-555-4822 EXT 8030
And it does seem to transmit some tones even after pressing dial (the number of p's represents the number of seconds delay). However, the tones are not being responded to on the far end as expected, so something is still amiss.
This does work, however, though it's a little more prone to timing problems tel: 555-555-4822, 8030. This just pauses for one second (,, would be two seconds) after connection, and then plays the 8030 tones