In RFC2833, support for relaying modem connect tones (CNG, [/]ANS[am] and co) is optional, and relatively few implementations support them. [...] Also CNG and ANS are not generated or generated incorrectly by many fax machines, you need to look for V.21H HDLC flags, or even T.30 data in the HDLC frames, to know for sure that it's a fax.
Alright, I guess that from an application perspective, developers generally are not really trying to do fax detection. They are only trying to differentiate between a "human" and a fax machine (or modem). So I guess "fax detection" in that relaxed sense can be summarized as: - on an attached audio channel (AUDIO_MODE), did we detect CNG, ANS*, or anything that would make the software switch to fax-relay mode -- I would assume there's some kind of event that spandsp generates in that case(?); - on a SIP/H.323 channel supporting T.38, did a switch-over to T.38 occur. - (any other channel mode?) (Not that I want to drag the discussion any further if nobody cares about it.) S.