save messages with ip into DB