Faxdetect not calling fax extension

Hi, I’m stumped.

I have a TDM400P with a line connected to the PSTN. In chan_dahdi.conf, the appropriate line has faxdetect=incoming. (I also tried both.) Voice calls are routed perfectly.

The dialplan, in relevant part, is:

[brandlilaw]

exten => s,1,Verbose(Incoming Call)
exten => s,n,Answer()
exten => s,n,Wait(5)
exten => s,n,Dial(SIP/71&SIP/72&SIP/73,20,t)
exten => s,n,Verbose(Hanging up)
exten => s,n,Hangup()

exten => fax,1,Verbose(Fax started)
exten => fax,n,Goto(fax-rx,receive,1)

No need to show you the fax-rx context because it never gets there. If a fax comes in, it is detected, but the fax extension is never called. (“Fax started” is never printed.) The debug output shows the following:

[Nov 7 21:13:02] DEBUG[5181]: dsp.c:590 tone_detect: 1100 Hz done detected
[Nov 7 21:13:02] DEBUG[5181]: chan_dahdi.c:1987 my_handle_dtmfup: DTMF digit: f on DAHDI/2-1
[Nov 7 21:13:02] DEBUG[5181]: chan_dahdi.c:2011 my_handle_dtmfup: Disabling FAX tone detection on DAHDI/2-1 after tone received
– Redirecting DAHDI/2-1 to fax extension
[Nov 7 21:13:02] DEBUG[5181]: channel.c:2576 ast_softhangup_nolock: Soft-Hanging up channel ‘DAHDI/2-1’
[Nov 7 21:13:02] DEBUG[5181]: pbx.c:4724 __ast_pbx_run: Spawn extension (brandlilaw,fax,1) exited non-zero on ‘DAHDI/2-1’
== Spawn extension (brandlilaw, fax, 1) exited non-zero on ‘DAHDI/2-1’
[Nov 7 21:13:02] DEBUG[5181]: channel.c:2576 ast_softhangup_nolock: Soft-Hanging up channel ‘DAHDI/2-1’
[Nov 7 21:13:02] DEBUG[5181]: channel.c:2704 ast_hangup: Hanging up channel ‘DAHDI/2-1’
[Nov 7 21:13:02] DEBUG[5181]: chan_dahdi.c:5935 dahdi_hangup: dahdi_hangup(DAHDI/2-1)
[Nov 7 21:13:02] DEBUG[5181]: sig_analog.c:1237 analog_hangup: analog_hangup 2
[Nov 7 21:13:02] DEBUG[5181]: sig_analog.c:1260 analog_hangup: Hangup: channel: 2 index = 0, normal = 1, callwait = 0, thirdcall = 0

So it appears to be calling my fax extension, but the first Verbose output is never shown. And, why is it “soft-hanging up” the channel before it ever calls the fax extension?

Any ideas? Any help greatly appreciated!

I should say that this is 1.8.0 with the very latest DAHDI and Digium’s free fax software. The fax software seems to be configured correctly.

Any help would be appreciated here! The fax software is working properly: If I stick a Goto(fax,1) right after the Answer in the dialplan, it gets the fax. It is only the fax detection that is not working. It appears to be trying to call the fax extension but none of the applications (including the first Verbose) gets called. I have fiddled with all of the DAHDI configuration parameters to no avail! I have no idea why this is happening!

Apparently this is a problem with the redirect function within Asterisk. When redirecting the calling channel, it hangs up the channel. One can see this by making a SIP-to-SIP call, and then redirecting the calling channel with the CLI command CHANNEL REDIRECT. See bugs.digium.com, issue #18299, and related issue #18185. There is a patch suggested, which seems to fix the problem. (Did for me.) But, the comment is that this is just a workaround.