Adding support to record the call history in the sqlite3 database.
This is a provisional change. I will have to clean up the code and
manage the database connection in a better way.