2

Is there any way to make a call programmatically without exiting from current app? I did a research, but all answers are with:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

This is not what I want, I need also to access the voice stream.

Cœur
  • 37,241
  • 25
  • 195
  • 267
taffarel
  • 4,015
  • 4
  • 33
  • 61
  • Can't be done. There is no public API that gives you any access to the phone call audio. – rmaddy Feb 26 '14 at 17:46
  • possible duplicate of [iOS 4.2 - Return to app after phone call](http://stackoverflow.com/questions/5028329/ios-4-2-return-to-app-after-phone-call) – Janak Nirmal Feb 26 '14 at 18:18
  • 1
    @JanakNirmal Not a duplicate because that is not what the OP is asking. 1) The OP doesn't want to leave the app at all, 2) The OP wants access to the audio of the phone call. – rmaddy Feb 26 '14 at 18:47

3 Answers3

6

If you're trying to make some kind of dialer - than NO. It's impossible in ios

Nikita Took
  • 3,980
  • 25
  • 33
4

What I understand from your question is to call and after you finish, go back to the app. Is it?

Your scheme need look like this:

NSURL *url= [NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@", phoneNumber]];
[[UIApplication sharedApplication] openURL:url];

Use telprompt instead tel.

Paulo Rodrigues
  • 5,273
  • 7
  • 35
  • 58
  • The OP is asking if he can make a call without leaving the application (and access the voice data). This merely presents a prompt before leaving the application to make the phone call. – David Berry Feb 26 '14 at 19:28
0

What you want can be done using below statement.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"telprompt://%@", telNumber]]];

What till will do is when you press call button, it will ask you for confirmation to dial or cancel. When you say call, the call goes and once call ends, you will see the app open with last visited page.

Using telprompt, you get return to app when call ends.

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276