Rob
Rob

Reputation: 123

Sending # & * in tel: URIs in iOS 5+

Just recently we've noticed that calling [[UIApplication sharedApplication] openURL:url] with a tel: URI containing # or * characters is now permitted to be dialed in iOS 5.1.

e.g. NSURL *url = [NSURL URLWithString:@"tel:15555551212,,1234#"];

The documentation doesn't appear to have been updated to indicate that this is now allowed. It still doesn't work in iOS 4.x. We're testing to see when this changed. Does anyone know if Apple has officially changed its policy on dialing these characters from an app?

Upvotes: 3

Views: 648

Answers (2)

ETech
ETech

Reputation: 1607

The change, described by tc. really happened. At the same time, we limited end of DTMF tel by '+' at the end and it causes DTMF malfunction
So, url like tel://1234567,12345+ does not work on iPhone 5, but works on iPhone4(s) even with ios6
Working tel url code:

NSString * baseTel = @"12345";
NSString * ext = @"54321";
NSString * telStr = [NSString StringWithFormat:@"tel://%@,%@#",$baseTel,$ext];
NSURL * theUrl = [NSURL URLWithString:[telStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

This Calls to 12345 and plays DTMF 54321# after the line answered.

Upvotes: 0

tc.
tc.

Reputation: 33592

The change appears to allow # and * after , or ;, i.e. sending DTMF after the call connects. , waits a few seconds, ; lets the user decide when to send it with e.g. a "Dial 123" button. Presumably sending DTMF over the call is considered safe, given that it won't be interpreted as a service/USSD/etc code.

There's still the possibility of using it for nefarious purposes depending on operator, but this relies on the user not ending the call before it finishes the payload (e.g. you could delete some voicemail if you knew the right number).

Upvotes: 4

Related Questions