Detect if an iPhone OS device can make phone calls

- (BOOL)deviceCanMakePhoneCalls

{

BOOL canMakePhoneCalls;

if ([UIApplication instancesRespondToSelector:@selector(canOpenURL:)]) {

// OS 3.0+, so use canOpenURL

UIApplication *app = [UIApplication sharedApplication];

canMakePhoneCalls = ([app canOpenURL:[NSURL URLWithString:@"tel:+44-1234-567890"]]);

} else {

// OS 2.x, so check for iPhone

UIDevice *device = [UIDevice currentDevice];

canMakePhoneCalls = ([device.model isEqualToString:@"iPhone"]);

}

return canMakePhoneCalls;

}