[asterisk-users] Transfer to fax

Mike Diehl mdiehl at diehlnet.com
Tue Mar 13 16:18:18 CDT 2012

So I'm still trying to get this to work... (I'm top posting, but the details 
are below, if you want/need background info)

I'd like Asterisk to detect incoming faxes and redirect them elsewhere.  The 
details aren't important, as long as I get the detection working. 

I've added this to my sip.conf file.  Probably overkill, but I'll tune it once 
it works:


My sip registrations are all in a Mysql RT database, so I added this column to 
my table:

faxdetect char(3) default 'no'

I've set faxdetect to 'yes' for the devices that I expect to be receiving fax 

I did a sip reload from the console after adding and updating this column.

I've added a fax extension to the appropriate context in extensions.conf:
exten => fax,1,noop(I hear a fax!)

Since most of my dialplan is in an AGI script, I've added this to the code 
that handles my test number:


So, now that all of this is in place, I call the extension from my fax 
machine... and I don't get any indication on the console that Asterisk heard a 
fax.  My extension simply rings and I answer it.

What am  missing?

Mike Diehl.

On Friday 24 February 2012 4:22:07 pm Kevin P. Fleming wrote:
> On 02/24/2012 05:20 PM, Mike Diehl wrote:
> > On Friday 24 February 2012 4:06:19 pm Kevin P. Fleming wrote:
> >> On 02/24/2012 05:00 PM, Mike Diehl wrote:
> >>> On Friday 24 February 2012 3:17:04 pm Mike Diehl wrote:
> >>>> On Friday 24 February 2012 2:39:48 pm Kevin P. Fleming wrote:
> >>>>> On 02/24/2012 03:32 PM, Mike Diehl wrote:
> >>>>>> Hi all,
> >>>>>> 
> >>>>>> I've got a user that has one phone number an wants to be able to us
> >>>>>> it for both voice and fax.
> >>>>>> 
> >>>>>> When a fax call comes in, he wants to do some incantation on the
> >>>>>> keypad and have the call go to the fax machine.
> >>>>>> 
> >>>>>> As I see it, he has 3 options.
> >>>>>> 
> >>>>>> 1.  (blind?) Transfer it to the fax extension.
> >>>>>> 
> >>>>>> 2.  Use features.conf to create a key sequence, say *2, to
> >>>>>> dial/transfer to a fax extension.
> >>>>>> 
> >>>>>> 3.  Use fax detect (SIP) to do it automatically.  However I'm also
> >>>>>> using FFA, so I suspect these are mutually exclusive.
> >>>>> 
> >>>>> They are not. Enabling faxdetect should do exactly what you want; it
> >>>>> will redirect the call to the 'fax' extension in the current context,
> >>>>> and you can then Dial() your FAX machine (or send the call to
> >>>>> ReceiveFAX).
> >>>> 
> >>>> Thank you.  Then, that's what I'll do.
> >>> 
> >>> On second though, I think my suggestion that FFA and fax detect were
> >>> mutually exclusive stemmed from the idea that a call that was being
> >>> originated/answered/handled by FFA would have it's call disconnected
> >>> and redirected by fax detect.
> >>> 
> >>> If this is the case, it changes my dial plan logic, and I'm not sure I
> >>> fully understand what changes I'll need to make.
> >>> 
> >>> For all I know, it might even simplify things by isolating all fax
> >>> handling in one block.
> >> 
> >> Well, first you should not have faxdetect enabled on outbound channels.
> >> That takes care of the 'originating' part.
> >> 
> >> If you have an inbound channel that you *know* you are sending to
> >> ReceiveFAX, then you can just disable faxdetect on that channel before
> >> doing so (this is why we made 'faxdetect' configurable from the
> >> dialplan). Alternatively, you can just let calls that you *know* are
> >> going to go to ReceiveFAX (dedicated FAX DIDs, for example) just 'idle'
> >> in the dialplan listening to silence until faxdetect kicks in and sends
> >> them to ReceiveFAX.
> >> 
> >> Note that the usage of FFA is not relevant here; whether you are using
> >> Fax for Asterisk, the free version of it, or res_fax_spandsp, the
> >> behavior and scenarios would be the same.
> > 
> > Very nice.
> > 
> > Sounds like I need to add a faxdetect column to my SIP real-time
> > configuration. Once I've done a sip reload or pruned/loaded my user
> > agents, I should be good to go!
> > 
> > Didn't know faxdetect was configurable in the dialplan...  Pointer to how
> > to do it?
> The CHANNEL() dialplan function with the 'faxdetect' option. Not sure
> which releases have it; it might only be Asterisk 10.


Take care and have fun,
Mike Diehl.

More information about the asterisk-users mailing list