Programmatically Dial a Phone number and pass DTMF using the iPhone SDK

I dont know why everyone says you cant... you CAN!

NSString *phoneNumber = @"15555551212";
NSString *dtmfAfterPickup = @"1234";
NSString *telString = [NSString stringWithFormat:@"tel:%@,%@", phoneNumber, dtmfAfterPickup];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telString]];

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


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?


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

Tags:

Ios

Phone Call