List of incoming and outgoing calls

Hi everybody,

Forgive me in advance for my bad english.

I’m logging all calls details in a mysql table. I’d like to know how should I list all incoming and outgoing calls separatly ?

I’m running with asterisk 1.4.22

Thanks for your helps