Fax detection confusion with Sangoma A200 card

So here’s the scenario. We’ve got two POTS lines coming into a Sangoma A200 FXO module. We then have a second FXS module on the same base board which is hooked directly to the fax machine. The thought here was to simply faxdetect incoming calls before the welcome message is played, then redirect any faxes directly to the fax machine. For outgoing faxes, I was planning on simply dialing the Dahdi FXO group. This all seems to be a relatively simple idea, but in practice I’ve had plenty of issues.

First off, a sample of what my dialplans look like…


exten => _[1-3],1,Set(fromoutside=1)
exten => _[1-3],n,Goto(default,100${EXTEN},outside)
exten => 4,1,Goto(roundrobin,s,1)

exten => s,1,Answer
exten => s,2,Ringing
exten => s,3,Wait(10)
exten => s,4,Set(attempts=0)
exten => s,5,Background(mrfence-intro)
exten => s,n,WaitExten(10)

exten => fax,1,Dial(Dahdi/g1/${EXTEN},60)
exten => fax,n,Hangup

I have both of my FXO channels in g1 and their context is set to [from-zaptel]. I have them both set to ‘faxdetect=incoming’.

exten => _X.,1,Answer
exten => _X.,n,Wait(2)
exten => _X.,n,Dial(Dahdi/g1/${EXTEN})
exten => _X.,n,Hangup

I have my FXS channel’s context set to ‘from-fax’ with fax detection off. I also have TDMV_HW_FAX_DETECT turned on in my wanpipe1.conf. Incoming faxes are being detected properly and redirected (and delivered) to the fax machine. However, outgoing faxes are somehow making into the fax extension in [from-zaptel]. This does NOT happen if I turned off the hardware fax detection on the Sangoma card. I then figured I’d turned outgoing fax detection on for the FXS channel to ensure I grab it in the right context. This however, also does not work, as it seems for outgoing faxes, the originally dialed extension gets lost and there’s no way for me to dial the fax number to the POTS line. For example:

exten => _X.,1,Answer
exten => _X.,n,Wait(2)

exten => fax,1,Dial(Dahdi/g1/${EXTEN})
exten => fax,n,Hangup

EXTEN now equals fax. Is there anyway at this point to retrieve the dialed number. Any magic variables that are made available once Asterisk has jumped to the fax extension? Like I mentioned earlier, none of this is a problem if I disable the Sangoma hardware fax detection. However, in testing, I’ve found it to far more reliably detect faxes that just using the built in Asterisk fax detection.

I’d greatly appreciate any assistance on this matter.



The dialed number is never retrieved from analog trunks; they always end up at the s extension, or if a fax is detected, at the fax extension.

Has your hardware vendor been of assistance?

Thanks for the response. I figured this was more of an Asterisk question than a Sangoma support query. I’ll go ahead and ask them about this though. It seems odd to me that regardless of the faxdetect setting for my FXO channels (incoming,outgoing), my outgoing fax gets thrown into the fax extension.