Incoming fax call from FXO into FXS port

How can I setup inbound, outbound fax on Asterisk?

I want to do followings on Asterisk:

Fax call---->TDM400P FXO port---->TDM400P FXS port<----Fax machine

PSTN<------TDM400P FXO port<-----TDM400P FXS port<----Fax machine

Is it possible to do such scenario, configuration?

Is there any other scenario or configuration?

What can I need to do get work fax calls?

I am new to Asterisk world, just start to use it for SOHO, Enterprise PBX replacement.

If possible provide me stable working scenario, solution based on Asterisk.