简体   繁体   中英

Call a Phone number and pass DTMF using iOS

How to achieve the below requirement using iOS?

1) Programmatically dial a Phone Number through iOS.

2) Send additional DTMF after the number is called.

I found tel URL scheme is available to make a call. Not sure about sending DTMF tones.

https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html

You can't send DTMF tones over the Phone app directly with the SDK. However, you can append numbers to the phone number like so:

  • Semicolon: wait to dial the next number. The Phone app will show a button.
  • Comma: wait 1 second (I think) and then dial the number automatically.

Example:

Let's say you want to dial 1-800-555-1212, automatically key in 2 after 3 seconds to pick an option from a voice menu, and then allow the user to press a button that will dial 4 5 . You would pass the following as your phone URL:

@"tel:1-800-555-1212,,,2;45"

This also works in the Contacts and Phone apps. You can even put in commas and semicolons when editing someone's phone number by pressing the + * # key on the phone keypad.

I don't know where this is documented. I figured it out by experimentation and by talking to coworkers who are telephony experts.

无法通过应用程序通过呼叫发送DTMF。

1) is done by opening an url wil the tel protocol like

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-234-567890"]];

2) is afaik not possible in the current SDK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM