I've done this using FreePBX back in the day. Telco trunk was PRI and we had a fax machine connected to the ATA. Result was that about 90% of faxes worked, but 10% were a no go. It seemed to be site dependent as to which faxes would fail...