ios-reversed-headers icon indicating copy to clipboard operation
ios-reversed-headers copied to clipboard

_CTCallCopyAllCalls always returns empty array

Open dave-trudes opened this issue 12 years ago • 9 comments

I assume that _CTCallCopyAllCalls should return the call history but it returns an empty array...

dave-trudes avatar Mar 21 '14 12:03 dave-trudes

Are you sure it doesn't return an array of active calls?

caughtinflux avatar Mar 21 '14 12:03 caughtinflux

I can confirm _CTCallCopyAllCalls is working on my end. Usage example: https://www.dropbox.com/s/g0zs1sjyscmomb7/Screenshot%202014-03-21%2018.49.20.png You may also need a special entitlement to use this API in your own process.

Bensge avatar Mar 21 '14 17:03 Bensge

Is there anything relevant in the syslog? iOS usually tells you if you're missing an entitlement.

davidmurray avatar Mar 21 '14 19:03 davidmurray

Thanks for your hints. Do you know the name of the entitlement? The only entry in the syslog that may be relevant is: <Error>: HID: The 'Passive' connection 'CallLog' access to protected services is denied.

My code looks like:

extern CFArrayRef _CTCallCopyAllCalls();
NSLog(@"call history: %@", _CTCallCopyAllCalls());

dave-trudes avatar Mar 24 '14 10:03 dave-trudes

You can get the entitlements of a binary with ldid -e /path/to/binary. As the functions returns valid data in SpringBoard as well, comparing the entitlements of the Phone app and SpringBoard, one possible candidate is com.apple.private.icfcallserver. In case that doesn't work, use ldid and try the other entitlements of the Phone app or SpringBoard.

Bensge avatar Mar 24 '14 10:03 Bensge

I see, so the device needs to be jailbroken to use that method?

dave-trudes avatar Mar 24 '14 11:03 dave-trudes

No, not necessarily. You just need to get your app signed with the entitlement. However, I seriously doubt Apple will allow your app in the App Store if you use private entitlements & APIs.

That said, try this one:

com.apple.coretelephony.Calls.allow

It might work.

davidmurray avatar Mar 24 '14 19:03 davidmurray

Thank you for your work guys, what do i need to do on my end to get this up and running?

navarro75 avatar May 28 '14 13:05 navarro75

See here:

https://stackoverflow.com/questions/19674514/how-to-create-entitlement-plist-file-in-xcode-5

davidmurray avatar May 28 '14 21:05 davidmurray