Asterisk 18 and faxdetect


I can enable incoming fax detection in DAHDI and PJSIP (also fax_detection_timeout). Whenever a fax is detected it is sent to:

exten => fax

The inbound context I’m using is something like this:

exten => fax,1,NoOp(PSTN: Incoming fax, caller ${CALLERID(all)})
exten => _X.,1,NoOp(PSTN: Incoming route ${EXTEN}, caller ${CALLERID(all)})

I know I can Set a custom variable to ${EXTEN} and retrieve it within “fax” and pass it to ReceiveFax because I would like to construct the TIFF file name with that data.
However, how can I be sure the dialplan will actually set that variable if there’s fax autodetection?
Will it not go to “fax” too early?
Is the “called number” available in “fax”?

The FAXEXTEN dialplan variable is set to the original called number. The channel will only jump to the fax extension after a period of time when the CNG tone has been detected.

Thanks, so it would have to be something more like this?

exten => fax,1,NoOp(PSTN: Incoming fax for ${FAXEXTEN}, caller ${CALLERID(all)})
exten => _X.,1,NoOp(PSTN: Incoming route for ${EXTEN}, caller ${CALLERID(all)})
same => n,Answer(3000)

That is, hoping 3 seconds is enough for fax detection.

Any better way?

[EDIT] Answer or Wait?

In order to receive audio you probably have to answer. I don’t have any comments on duration and such. Fax isn’t my thing.

It’s not enough to guarantee detection if there is any chance of the first cycle being clipped, as the silence period between tones is, itself, 3 seconds.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.