[asterisk-users] Receiving faxes with spandsp question

Kevin Larsen kevin.larsen at pioneerballoon.com
Thu Jun 25 11:50:54 CDT 2015


> I’m trying to add fax functionality to my asterisk installation. 
> Right now I’m focusing on receiving faxes. This is not explained in 
> a book, but I assume that I can use same context, add “fax” 
> extension and if someone calls to send fax - it will autodetect. Right?
> 
>  Per book, I made following setup additions:
> 
> 1. In sip.conf [general] I added:
> 
> ;FAX stuff
> faxdetect=yes
> t38pt_udptl=yes
> 
> 2. In extensions.conf I hade something like this:
> 
> [from-callcentric]
> exten => s,1,Goto(automated_attendant,s,1)
> 
> ; FAX handling stuff AS IN BOOK
> exten => fax,1,Verbose(3,Incoming Fax)
>         same => n,Set(FAXDEST=/tmp)     ; folder where faxes will be 
stored
>         same => n,Set(tempfax=${STRFTIME(,,%C%y%m%d%H%M)})
>         same => n,ReceiveFax(${FAXDEST}/${tempfax}.tif)
>         same => n,Verbose(3, - Fax receipt completed with status: $
> {FAXSTATUS})
> 
> Well, that didn’t work. Trying to send fax - it was going to my 
> autoattendant and never triggered fax. So, I made a change like so:
> 
> 3. Changed extensions.conf
> 
> [from-callcentric]
> ; FAX handling stuff AS IN BOOK
> exten => s,1,Verbose(3,Incoming Fax)
>         same => n,Set(FAXDEST=/tmp)     ; folder where faxes will be 
stored
>         same => n,Set(tempfax=${STRFTIME(,,%C%y%m%d%H%M)})
>         same => n,ReceiveFax(${FAXDEST}/${tempfax}.tif)
>         same => n,Verbose(3, - Fax receipt completed with status: $
> {FAXSTATUS})
> 
> I just made it fax handling context, and I got FAX :) !!!! But, 
> while fax was received I was getting following:
> 
> [2015-06-24 23:40:28] WARNING[47369][C-00000005]: res_fax_spandsp.c:
> 438 spandsp_log: WARNING T.30 ECM carrier not found
> 
> 
> QUESTIONS:
> 
> 1. Should I do something about this warning?
> 2. How do I receive fax and have main entry to auto attendant in a 
> same context? Can I have it on same puplic phone number?
> 

I think your problem may be that even though you created the exten => fax 
line, it never has a chance to auto detect and go there as it has already 
left that context before it has detected the fax and then has no fax 
extension to redirect to. You could put your fax extension in the 
automated_attendant context and that should work. I recommend a slightly 
different way of handling faxes.

What I did was create an incoming fax context (fax_incoming). In your 
above example, that is where the fax extension would live. That way I can 
handle my reception of faxes in one spot and if I ever need to bug 
fix/change my dialplan, I only have to do it in one spot. Then anywhere 
that I want to autodetect faxes and move them to the fax context I put the 
following extension code:

exten => fax,1,Goto(fax_incoming,${dialednumber},1)

Of course, if you don't want the comment in there, that could be reduced 
to just one line. Also, ${dialednumber} is just a variable I use to hold 
the originally dialed number in case it has been altered as it goes 
through my dialplan so that I can have my CDR records show what was 
originally dialed in case I need to go back later. In your example, you 
would replace ${dialednumber} with whatever you need to work with your fax 
handler. I have multiple fax numbers, so I like to know which one was 
dialed to reach that spot. Makes bookkeeping easier.

I have this working on my sites that use an IVR and based on the timing, 
it gets a few seconds into playing the ivr message usually before it 
detects the fax and redirects it to the proper fax context. I have 
separate fax numbers, but this does catch those who don't pay attention 
and dial the main number instead of the fax number. I also use it on the 
direct dials to my phones. When I get a fax that way, my desk phone will 
get about one ring before the fax is detected and the call is moved away.

Faxing can be finicky to get working how you want it, but you can usually 
make it handle the faxes like you want.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20150625/101f3f09/attachment.html>


More information about the asterisk-users mailing list