Programmatically dial a phone number with an access code

How can I dial a phone number that includes a number and passcode programmatically in iOS?

For example:

number: 900-3440-567
Access Code: 65445

+45
ios iphone ios4 ios-simulator
Mar 28 '11 at 8:28
source share
9 answers
UIDevice *device = [UIDevice currentDevice]; if ([[device model] isEqualToString:@"iPhone"] ) { [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:130-032-2837"]]]; } else { UIAlertView *notPermitted=[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Your device doesn't support this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [notPermitted show]; [notPermitted release]; } 
+107
Mar 28 2018-11-11T00:
source share

follow the instructions

http://www.makebetterthings.com/blogs/iphone/open-phone-sms-email-map-and-browser-apps-in-iphone-sdk/

to call a number -

 NSURL *url = [NSURL URLWithString:@"tel://012-4325-234"]; [[UIApplication sharedApplication] openURL:url]; 

to open the application after completion of use -

(Note: telprompt is not documented)

 NSURL *url = [NSURL URLWithString:@"telprompt://012-4325-234"]; [[UIApplication sharedApplication] openURL:url]; 
+34
Mar 28 2018-11-11T00:
source share

You can programmatically dial phone numbers using the UIApplication openURL: method (see example below). I'm not sure if access codes are supported, but this is at least a starting point.

 NSURL *URL = [NSURL URLWithString:@"tel://900-3440-567"]; [[UIApplication sharedApplication] openURL:URL]; 

Edit: See Apple URL Schema Link and UIApplication Class Link for more information.

+19
Mar 28
source share

I don’t know if you really found a solution to pass the access code, but for me this code worked:

 NSString *dialstring = [[NSString alloc] initWithFormat:@"tel:your_phonenumber,your_accessnumber"]; 

This will result in a dial string with the following values: tel:9003440567,65445

The remaining parts are controlled by the iOS phone application with the following command:

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

, in the line causes a pause in your telephone system (the one where you want to access the conference room) immediately after dialing the first number and establishing a connection. Thus, the telephone system has time to ask you about the access code (I think it should ask you how our system works). And after that, your access code should be transmitted.

BE A SIGN . Your access code will be transmitted in a non-secret manner. For example: Your displayed passcode will be displayed in the iPhone iPhone application as follows: 9003440567, 65445

+7
Dec 6 '13 at 15:22
source share

Using this user, you can redirect a call and after it is diverted, it is automatically diverted to the application. He works for me and is sure of it.

 if ([[device model] isEqualToString:@"iPhone"] ) { NSString *phoneNumber = [@"telprompt://" stringByAppendingString:cellNameStr]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; } else { UIAlertView *warning =[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Your device doesn't support this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [warning show]; } 
+3
Feb 12 '14 at 13:17
source share

Here is a standalone solution in Swift :

 private func callNumber(phoneNumber:String) { if let phoneCallURL:NSURL = NSURL(string: "tel://\(phoneNumber)") { let application:UIApplication = UIApplication.sharedApplication() if (application.canOpenURL(phoneCallURL)) { application.openURL(phoneCallURL); } } } 

Now you can use callNumber("7178881234") to make a call; hope this helps!

+3
Apr 25 '15 at 19:07
source share

You can use phone URLs to call the Phone app to dial for you. See reference .

The disadvantage is that as soon as the call is completed, the user will enter the Phone application. But I am afraid that there is no solution to this problem. iOS does not allow any application to directly initiate a call due to security and privacy concerns.

You can use a comma to enter a pause when dialing a number.

+2
Mar 28 '11 at 8:43
source share

It is not possible to dial a softphone number, which includes the number and access code.

The Apple Developer Library provides the following information:

"... The Phone application supports most of the special characters in the phone circuit, but not all. In particular, if the URL contains * or # characters, the Phone application does not try to dial the appropriate phone number ."

See: Apple URL Schema Link

+2
Sep 04
source share

There are several ways to dial the phone number and the described method:

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

This is the right way to do this, but it has a number of problems. First, it incorrectly requests the user, and secondly, it does not return the user to the application when the phone call is completed. To place a phone call correctly, you must call the request before the call so that you do not surprise the user, and you must return the user to the application after the call is completed.

Both can be performed without using a private API, as suggested in some answers. The recommended approach uses telprompt api, but it does not use a private copy of the call and instead creates a web view that allows future compatibility.

 + (void)callWithString:(NSString *)phoneString { [self callWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",phoneString]]]; } + (void)callWithURL:(NSURL *)url { static UIWebView *webView = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ webView = [UIWebView new]; }); [webView loadRequest:[NSURLRequest requestWithURL:url]]; } 

Here is an example project and additional information: http://www.raizlabs.com/dev/2014/04/getting-the-best-behavior-from-phone-call-requests-using-tel-in-an-ios- app /

+1
Apr 08 '14 at 3:40
source share



All Articles