0

Our application lets users call phone numbers. Users would like to be able to block their caller ID.

On other platforms, we let the user specify a custom dialing prefix. For instance, on my cell provider it's #31#.

I've tried two approaches so far.

First:

id url = [NSURL URLWithString: @"tel:#31#0000000"]
// produces nil

Second:

id encoder = ["#31#0000000" stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
// produces %2331%230000000
id url = [NSURL URLWithString: [NSString stringWithFormat: @"tel:%@", encoded]];
// produces a valid-looking NSURL which doesn't do anything

I'm thinking at this point that I'm just not allowed to dial # and *, even from a Cocoa touch application. (I know it's not allowed from a web app.) Is this true, or am I missing something obvious?

Mike Abdullah
  • 14,933
  • 2
  • 50
  • 75
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
  • 1
    I would suggest making a contact in your address book with the specified phone number, then getting the information about that phone number programatically and see if you can find what it looks like. – Ed Marty Apr 28 '10 at 01:52
  • Duplicate of http://stackoverflow.com/questions/4660951/problem-using-tel-with-star-asterisk – David d C e Freitas Feb 24 '12 at 09:12
  • If by "duplicate" you mean "posted a year before." :P This was posted in April 2010, the question you say it's a duplicate of was posted in January 2011. – Steven Fisher Feb 24 '12 at 17:55

1 Answers1

1

It looks like there's intentionally no way to do this.

To prevent users from maliciously redirecting phone calls or changing the behavior of a phone or account, the Phone application supports most, but not all, of the special characters in the tel scheme. Specifically, if a URL contains the * or # characters, the Phone application does not attempt to dial the corresponding phone number.

Apple URL Scheme Reference Phone Links

Steven Fisher
  • 44,462
  • 20
  • 138
  • 192