FFA Fax only works when "Detect Faxes" is set to No

OK, I have a bit of an odd problem here. I am running Elastix 2.0, with the latest updates for FreePBX 2.7, on top of Asterisk 1.6. Faxes come in via PRI through a Sangoma card with HW Fax detection enabled and chan_dahdi.conf set to faxdetect=incoming. I am using Free FAX for Asterisk (FFA).

I have created a Misc Destination that points to the “666” Receive Fax Feature Code. When I point an inbound route at that Misc Destination and leave “Detect Faxes” set to no, it works just fine. The fax is received and all goes well.

However, if I modify the inbound route to point to a SIP extension, then set “Detect Faxes” to yes, fax detection works (the call is sent to the fax extension), but FFA does not answer; I just hear dead air through the sending machine’s speaker. It does not seem to matter if I point it to the 666 feature code or the fax destination for that extension.

I noticed in one of these sessions, it looks like the system detected a fax and tried to send to the fax extension even after the “receiveFAX” application had been called. I saw the following lines (full output attached as “Log message”):

VERBOSE[29465] res_fax_digium.c: -- Channel 'DAHDI/1-1' FAX session '4' started NOTICE[29465] chan_dahdi.c: Fax detected, but no fax extension

What have I missed?

Tom

In the Incoming Route set the “FAX Detection Type” to SIP (Yes, you’re call is coming in on DAHDI).

My wanpipe1.conf excerpt:

TDMV_SPAN = 1 TDMV_DCHAN = 24 TDMV_HW_DTMF = NO TDMV_HW_FAX_DETECT = NO

and chan_dahdi.conf excerpt:

[channels] faxdetect=yes

This works for us on our PRI trunks.

I’m also a little confused about all of the fax detection settings out there.

1.) Sangoma HW_FAX_DETECT (sends an event to Dahdi, I think).
2.) chan_dahdi.conf fadetect= setting (redirects call to the fax extension)
3.) FreePBX Fax Detection as specified in the GUI

  • Specifically, how does #3 interact with #2?
  • If I disable fax detection in chan_dahdi.conf, will FreePBX ever be able to detect a fax?
  • If I have both on, will that result in the “double-detection” I posted above?
  • Should I be specifying a longer delay? (I have tried up to 8, IIRC).

I should note, too, that the “Fax detected, but no fax extension” error does not occur on every failed fax. Basically, I never hear the modem answer if I set “Detect Faxes” to Yes.

Tom

THis is the console output for a failed session:

[Jan 25 17:36:59] VERBOSE[17000] chan_dahdi.c: -- Accepting call from '6032284539' to '7246064' on channel 0/1, span 1 [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:1] Set("DAHDI/1-1", "__FROM_DID=7246064") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:2] Gosub("DAHDI/1-1", "app-blacklist-check,s,1") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [s@app-blacklist-check:1] GotoIf("DAHDI/1-1", "0?blacklisted") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [s@app-blacklist-check:2] Set("DAHDI/1-1", "CALLED_BLACKLIST=1") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [s@app-blacklist-check:3] Return("DAHDI/1-1", "") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:3] ExecIf("DAHDI/1-1", "1 ?Set(CALLERID(name)=6032284539)") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:4] Set("DAHDI/1-1", "__CALLINGPRES_SV=allowed") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:5] Set("DAHDI/1-1", "CALLERPRES()=allowed_not_screened") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:6] Set("DAHDI/1-1", "_RGPREFIX=Direct") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:7] Set("DAHDI/1-1", "CALLERID(name)=Direct6032284539") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [7246064@from-pstn:8] Goto("DAHDI/1-1", "ext-fax,108,1") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Goto (ext-fax,108,1) [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [108@ext-fax:1] NoOp("DAHDI/1-1", "Receiving Fax for: Thomas Rymes (108), From: "Direct6032284539" <6032284539>") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [108@ext-fax:2] Set("DAHDI/1-1", "[email protected]") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [108@ext-fax:3] Goto("DAHDI/1-1", "s,receivefax") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Goto (ext-fax,s,3) [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [s@ext-fax:3] StopPlayTones("DAHDI/1-1", "") in new stack [Jan 25 17:36:59] VERBOSE[29465] pbx.c: -- Executing [s@ext-fax:4] ReceiveFAX("DAHDI/1-1", "/var/spool/asterisk/fax/1295995019.141845.tif") in new stack [Jan 25 17:36:59] VERBOSE[29465] res_fax.c: -- Channel 'DAHDI/1-1' receiving FAX '/var/spool/asterisk/fax/1295995019.141845.tif' [Jan 25 17:36:59] VERBOSE[29465] res_fax_digium.c: -- Channel 'DAHDI/1-1' FAX session '4' started [Jan 25 17:37:01] NOTICE[29465] chan_dahdi.c: Fax detected, but no fax extension [Jan 25 17:37:25] NOTICE[29465] res_fax.c: Channel 'DAHDI/1-1' did not return a frame; probably hung up. [Jan 25 17:37:35] ERROR[29465] res_fax.c: channel 'DAHDI/1-1' FAX session '4' failure, reason: 'fax session timed-out' (TIMEOUT) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: == Spawn extension (ext-fax, s, 4) exited non-zero on 'DAHDI/1-1' [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [h@ext-fax:1] GotoIf("DAHDI/1-1", "1?failed") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (ext-fax,h,103) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [h@ext-fax:103] NoOp("DAHDI/1-1", "FAX FAILED for: [email protected] , From: "Direct6032284539" <6032284539>") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [h@ext-fax:104] Macro("DAHDI/1-1", "hangupcall,") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:1] GotoIf("DAHDI/1-1", "1?noautomon") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (macro-hangupcall,s,3) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:3] NoOp("DAHDI/1-1", "TOUCH_MONITOR_OUTPUT=") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:4] GotoIf("DAHDI/1-1", "1?noautomon2") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (macro-hangupcall,s,6) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:6] NoOp("DAHDI/1-1", "MONITOR_FILENAME=") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:7] GotoIf("DAHDI/1-1", "1?skiprg") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (macro-hangupcall,s,10) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:10] GotoIf("DAHDI/1-1", "1?skipblkvm") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (macro-hangupcall,s,13) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:13] GotoIf("DAHDI/1-1", "1?theend") in new stack [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Goto (macro-hangupcall,s,15) [Jan 25 17:37:35] VERBOSE[29465] pbx.c: -- Executing [s@macro-hangupcall:15] Hangup("DAHDI/1-1", "") in new stack [Jan 25 17:37:35] VERBOSE[29465] app_macro.c: == Spawn extension (macro-hangupcall, s, 15) exited non-zero on 'DAHDI/1-1' in macro 'hangupcall' [Jan 25 17:37:35] VERBOSE[29465] pbx.c: == Spawn extension (ext-fax, h, 104) exited non-zero on 'DAHDI/1-1' [Jan 25 17:37:35] VERBOSE[29465] chan_dahdi.c: -- Hungup 'DAHDI/1-1'