I'm trying to reliably detect whether there is a fax machine on an incoming channel.

Right now, it works nicely with the following dial plan:

       answer
       spandsp_start_fax_detect
       sleep 5000
       spandsp_stop_fax_detect
       [... no fax there, so now do stuff that has nothing to do with fax ...]

If the remote end is a PSTN fax, spandsp will fire an event upon detecting the CNG tone, and I will react accordingly.

However, if the remove end is a T.38 fax, which will immediately re-invite after answer, then the following problem occurs:

FreeSWITCH does not answer the re-invite (just says 100 Trying and nothing follows). Even though the remove end fax transmits the CNG tone afterwards, it is not detected by spandsp. I have recorded the call to make sure the CGN tone is there, and it is there. I have even played this tone into another phone call, where it is successfully detected by spandsp. All I can guess is that the non-answered re-invite might block spandsp from detecting the tone?

Greetings,
Roland