BUG: Incoming fax route to DAHDI extension

I don’t have privileges to create a ticket, so I’ll post this here and hope for the best.

I’m running PBX in a Flash, with Asterisk v1.6.1.12 and FreePBX v2.6.0.1. I have an analog fax machine (I know old school) going into a Wildcard TDM410P board and set to extension 117. When I would receive incoming faxes I saw this in the asterisk/full log.

{{{
[2010-01-19 10:48:37] VERBOSE[15017] app_macro.c: == Channel ‘DAHDI/7-1’ jumping out of macro ‘from-zaptel-7’
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [7063277795@from-trunk:1] NoOp(“DAHDI/7-1”, “Catch-All DID Match - Found 7063277795 - You probably want a DID for this.”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [7063277795@from-trunk:2] Goto(“DAHDI/7-1”, “ext-did,s,1”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Goto (ext-did,s,1)
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:1] Set(“DAHDI/7-1”, “__FROM_DID=s”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:2] ExecIf(“DAHDI/7-1”, “1 ?Set(CALLERID(name)=7704841827)”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:3] Set(“DAHDI/7-1”, “FAX_RX=117”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:4] Set(“DAHDI/7-1”, "[email protected]") in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:5] Answer(“DAHDI/7-1”, “”) in new stack
[2010-01-19 10:48:37] VERBOSE[15017] pbx.c: – Executing [s@ext-did:6] Wait(“DAHDI/7-1”, “5”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] chan_dahdi.c: – Redirecting DAHDI/7-1 to fax extension
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: == Spawn extension (ext-did, fax, 1) exited non-zero on ‘DAHDI/7-1’
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [fax@ext-did:1] Goto(“DAHDI/7-1”, “ext-fax,in_fax,1”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Goto (ext-fax,in_fax,1)
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [in_fax@ext-fax:1] StopPlayTones(“DAHDI/7-1”, “”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [in_fax@ext-fax:2] GotoIf(“DAHDI/7-1”, “0?3:analog_fax,1”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Goto (ext-fax,analog_fax,1)
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [analog_fax@ext-fax:1] GotoIf(“DAHDI/7-1”, “0?4:2”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Goto (ext-fax,analog_fax,2)
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [analog_fax@ext-fax:2] Set(“DAHDI/7-1”, “DIAL=ZAP/1”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [analog_fax@ext-fax:3] Dial(“DAHDI/7-1”, “ZAP/1,20,d”) in new stack
[2010-01-19 10:48:39] WARNING[15017] channel.c: No channel type registered for ‘ZAP’
[2010-01-19 10:48:39] WARNING[15017] app_dial.c: Unable to create channel of type ‘ZAP’ (cause 66 - Channel not implemented)
[2010-01-19 10:48:39] VERBOSE[15017] app_dial.c: == Everyone is busy/congested at this time (1:0/0/1)
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [analog_fax@ext-fax:4] Hangup(“DAHDI/7-1”, “”) in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: == Spawn extension (ext-fax, analog_fax, 4) exited non-zero on ‘DAHDI/7-1’
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [h@ext-fax:1] System(“DAHDI/7-1”, "/var/lib/asterisk/bin/fax-process.pl --to --from [email protected] --dest “s” --subject “Fax from 7704841827 7704841827” --attachment fax_7704841827.pdf --type application/pdf --file ") in new stack
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [h@ext-fax:2] Hangup(“DAHDI/7-1”, “”) in new stack
}}}

With the key part being:

{{{
[2010-01-19 10:48:39] VERBOSE[15017] pbx.c: – Executing [analog_fax@ext-fax:3] Dial(“DAHDI/7-1”, “ZAP/1,20,d”) in new stack
[2010-01-19 10:48:39] WARNING[15017] channel.c: No channel type registered for ‘ZAP’
[2010-01-19 10:48:39] WARNING[15017] app_dial.c: Unable to create channel of type ‘ZAP’ (cause 66 - Channel not implemented)
[2010-01-19 10:48:39] VERBOSE[15017] app_dial.c: == Everyone is busy/congested at this time (1:0/0/1)
}}}

I fixed it by adding the following you my /etc/asterisk/extensions_override_freepbx.conf file:

{{{
[ext-fax]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,StopPlayTones
exten => in_fax,2,GotoIf($["${FAX_RX}" = “system”]?3:analog_fax,1)
exten => in_fax,3,Macro(faxreceive)
exten => in_fax,4,Hangup
exten => analog_fax,1,GotoIf($["${FAX_RX}" = “disabled”]?4:2) ;if fax is disabled, just hang up
exten => analog_fax,2,Set(DIAL=${DB(DEVICE/${FAX_RX}/dial)});
; CHANGE ZAP TO DAHDI
exten => analog_fax,3,ExecIf($["${DIAL:0:3}" = “ZAP”]?Set(DIAL=DAHDI${DIAL:3}))
; END CHANGE
exten => analog_fax,4,Dial(${DIAL},20,d)
exten => analog_fax,5,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME},caller)
exten => out_fax,2,Hangup
exten => h,1,system(/var/lib/asterisk/bin/fax-process.pl --to ${EMAILADDR} --from ${FAX_RX_FROM} --dest “${FROM_DID}” --subject “Fax from ${URIENCODE(${CALLERID(number)})} ${URIENCODE(${CALLERID(name)})}” --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${FAXFILE});
exten => h,2,Hangup()
}}}

The line I added is between the ; CHANGE ZAP TO DAHDI comments. Hopefully this can be added to the correct places in the FreePBX code.

Hope this helps,

Jeremy

I just went into extensions definition and changed the default ‘dial’ from ZAP/3 to DAHDI/3. My version of freepbx (2.5) is still putting the ZAP name in and for some reason the ZAP2DAHDI compatibility does not work on the FAX route.

Now I am no longer getting the everyone is busy/congested for the FAX route-through.

if this issue exists on version 2.7 and above then please file a ticket in the tracker to have it looked at.