1

I am working on an app that is strictly proof of concept. What i need to do is get the current number that has been dialed. I checked the CoreTelephony framework documentation and it has a class called CTCall, which exposes two properties - callID and callState. So it allows to detect call state changes (eg. when a number is dialed, when the call is connected, etc.) but the callID seems totally useless.

Is anyone aware of an alternate way to access this info? Private APIs are fine too and so are jailbroken methods. Because what i am working on is strictly proof of concept.

Thanks in advance.

cybervedaa
  • 309
  • 2
  • 10

2 Answers2

1

I found another way of retrieving the current dialed number. below is the code.

NSString *path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.plist";
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
NSMutableString *number = [NSString stringWithFormat:@"%@", [dict valueForKey:@"DialerSavedNumber"]];

Limitations : It does not pick up the dialed number if the number was dialed by clicking a link or if it was dialed by clicking a number from the recents list or from contacts.It only works if the number was dialed on the dialer.

cybervedaa
  • 309
  • 2
  • 10
  • This method is not working i am getting the dictionary null on iOS 6.1.3 any help please. –  Jul 30 '13 at 06:54
0

The jailbreak way to search the call log is directly querying the database file. Have a look at this example.

On iOS 5, a sandboxed application doesn't have reading permissions for this file, the way around (jailbreak only) is to manually sign the application and copy it to the system Applications folder.

Check this question for more info on the subject.

Community
  • 1
  • 1
fbernardo
  • 10,016
  • 3
  • 33
  • 46
  • Thanks for the reply fbernardo. Unfortunately, the method described in your link does not work in iOS 5.0 and higher. – cybervedaa Apr 05 '12 at 01:46