6

I'm writing an iPhone application which needs to have an option to call our office. However, the phone number that needs to be dialed has a 5 digit extension.

I know that to call a regular phone number we can use openURL using something like:

[[UIApplication sharedApplication] 
    openURL:[NSURL URLWithString:@"tel:1-800-555-5555"]];

Can I get this to work with an extension? If so, how?

The Apple docs link to RFC 2806, which describes the URL scheme for tel: and it seems as though extensions are supported, but I can't figure out the syntax from the RFC.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Ben S
  • 68,394
  • 30
  • 171
  • 212
  • In the GSM world, there is a way to insert a delay into a dialing string. Sorry, I don't remember it, but it's a place to start. In your RFC, section 2.5.6 it says "A local phone number or a post-dial sequence may contain characters which indicate a pause while dialing ("p"), or a wait for dial tone ("w")." – KevinDTimm Dec 09 '09 at 16:07

2 Answers2

9

Not 100% sure if this is the answer, but from the RFC you linked on page 14:

tel:+358-555-1234567;postd=pp22

The above URL instructs the local entity to place a voice call to +358-555-1234567, then wait for an implementation-dependent time (for example, two seconds) and emit two DTMF dialing tones "2" on the line (for example, to choose a particular extension number, or to invoke a particular service).

Hope this helps.

Topher Fangio
  • 20,372
  • 15
  • 61
  • 94
  • I tried it and didn't need the postd. I just put the phone number @"800-555-5555;pp1" and it worked like a charm. Thanks Topher! – Joshua May 05 '11 at 18:23
  • 1
    I just tried and it wouldn't work with the semicolon! @"+1-800-555-5555p1" worked for me though. – Mike Sprague Jul 31 '12 at 23:23
2

If it is a phone system where you dial the main number, hear a prompt and then enter the extension number then you can include a pause in your number to allow for the call to be picked up. Per the RFC 2806 that you linked to this is done using a "p" pause character for each 1 second pause.

mikej
  • 65,295
  • 17
  • 152
  • 131