[asterisk-bugs] [Asterisk 0010815]: [patch] SendFAX/ReceiveFAX

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Nov 2 17:42:30 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10815 
====================================================================== 
Reported By:                dimas
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10815
Category:                   Applications/NewFeature
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-24-2007 04:57 CDT
Last Modified:              11-02-2007 17:42 CDT
====================================================================== 
Summary:                    [patch] SendFAX/ReceiveFAX
Description: 
sendfax/receivefax applications are replacement for well known txfax/rxfax.
These are based on the same idea and also use SpanDSP GPL library by Steve
Underwood.

I hope these can be included in basic Asterisk distribution (or to addons)
just to make it easier for people obtaining fax support for Asterisk. Also,
this implementation fixes couple of bugs in applications which prevented me
using txfax/rxfax out of the box.

Notes:
* receivefax does not allow specifying %d in the file name. To me, it is
up to dialplan to form really unique file name.
* debug and answering/calling mode options are specified in a way
different from txfax/rxfax
====================================================================== 

---------------------------------------------------------------------- 
 dimas - 11-02-07 17:42  
---------------------------------------------------------------------- 
Ok, it took a bit longer but here is the new version. 

New version available in 3 different alternatives:
* v2-app_fax.c - just the new version of app_fax.c for these who already
have makefile/configure/etc patched
* v2-app_fax.c.patch - is just a unified diff of app_fax.c for those who
want to see changes (or to apply them)
* v2-full.patch - the full patch to be applied to freshly checked out
asterisk-addons trunk (updated for latest trunk revision)

The only significant change is adition of requested FAXSTATUS+FAXERROR
variables which are set by the application. Dialplan may check these in
order to do something in case of success/failure. After some thought and
advices from other people on asterisk-dev list I made the application to
work the following way:

* If fax is sent ok, application sets FAXSTATUS=SUCCESS and returns
successfully (dialplan execution continues)
* If there were some problems with the fax data (no fax for example) but
the channel still up and ok, application sets FAXSTATUS=FAILED and returns
successfully (dialplan execution continues)
* If there are problems with channel (like user hangup), application sets
FAXSTATUS=FAILED and returns -1 which makes Asterisk to immediately abort
dialplan execution.

Note that in the last case, dialplan code immediately following
SendFAX/ReceiveFAX won't be executed. If you wamt to perform some action in
any failure including channel hangup, you better not placing the code after
the SendFAX/ReceiveFAX but place it in the 'h' extension instead. This
extension gets executed on the hangup. You will have access to all FAX*
variables there.

Something like:

[faxcontext]
exten = 100,1,ReceiveFAX(.......)
exten = 100,n,Hangup

exten = h,1,Noop(This will be executed regardles fax received Ok or user
hung up)
exten = h,n,Noop(FAXSTATUS = ${FAXSTATUS})

(Note that you may need to update Asterisk trunk to 88209 in order to make
'h' extension working - see issue 11146)

I encourage everrybody interested to test new version. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-02-07 17:42  dimas          Note Added: 0073041                          
======================================================================




More information about the asterisk-bugs mailing list