Here is a very basic overview of what you’ll need to do. For more details check out www.voip-info.org.
1.) Setup a sip connection (sip.conf) with you SIP provider. Alternatively you could use IAX2 if you provider supports it. Most of the details of this will be dependant on your provider.
2.) Configure you E1 card with zaptel.conf and zapata.conf.
3.) Edit you extensions.conf file. Create a context where you incoming sip calls will be placed (make sure this is the same as in your sip.conf). Add an extension in that context for your incoming phone number. Have extension use the Dial command to dial out over the E1 card.
4.) If you don’t mind your cdr being written as a csv text file, then you don’t have to do anything to get the call records. If you want your cdr’s written to a database, then install one of the db cdr drivers. cdr_mysql, cdr_odbc, cdr_pgsql, …
Essentially that’s it. There are a ton of details missing, but you can find those on voip-info.org or any number of other Asterisk sites, or the Asterisk book (which is free). So there is no reason to repeat them here.