I'm preplexed about fax issue :(

I have a client that wants to use their second line for inbound calling but also use it for faxes. I set it up to have a fax extension (302) and it rings that extension when faxes come in but faxes fail.

Looking in the logs it looks like it is calling /var/lib/asterisk/bin/fax-pro
cess.pl to handle the fax but I just want it to detect the fax and send it to the extension to process it. The client’s company has a policy against emailing faxes due to sensitive information so I can’t just put an amail address in the box. I’ve tried setting the fax detection type on the inbound route to None and Zaptel both behave the same way.

I’m on Asterisk 1.4.21.2 and FreePBX 2.5.1.0.
Can someone throw me a clue on what I’m doing wrong here???

Thank you!

JD

Here’s the snippet from asterisk -rvvvvvg with sensitive info XXX’d out:

– Executing [s@from-zaptel:1] NoOp(“Zap/10-1”, "Entering from-zaptel with DID == ") in new stack
– Executing [s@from-zaptel:2] Ringing(“Zap/10-1”, “”) in new stack
– Executing [s@from-zaptel:3] Set(“Zap/10-1”, “DID=s”) in new stack
– Executing [s@from-zaptel:4] NoOp(“Zap/10-1 [0;37;40m”, “DID is now s”) in new stack
– Executing [s@from-zaptel:5] GotoIf(“Zap/10-1”, “1?zapok:notzap”) in new stack
– Goto (from-zaptel,s,8)
– Executing [s@from-zaptel:8] NoOp(“Zap/10-1”, “Is a Zaptel Channel”) in new stack
– Executing [s@from-zaptel:9] Set(“Zap/10-1”, “CHAN=10-1”) in new stack

-- Executing [s@from-zaptel:10] Set("Zap/10-1", "CHAN=10") in new stack
-- Executing [s@from-zaptel:11] Macro("Zap/10-1", "from-zaptel-10|s|1") in new stack
-- Executing [s@macro-from-zaptel-10:1] NoOp("Zap/10-1", "Entering macro-from-zaptel-10 with DID = s and setting to: 480XXXXX58") in new stack
-- Executin    g [s@macro-from-zaptel-10:2] Set("Zap/10-1", "__FROM_DID=480XXXXX58") in new stack
-- Executing [s@macro-from-zaptel-10:3] Goto("Zap/10-1", "from-trunk|480XXXXX58|1") in new stack
-- Goto (from-trunk,480XXXXX58,1)

== Channel ‘Zap/10-1’ jumping out of macro ‘from-zaptel-10’
– Executing [480XXXXX58@from-trunk:1] Set(“Zap/10-1”, " ;35;40m__FROM_DID=480XXXXX58") in new stack
– Executing [480XXXXX58@from-trunk:2] Gosub(“Zap/10-1”, “app-blacklist-check|s|1”) in new stack
– Executing [s@app-blacklist-check:1] LookupBlacklist(“Zap/10-1”, “”) in new stack
– Executing [s@app-blacklist-check:2] GotoIf(“Zap/10-1”, “0?blacklisted”) in new stack
– Executing [s@app-blacklist-check:3] Return(“Zap/10-1”, “”) in new stack
– Executing [480XXXXX58@from-trunk:3] ExecIf(“Zap/10-1”, “1 |Set|CALLERID(name)=”) in new stack
– Executing [480XXXXX58@from-trunk:4] Set(“Zap/10-1”, “FAX_RX=302”) in newstack
– Executing [480XXXXX58@from-trunk:5] S et(“Zap/10-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [480XXXXX58@from-trunk:6] SetCallerPres(“Zap/10-1”, “allowed_not_screened”) in new stack
– Executing [480XXXXX58@from-trunk:7] Set(“Zap/10-1”, “_RGPREFIX=LPL”) in new stack
– Executing [480XXXXX58@from-trunk:8] Set(" ;40mZap/10-1", “CALLERID(name=LPL”) in new stack
– Executing [480XXXXX58@from-trunk:9] Goto(“Zap/10-1”, “ivr-7|s|1”) in newstack
– Goto (ivr-7,s,1)
– Executing [s@ivr-7:1] Set(“Zap/10-1”, “MSG=custom/LPL-IVR-1-2”) in new stack
– Executing [s@ivr-7:2] Set(“Zap/10-1”, “LOOPCOUNT=0 ;40m”) in new stack – Executing [s@ivr-7:3] Set(“Zap/10-1”, “__DIR-CONTEXT=default”) in new stack
– Executing [s@ivr-7:4] Set(“Zap/10-1”, “_IVR_CONTEXT_ivr-7=”) in new stack
– Executing [s@ivr-7:5] Set(“Zap/10-1”, “_IVR_CONTEXT=ivr-7”) in new stack
– Executing [s@ivr-7:6] GotoIf(" ;40mZap/10-1", “0?begin”) in new stack
– Executing [s@ivr-7:7] Answer(“Zap/10-1”, “”) in new stack
– Executing [s@ivr-7:8] Wait(“Zap/10-1”, “1”) in new stack
– Executing [s@ivr-7:9] Set(“Zap/10-1”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3
– Executing [s@ivr-7:10] Set(“Zap/10-1”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10
– Executing [s@ivr-7:11] Set(“Zap/10-1”, “__IVR_RETVM=”) in new stack
– Executing [s@ivr-7 :12] ExecIf(“Zap/10-1”, “1|Background|custom/LPL-IVR-1-2”) in new stack
– <Zap/10-1> Playing ‘custom/LPL-IVR-1-2’ (language ‘en’)
– Redirecting Zap/10-1 to fax extension
== Spawn extension (ivr-7, fax, 0) exited non-zero on ‘Zap/10-1’
– Executing [fax@ivr-7:1] Goto(“Zap/10-1”, “ext-fax|in_fax|1”) in new stack

-- Goto (ext-fax,in_fax,1)
-- Executing [in_fax@ext-fax:1] StopPlayTones("Zap/10-1", "") in new stack
-- Executing [in_fax@ext-fax:2] GotoIf("Zap/10-1      ", "0?3:analog_fax|1")

in new stack
– Goto (ext-fax,analog_fax,1)
– Executing [analog_fax@ext-fax:1] GotoIf(“Zap/10-1”, “0?4:2”) in new stack

-- Goto (ext-fax,analog_fax,2)
-- Executing [analog_fax@ext-fax:2] Set("Zap/10-1", "DIAL=SIP/302") in new stack
-- Executing [analog_fax@ext-fax:3] Dial("Zap/10-1     ", "SIP/302|20|d") in new stack
-- Called 302
-- SIP/302-09a391f0 is ringing

== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
– SIP/302-09a391f0 answered Zap/10-1
== Manager ‘admin’ logged off from 127.0.0.1
– Channel 10 echo canceler disabled due to CED detection
– Remote UNIX connection
– Remote UNIX connection disconnected
== Spawn extension (ext-fax, analog_fax, 3) exited non-zero on ‘Zap/10-1’
– Executing [h@ext-fax:1] System(“Zap/10-1”, "/var/lib/asterisk/bin/fax-pro
cess.pl --to --from [email protected] --dest “480XXXXX58” --subject “
Fax from LPL” --attachment fax_.pdf --type application/pdf --file ") in new stack
– Executing [h@ext-fax:2] Hangup(“Zap/10-1”, “”) in new stack
== Spawn extension (ext-fax, h, 2) exited non-zero on ‘Zap/10-1’
– Hungup ‘Zap/10-1’

I have also found fax to works reliably with a TDM card if the fax machine is hooked to an FXS port on the same TDM card. This works well with Sangoma cards with Hardware echo cancellation.

I’d just dedicate the line for fax if they didn’t want to have it serve as a an inbound voice line too. I first upgraded from Asterisk 1.4.18 to 1.4.22 since I figured the first answer would be to upgrade to the latest stable release (above 1.4.22 is the dahdi stuff… I can’t wait until Freepbx works with freeswitch!). I resist touching asterisk/zaptel/etc unless there is a problem to fix since they change things that break existing code. I upgraded zaptel,libpri, asterisk-addons…it didn’t help at all.

I noticed that the log had a bunch of “rtp.c: Unknown RTP codec 100 received from 192.168.1.98” in the log and figured maybe it was tring to do t.38 faxing so I went into the SPA to look for anything fax related. IS there an asterisk log analyzer out there? Trying to figure out what’s going on is like looking for a needle in a haystack!

What seems to be working so far was to turn off every fax related setting in the SPA2000 (fax detect and fax passthru) and to lower the fax speed from high to Normal. Faxes that previously failed now succeed! I’m not positive that turning this off fax detect/passthru and forcing it to use 711u was what fixed things… it could have been lowering the fax speed too.

JD

He said they wanted to use the line for call also. So the problem with this approach is if the fax is sending and you need the second line FreePBX will grab the line and use it if it does not know it’s in use.

They make those smart boxes that will detect a call when it rings and of so re-direct the call to a fax if it “hears” fax tone and makes the pass through disabled. A better solution then splitting the line.

Since this is an analog line you should just take the FreePBX out of the mix for faxing.

Put a splitter on the that line before it hits the FreePBX box. Run one split to the FreePBX box and the other to fax machine. Set the fax machine to answer on zero rings. End of problem. You can send and receive faxes without issue and FreePBX can use that line for dialing out.

I just realized I didn’t tell all the details…
the fax machine is plugged into a SPA 2000.

It doesn’t fail all the time; in fact I can’t make it fail!
But the client gets failures whenever they fax to it.

JD

you don’t say what codec if any you are using. So that you know using anything except ulaw or alaw will give you poor results at best as all other codecs use compression. While the Human ear can’t hear the the small tone changes a fax machine can, it also has a very tight range it needs to get things within to be accepted.

Even if you are using a POTS line and ulaw/alaw you’ll only get about a 90% success rate. Faxing works by sending 0’s and 1’s using a specific tone range. If the sending fax is on the very high side of that tone range and the receiving end is listening on the very lower end it is possible that they will just simply miss and not work (or the other way around but you get the idea). Compression only makes this problem much worse.

The SPA2000 is set to use the 711u codec.
From it to the fax is a 30 foot run, to the asterisk server it’s 5 feet, pot lines coming in.

Even if you are using a POTS line and ulaw(711u)/alaw(711a) you’ll only get about a 90% success rate.

We have a remote office with a piece of crap fax machine that can’t send to us no matter what. But if I plug the fax into the line directly it works that is just the way it is.

Have you tried lowering it’s max speed to 9600 baud?

I realize this is a really old post, but, if someone runs across it like I did when Googling “ast_rtp_read: Unknown RTP codec 100 received”.

I found that on the SPA ATA’s, I get the “ast_rtp_read: Unknown RTP codec 100 received” notice when the FAX Passthru Method is set to NSE. T38 faxes still work fine for me even with the notice. You can change FAX Passthru Method to REINVITE and the notice goes away and T38 still works, however, I do notice lost packets when changing it from NSE to REINVITE.

For what it’s worth…

-Eric

Asterisk may call 100’s NSE

Event 100 is a Named Signalling Event. It’s not a payload packet.

Two ways to switch between a voice call and t.38, one is a SIP invite, the other is a named signalling event.

Are you sure when you say “missing packets” that the FAX is not being sent in audio mode instead of t.38 protocol?