The iPhone Wiki is no longer updated. Visit this article on The Apple Wiki for current information. |
Difference between revisions of "Call History Database"
(Initial version) |
m |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | ''' |
+ | '''call_history.db''' is an SQLite 3 database file which contains the call history from MobilePhone.app on iOS. |
==Serialization== |
==Serialization== |
||
In the folder <code>/var/wireless/Library/CallHistory</code> the file <code>call_history.db</code> is located. |
In the folder <code>/var/wireless/Library/CallHistory</code> the file <code>call_history.db</code> is located. |
||
+ | The [[iTunes Backup]] filename of <code>call_history.db</code> is <code>2b2b0084a1bc3a5ac8c27afdf14afb42c61a19ca</code>. |
||
===Database file=== |
===Database file=== |
||
The <code>call_history.db</code> SQLite 3 database has the following tables: |
The <code>call_history.db</code> SQLite 3 database has the following tables: |
||
Line 7: | Line 8: | ||
* call |
* call |
||
===Tables=== |
===Tables=== |
||
+ | All date fields is shown as number of seconds since Jan 1st, 2001. |
||
===_SqliteDatabaseProperties=== |
===_SqliteDatabaseProperties=== |
||
This is general-purpose table to store some configuration values. |
This is general-purpose table to store some configuration values. |
||
Line 35: | Line 37: | ||
|- |
|- |
||
|timer_lifetime |
|timer_lifetime |
||
+ | |431337 |
||
− | |31337 |
||
|style="text-align:left;" | A call time counter which counts the number of seconds for all phone calls ever made (both incoming and outgoing) |
|style="text-align:left;" | A call time counter which counts the number of seconds for all phone calls ever made (both incoming and outgoing) |
||
|- |
|- |
||
Line 68: | Line 70: | ||
|_ClientVersion |
|_ClientVersion |
||
|11 |
|11 |
||
− | |style="text-align:left;" | The version of this database |
+ | |style="text-align:left;" | The version of this database |
+ | *version 12 is used in iOS 7 |
||
+ | *version 11 is used in iOS 6 |
||
+ | *version 9 is used in iOS 5 |
||
+ | *version 5 is used in iOS 3 |
||
+ | *version 3 is used in iOS 2 and 1.1.4 |
||
|- |
|- |
||
|timer_last |
|timer_last |
||
Line 88: | Line 95: | ||
|timer_last_reset |
|timer_last_reset |
||
|232345655.1842 |
|232345655.1842 |
||
− | |style="text-align:left;" | The date the call timer statics was last reset, usally (almost) the same as data_last_reset. |
+ | |style="text-align:left;" | The date the call timer statics was last reset, usally (almost) the same as data_last_reset. |
|- |
|- |
||
|data_last_reset |
|data_last_reset |
||
|232345655.1942444 |
|232345655.1942444 |
||
− | |style="text-align:left;" | The date the data statics was last reset, usally (almost) the same as timer_last_reset. |
+ | |style="text-align:left;" | The date the data statics was last reset, usally (almost) the same as timer_last_reset. |
|- |
|- |
||
|__CPRecordSequenceNumber |
|__CPRecordSequenceNumber |
||
Line 98: | Line 105: | ||
|style="text-align:left;" | ? |
|style="text-align:left;" | ? |
||
|} |
|} |
||
+ | |||
+ | ===call=== |
||
+ | This is the main table where the call history is stored: |
||
+ | {| class="wikitable" style="font-size: smaller; text-align: center; table-layout: fixed; border-collapse: collapse;" border="1" |
||
+ | |- |
||
+ | !field name |
||
+ | !type |
||
+ | !value / description |
||
+ | |- |
||
+ | |ROWID |
||
+ | |INTEGER PRIMARY KEY AUTOINCREMENT |
||
+ | |style="text-align:left;" | primary key |
||
+ | |- |
||
+ | |address |
||
+ | |TEXT |
||
+ | |style="text-align:left;" | Phone number or FaceTime ID of contact that has been called/has received call from. |
||
+ | |- |
||
+ | |date |
||
+ | |INTEGER |
||
+ | |style="text-align:left;" | the date of the phone call |
||
+ | |- |
||
+ | |duration |
||
+ | |INTEGER |
||
+ | |style="text-align:left;" | number of seconds the phone call lasted |
||
+ | |- |
||
+ | |flags |
||
+ | |INTEGER |
||
+ | |style="text-align:left;" | flag is 4 for incoming calls, 5 for outgoing calls, 8 for blocked calls |
||
+ | |- |
||
+ | |id |
||
+ | |INTEGER |
||
+ | |style="text-align:left;" | Contacts or Address Book ID of the contact being called. This column would be '''-1''' if the contact is unknown (e.g. not in address book). This column is always '''-1''' on incoming calls. |
||
+ | |- |
||
+ | |name |
||
+ | |TEXT |
||
+ | |style="text-align:left;" | always empty |
||
+ | |- |
||
+ | |country_code |
||
+ | |TEXT |
||
+ | |style="text-align:left;" | The mobile country code (MCC) of the country the phone was in when the call was placed. Example: '''234''' for United Kingdom. ([http://en.wikipedia.org/wiki/Mobile_country_code list of MCC/MNC]) |
||
+ | |- |
||
+ | |network_code |
||
+ | |TEXT |
||
+ | |style="text-align:left;" | The mobile network code (MNC) of the network the phone was on when the call was placed. Example: '''30''' for T-Mobile (UK) ([http://en.wikipedia.org/wiki/Mobile_country_code list of MCC/MNC]) |
||
+ | |- |
||
+ | |read |
||
+ | |INTEGER DEFAULT '1' |
||
+ | |style="text-align:left;" | read=0 if the call is an missed call, which hasn't been "read". Example there is a (number) on the Phone icon, showing number of missed calls. read=1 if the missed calls has been checked. |
||
+ | |- |
||
+ | |assisted |
||
+ | |INTEGER DEFAULT '0' |
||
+ | |style="text-align:left;" | ? |
||
+ | |- |
||
+ | |face_time_data |
||
+ | |BLOB |
||
+ | |style="text-align:left;" | ? |
||
+ | |- |
||
+ | |originalAddress |
||
+ | |TEXT DEFAULT <nowiki>''</nowiki> |
||
+ | |style="text-align:left;" | ? |
||
+ | |} |
||
+ | Note: name, country_code, network_code where added in iOS 5, while read, assisted, face_time_data, originalAddress where added in iOS 6. |
||
+ | |||
+ | == See Also == |
||
+ | * [[Databases]] |
||
+ | |||
+ | ==References== |
||
+ | * [http://avi.alkalay.net/2011/12/iphone-call-history.html iPhone Call History Database] |
||
+ | * [http://code.google.com/p/iphonelogd/wiki/CallHistoryDatabase Call History Database] |
Latest revision as of 16:41, 2 November 2013
call_history.db is an SQLite 3 database file which contains the call history from MobilePhone.app on iOS.
Contents
Serialization
In the folder /var/wireless/Library/CallHistory
the file call_history.db
is located.
The iTunes Backup filename of call_history.db
is 2b2b0084a1bc3a5ac8c27afdf14afb42c61a19ca
.
Database file
The call_history.db
SQLite 3 database has the following tables:
- _SqliteDatabaseProperties
- call
Tables
All date fields is shown as number of seconds since Jan 1st, 2001.
_SqliteDatabaseProperties
This is general-purpose table to store some configuration values.
field name | type |
---|---|
key | TEXT |
value | TEXT |
UNIQUE(key) |
These values are stored in the table:
key | value | description |
---|---|---|
call_history_limit | 100 | Sets the limit on the number of entries in the call history, increasing this value has no effect however. |
timer_lifetime | 431337 | A call time counter which counts the number of seconds for all phone calls ever made (both incoming and outgoing) |
data_up_last | 0 | ? |
data_down_last | 0 | ? |
data_up_all | 1337.72234523 | A data counter which counts the number of megabytes sent via Cellular Network Data (i.e. not WiFi), since last statistics reset. |
data_down_all | 31337.56235627 | A data counter which counts the number of megabytes received via Cellular Network Data (i.e. not WiFi), since last statistics reset. |
data_up_lifetime | 1337.72234523 | A lifetime data counter which counts the number of megabytes sent via Cellular Network Data (i.e. not WiFi), doesn't get reset on a statistics reset. |
data_down_lifetime | 31337.56235627 | A lifetime data counter which counts the number of megabytes received via Cellular Network Data (i.e. not WiFi), doesn't get reset on a statistics reset. |
_UniqueIdentifier | CAFEBABE-F00D-DEAD-BEEF-31337ABFDEDA | An unique identifier for this phone |
_ClientVersion | 11 | The version of this database
|
timer_last | 1337 | The length of the last phone call (in seconds) |
timer_outgoing | 31337 | The total length of all outgoing phone calls, since last statistics reset |
timer_ingoing | 41337 | The total length of all incoming phone calls, since last statistics reset |
timer_all | 72674 | The total length of all incoming/outgoing phone calls, since last statistics reset |
timer_last_reset | 232345655.1842 | The date the call timer statics was last reset, usally (almost) the same as data_last_reset. |
data_last_reset | 232345655.1942444 | The date the data statics was last reset, usally (almost) the same as timer_last_reset. |
__CPRecordSequenceNumber | 39461 | ? |
call
This is the main table where the call history is stored:
field name | type | value / description |
---|---|---|
ROWID | INTEGER PRIMARY KEY AUTOINCREMENT | primary key |
address | TEXT | Phone number or FaceTime ID of contact that has been called/has received call from. |
date | INTEGER | the date of the phone call |
duration | INTEGER | number of seconds the phone call lasted |
flags | INTEGER | flag is 4 for incoming calls, 5 for outgoing calls, 8 for blocked calls |
id | INTEGER | Contacts or Address Book ID of the contact being called. This column would be -1 if the contact is unknown (e.g. not in address book). This column is always -1 on incoming calls. |
name | TEXT | always empty |
country_code | TEXT | The mobile country code (MCC) of the country the phone was in when the call was placed. Example: 234 for United Kingdom. (list of MCC/MNC) |
network_code | TEXT | The mobile network code (MNC) of the network the phone was on when the call was placed. Example: 30 for T-Mobile (UK) (list of MCC/MNC) |
read | INTEGER DEFAULT '1' | read=0 if the call is an missed call, which hasn't been "read". Example there is a (number) on the Phone icon, showing number of missed calls. read=1 if the missed calls has been checked. |
assisted | INTEGER DEFAULT '0' | ? |
face_time_data | BLOB | ? |
originalAddress | TEXT DEFAULT '' | ? |
Note: name, country_code, network_code where added in iOS 5, while read, assisted, face_time_data, originalAddress where added in iOS 6.