Identification of data calls & voice calls

Is there any facility to filter/identify the data calls and voice calls coming throug modem?
OR
Can we get the data or voice calls information through a script(preferably C Kermit)?