Fax for 4 telephone lines

Hi. I have to configure the asterisk to receive faxes using 4 phone lines and send it by mail to different addresses for each phone line.
Can I determine the status of a line? If detect a fax signal, send it to an extension or if it is a call that follows the corresponding call plan?

Thank you,