PDA

View Full Version : iphone SDK dial a phone number




kiezarsoze
May 14, 2008, 01:04 PM
does anyone know how to dial a phone number programmatically by calling an iphone sdk function which launches the phone app with a phone number as a parameter?

cheers!



Peace
May 14, 2008, 01:05 PM
Unless you have the actual beta firmware on the physical iPhone it can't be done.

drivefast
May 16, 2008, 04:40 PM
use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.

kiezarsoze
Jun 8, 2008, 01:33 PM
use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.

I tried this and get a negative result.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://tel:1-800-275-2273"]];

this causes my program to exit and safari to launch (ok with me I know that apps can't run in the bg). However, safari reports "can't open the page" It shows the url in it's own window as I have it in quotes above. Furthermore, it reports the error "The error was: Cannot show URL"

Then I tried this:

I changed the string so that instead of http:// it says tel://

following this is the same phone number.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://1-800-275-2273"]];

Now I get an alert in my app saying "Unsupported URL. This URL wasn't loaded: tel://1-800-275-2273"

I have tried this also by removing the dashes to no avail.

HELP!

---

NEXT QUESTION:

Assuming I simply got the syntax wrong and this should work, what will happen when using an ipod touch? Is there a way to check if the app is running on an ipod touch or an iphone?

-----

FINNALY, I know I have asked this question a few times already, can anyone tell me how to get the iphone number out of the sim card? I want to be able to make a phone call and record which phone made the phone call. I suppose I can ask the user to enter their own phone number into my app but this would be a pain in the ass and open to error and hacking.

drivefast
Jun 10, 2008, 02:07 PM
hm, i either had it wrong, or they just changed the syntax recently (more probably i had it wrong first time i posted). according to apple the correct syntax for a hyperlink is
<a href="tel:1-408-555-5555">1-408-555-5555</a>
so i would try your code as it is, with the two forward slashes removed.

on the ipod touch there is no telephone application, so i assume no other app registers the tel: URL scheme, therefore you may get a message similar to what youre getting now.

still no way that i know to get the user's own phone number.

TAKEphONE
Jun 30, 2008, 09:44 AM
Hi all,

Just want to make sure - before I plunge into development...

- Can I initiate a phone call to a specific phone number (and name) from within my own application ?

- Will it always involve the user seeing Saffari on screen, and having to approve the dialing (on every call) ?

- Can I make a call to a number with "extra digits" (i.e. call 1-800-222-3333, wait for answer, then dial other touch-tone digits, wait 2 sec, then dial ...) ?

- Can my app be notified about telephony events, such as call progress, incoming call, etc. ?

Thanks in advance !

Pring
Jun 30, 2008, 12:59 PM
Hi all,

Just want to make sure - before I plunge into development...

- Can I initiate a phone call to a specific phone number (and name) from within my own application ?



Yes you can.


- Will it always involve the user seeing Saffari on screen, and having to approve the dialing (on every call) ?


Yes, otherwise you could make your users dial premium rate phone numbers without them knowing what they're calling! The user must approve the call.


- Can I make a call to a number with "extra digits" (i.e. call 1-800-222-3333, wait for answer, then dial other touch-tone digits, wait 2 sec, then dial ...) ?

- Can my app be notified about telephony events, such as call progress, incoming call, etc. ?

Thanks in advance !

Not really, no. Once you pass off to make the call your application will no longer be running. The user can enter touch tone digits etc but your app won't know what they've done. For the same reason you can't get notifications of telephony events.

izibo
Jun 30, 2008, 01:34 PM
Couldn't you just throw in a few pauses before the tones?

Pring
Jun 30, 2008, 01:45 PM
Couldn't you just throw in a few pauses before the tones?

Good idea. He could put in pauses using one or more commas.

TAKEphONE
Jul 1, 2008, 01:32 AM
Thanks, all !

On some dialed automated systems, it is better that the dialer stops and asks prompt the caller when to continue dialing the extra digits.

Some more questions, if I may:

- Can I access the call-log ?
- Can I access the speed-dial list ?

Thanks.

dgelfuso
Jul 17, 2008, 11:48 AM
I am trying to use the tel:// function to dial AT&T Voice Dial which is either *8, *08, or #121 but the * and # are always stripped when I use the tel:// function.

How can I get around this?

Pring
Jul 17, 2008, 12:39 PM
Try escaping them by putting a \ in front of them. They're special characters so are likely being stripped.

dgelfuso
Jul 17, 2008, 01:10 PM
Try escaping them by putting a \ in front of them. They're special characters so are likely being stripped.

Thanks, but the "\| didn't work.

TAKEphONE
Aug 10, 2008, 04:13 AM
Hi all,

Is there a way to read the "recents" list (calls log) ?

Is there a way to read the "favourites" list ?

Thanks.

schimanke
Aug 18, 2008, 08:31 AM
Has anyone found a way to include special characters in phone numbers?

My code looks like URLWithString:@"tel://**62*3311#" but anytime the app reaches the point where it should start dialing it just does nothing. When I include tel://**62*3311# as a hyperlink on a website, it strips off the * and #.

TAKEphONE
Aug 24, 2008, 03:14 AM
Couldn't you just throw in a few pauses before the tones?

Hi,

How do I represent pauses ?
When I tried commas - it just ignored them.

TAKEphONE
Aug 24, 2008, 06:35 AM
use the tel:// url, just like you would want to navigate to a web page with an http:// url. you may use this as a hyperlink on a web page, or you may take a look at the "launchme" application in the developers page for how to use openURL. note that the phone interface will be launched, but before the number is actually dialed, the user needs to confirm the operation.

Hi,

Is there no way for an app to start a call without the user having to confirm the call ?

I bumped into several apps that start calls without a confirmation dialog - are they using a "hidden function call" ?

(maybe they were written using the "unofficial sdk" ?)

Thanks.

hlysmksbtmn
Aug 31, 2008, 07:18 PM
anyone know how to programmatically dial a contact in my address book?

admanimal
Aug 31, 2008, 08:11 PM
anyone know how to programmatically dial a contact in my address book?

You need to extract their phone number using the address book APIs and then call it using a tel:// URL.

racemize
Sep 23, 2008, 10:32 PM
I know there is a way to dial without confirmation (which I think means using something other than the tel: url). There are a ton of apps in the app store, so how are they doing it? I hate when these features are hidden and to implement a simple feature you spend more time trying to find it instead of programming... Someone help!

TAKEphONE
Sep 23, 2008, 11:17 PM
I know there is a way to dial without confirmation (which I think means using something other than the tel: url). There are a ton of apps in the app store, so how are they doing it? I hate when these features are hidden and to implement a simple feature you spend more time trying to find it instead of programming... Someone help!

Hi,

I have been using the tel: url on a real iPhone device, and there was no confirmation dialog.

I guess the confirmation dialog only appears when the url is used from a web page, not when using it programatically.

ndefreitas
Dec 1, 2008, 09:31 AM
This link explains how it's done: https://developer.apple.com/iphone/library/featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

beachdog
Dec 3, 2008, 11:07 AM
Hi,

How do I represent pauses ?
When I tried commas - it just ignored them.

When I downloaded and ran the calling card app, which supports postdial pauses, it seems to use commas as the means to indicate a pause. The iphone documention, however, references the tel url as defined in RFC 2806, which has a different means for specifying postdial delays -- it specifies the use of the character "p" to indicate a one-second delay, only appearing after a ";postdial=" fragment.

Does anyone know if the SDK truly and fully suports RFC 2806 ?