FreePBX 2.6, NVFax Detection, Asterisk 1.6.1.6 and Digium FAX - Working!

I got the Digium fax receiving faxes now - was simple enough thanks to Gregs instructions. (on asterisk 1.6.1.10 FreePBX 2.6.)

Does anyone have any examples for sending a file out, and emailing the sender back the status report? I’ve successfully faxed out a .ps file using a call file in the /var/spool/asterisk/outgoing folder. I’m thinking I could try and accomplish this with either an email to fax gateway or perhaps an smb shared printer on the asterisk server that writes ps to a directory, and then processes the fax from there.

I have this mostly working now, but am fighting an issue when sending a fax out, and I’m getting two email notices.
http://www.freepbx.org/forum/freepbx/users/call-files-to-send-fax-out-via-new-context#comment-22739

Once I get that sorted, I could post up my “recipie” but it really wouldn’t work without the pointers Greg started in this thread.

[macro-faxreceive]
exten => s,1,Set(FAXFILE=${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)
exten => s,2,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,3,ReceiveFAX(${FAXFILE})
exten => s,103,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,104,Goto(3)

There’s the fixed code. I was pulling my hair out trying to figure this out until I looked at the debug log.

Greg, Brock, and Others that contributed firstly thanks for the leg work.

Second, Greg did you ever get a chance to make that How-To you were working on as of November 20th, 2009? If so can you post a fresh link in this thread?

Thank you,

Daave

I have some experiencing in sending faxes out with asterisk, I did some testing on 1.4 and 1.6 and even worked a little on integration with the ARI for this purpose at my job, but that ended up going nowhere.

I might be willing to create a project for this. I could make a back-end server for managing a fax queue and handling format conversion, fax sending and email notification. I would need someone else to work on the gui and portal side.

How much interest is there for something like this?

Hi there

I hope someone can help me. I am very new to FreePBX and not very skilled with Linux. So I feel a bit out of my depth.

I have buil myself a vanilla PIAF with the latest available version. The output below is the output of my status screen

  • Running Asterisk Version : Asterisk 1.6.2.6
  • Asterisk Source Version : 1.6.2.6
  • Dahdi Source Version : 2.2.1+2.2.1
  • Libpri Source Version : 1.4.10.2
  • Addons Source Version : 1.6.2.0
    CentOS release 5.4 (Final) :32 Bit Kernel: 2.6.18-164.15.1.el5

Everything is working fine, even the Cisco 3911 Handset that I have, with one exception. I cannot get fax to work.

I tried to follow the instructions at the head of this post, but not sure that I did it properly. The result was that when I set the fax options, any inbound call gets NU tone (form the network).

I also tried the suggestions at http://nerdvittles.com/index.php?p=237. Both gave me the same outcome.

The asterisk trace of the calls is below;
pbx*CLI>
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [0390175566@from-sip-external:1] NoOp(“SIP/engin-00000003”, “Received incoming SIP connection from unknown peer to 0390175566”) in new stack
– Executing [0390175566@from-sip-external:2] Set(“SIP/engin-00000003”, “DID=0390175566”) in new stack
– Executing [0390175566@from-sip-external:3] Goto(“SIP/engin-00000003”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/engin-00000003”, “1?from-trunk,0390175566,1”) in new stack
– Goto (from-trunk,0390186655,1)
– Executing [0390186655@from-trunk:1] NoOp(“SIP/engin-00000003”, “Catch-All DID Match - Found 0390186655 - You probably want a DID for this.”) in new stack
– Executing [0390186655@from-trunk:2] Goto(“SIP/engin-00000003”, “ext-did,s,1”) in new stack
– Goto (ext-did,s,1)
– Executing [s@ext-did:1] Set(“SIP/engin-00000003”, “__FROM_DID=s”) in new stack
– Executing [s@ext-did:2] ExecIf(“SIP/engin-00000003”, “0 ?Set(CALLERID(name)=0395256688)”) in new stack
– Executing [s@ext-did:3] Set(“SIP/engin-00000003”, “FAX_RX=system”) in new stack
– Executing [s@ext-did:4] Set(“SIP/engin-00000003”, "[email protected]") in new stack
– Executing [s@ext-did:5] Answer(“SIP/engin-00000003”, “”) in new stack
– Executing [s@ext-did:6] PlayTones(“SIP/engin-00000003”, “ring”) in new stack
== Spawn extension (ext-did, s, 6) exited non-zero on ‘SIP/engin-00000003’

It would seem that whatever module the system is trying to pass to, to answer the call, is not present.

Is there a real dummies step by step procedure I can follow to get this going?

A step by step “type this command” then and “type this other command”, given my almost total lack of confidence in my linux skills would be great.

Thanks

Anthony

Here’s a guess that might be confirmed if you check the Asterisk logs.

These last two lines:

-- Executing [s@ext-did:6] PlayTones("SIP/engin-00000003", "ring") in new stack
== Spawn extension (ext-did, s, 6) exited non-zero on 'SIP/engin-00000003' 

Tells me it dies right after the PlayTones and the log will tell you why it dies.

My speculation, you are trying to execute NVFaxDetect() on a system that does not have that that installed.

Now with all the above versions, you failed to mention what you are using with FreePBX but I will venture to guess from the dialplan that it is something prior to 2.7 and if that is the case, then FreePBX won’t stop you form configuring this detection option. Later versions will.

So once again, the above is speculation on my part, go find out in the log why the call hangs up at that moment, that will be the first clue.

(If my speculation is correct, you may just want to upgrade to FreePBX 2.7 and take advantage of the SIP FAX detection which is available in Asterisk 1.6.2.X.)

Philippe

Thanks for your guesses. Yes I am running FreePBX 2.5. I found that if I changed the FaxDetect to ZAP, the system answered and waited, as shown below, but also threw up a warning regarding the Comfort noise. After the wait it went through to the extension, as expected.

[2010-05-10 08:26:37] VERBOSE[6218] pbx.c: – Executing [s@ext-did:6] Wait(“SIP/engin-00000000”, “5”) in new stack
[2010-05-10 08:26:40] NOTICE[6218] rtp.c: Comfort noise support incomplete in Asterisk (RFC 3389). Please turn off on client if possible. Client IP: 203.161.164.69
[2010-05-10 08:26:42] VERBOSE[6218] pbx.c: – Executing [s@ext-did:7] Set(“SIP/engin-00000000”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack

I figured at this point to give up on 2.5 and take your advice and upgrade to v2.7 (though 2.6) using the module admin tools.

I went through the Upgrade pulling down the 2.6 upgrade tool, and then upgrading a module at a time starting with the FreePBX framework. Now all modules are 2.6, but FreePBX now cannot communicate with Asterisk. When I do a reload it times out and presents the following message.

Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…Mon, 10 May 2010 21:30:05 +1000 - Unable to connect to manager 127.0.0.1:5038 (110): Connection timed out
FAILED
[FATAL] Asterisk Manager Connection Failure Failed to connect to the Asterisk manager through port: 5038

If I login to Asterisk using putty and watch the exchange that way I see no indication that asterisk received any communication from FreePBX. Netstat shows a tcp listener on port 5038.

Is there something simple I have broken or overlooked during the upgrade?

Thanks

Anthony

I started again, I have rebuilt and successfully upgraded to FreePBX 2.7. I will try the fax with the new version.

Anthony

I believe this to be appropriate to this thread, but don’t hesitate to disabuse me of that notion.

I am trying to get inbound fax detection to work on a client PRI trunk. I caught the RxFax for ReceiveFax problem, and also the fact that the arguments for NVFaxdetect seem to have changed in the most recent release (from n|t to n,t where n=delay for detection). The client has a DID setup for all user extensions, and in the current version (FreePBX 2.5 and Asterisk 1.4) this works fine. In the updated version (FreePBX 2.6 and Asterisk 1.6), inbound calls over the SIP trunk get dumped into a context that runs NVFaxdetect just fine. However, if the same orginator calls the same extension using a DID inbound route over the client PRI, NVFaxdetect doesn’t run initially and fax detection seems to happen only after the destination extension rings, timesout, and goes to voicemail.

So, I changed the context for the PRI to from-pstn from from-zaptel, but saw no difference. I would appreciate some hints on where I should be looking for answers to this issue, particularly since the client has indicated that this is a show stopper feature that must work in the updated server.

Thanks in advance…

Your article just kept me from losing a client. I did the initial install counting on FFA to detect faxes. It was a mess and detected 1 out of 10 faxes at best.

At the 11th hour, I read the original post and installed NVfaxdetect. Bingo!!!,…just like that I went 10 for 10 on inbound faxes from 1 to 15 pages coming in on a pots line from soft and hard fax systems, and redirected to a sip extension with a cheap ATA (ht286) and HP 8500 pro, touch screen, all-in-one fax machine.

I had previously tamed the cheap ATAs as long as the lines were copper but never had to detect and redirect on a shared line.

SpanDSP and NV made it work and I thank god I didn’t pay for an FFA license and support.

My next side project is to get inbound fax to email working with SSMTP. SSMTP is perfect for update notices and voice mail to email but the FreePBX fax stuff doesn’t seem to like it.

You were the hero of the day sir and again I thank you for sharing your knowledge.

What about trying this

Hi Moshe, I got my free FFA channel. Can’t make it work. I am using T.38 DIDs from VOIP Innovaitons. They work with Elastix no problem. On my 2.9 box, when I set T.38 passthrough to yes or no, and no fax detect on the incoming, and pass it to either an IAX or Virtual SIP, I get this:
[2011-09-05 08:19:46] NOTICE[6275]: pbx.c:4123 pbx_extension_helper: Cannot find extension context ‘’
[2011-09-05 08:19:46] WARNING[6275]: pbx.c:10244 pbx_parseable_goto: Priority ‘’ must be a number > 0, or valid label
== Spawn extension (from-trunk, fax, 1) exited non-zero on ‘SIP/VI-000000b7’
– Executing [h@from-trunk:1] Macro(“SIP/VI-000000b7”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/VI-000000b7”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)

It seems to answer the call but not know where to send it. ?