See
here, I don't have any experience of using this though. I suspect this is to run on the OSX/PC, not on the iPhone itself (I bet the sandbox prevents accessing such data).
From memory, the call logs are stored in a Sqlite database, this is synced and backed up to your HDD when you connect your iPhone and iTunes does its business.