Discussion: app_rxfax and app_txfax

Comments Filter

Problem with rxfax && post receipt printing


asterisk-1.4.17
spandsp-0.0.4-pre18
agx-ast-addons-1.4.5
zaptel-1.4.9.2
libpri-1.4.3
asterisk-addons-1.4.6

Compiled && installed w/o issue

This USED to work w/1.2 && older versions of rxfax:

[co2]
exten => s,1,NoOp(Inbound Call)
exten => s,2,NoOp(CALLERID=${CALLERID})
exten => s,3,Set(_menu=menu-000)
exten => s,4,Goto(fax,90)

; Queue and print
exten => fax,90,Set(FAXFILE=/var/spool/asterisk-fax/${UNIQUEID}.tif)
exten => fax,91,rxfax(${FAXFILE})
exten => fax,92,NoOp(REMOTESTATIONID ${REMOTESTATIONID})
exten => fax,93,NoOp(FAXPAGES ${FAXPAGES})
exten => fax,94,NoOp(FAXBITRATE ${FAXBITRATE})
exten => fax,95,NoOp(FAXRESOLUTION ${FAXRESOLUTION})
exten => fax,96,System(/usr/local/bin/printfax -p ${FAXPAGES} -r ${FAXRESOLUTION} ${FAXFILE})
exten => fax,97,NoOP(Fax Complete)
exten => fax,98,NoOP
exten => fax,99,Hangup


Now When the fax is done I don't get the printfax to run . . . (from the log):

[Apr  9 11:51:44] VERBOSE[12856] logger.c: [Apr  9 11:51:44]     -- Starting simple switch on 'Zap/4-1'
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [s@co2:1] NoOp("Zap/4-1", "Inbound
 Call") in new stack
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [s@co2:2] NoOp("Zap/4-1", "CALLERI
D=") in new stack
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [s@co2:3] Set("Zap/4-1", "_menu=me
nu-000") in new stack
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [s@co2:4] Goto("Zap/4-1", "fax|90"
) in new stack
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Goto (co2,fax,90)
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [fax@co2:90] Set("Zap/4-1", "FAXFI
LE=/var/spool/asterisk-fax/1207756304.353.tif") in new stack
[Apr  9 11:51:45] VERBOSE[12856] logger.c: [Apr  9 11:51:45]     -- Executing [fax@co2:91] RxFAX("Zap/4-1", "/va
r/spool/asterisk-fax/1207756304.353.tif") in new stack
[Apr  9 11:51:45] DEBUG[12856] chan_zap.c: Took Zap/4-1 off hook
[Apr  9 11:51:45] DEBUG[12856] chan_zap.c: Engaged echo training on channel 4
. . . <blah,blah>
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Fax successfully received.
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Remote station id: 
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Local station id:  
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Pages transferred: 4
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Image resolution:  8031 x 3850
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Transfer Rate:     14400
[Apr  9 11:52:56] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: ===================================
===========================================
[Apr  9 11:52:58] DEBUG[12856] /usr/src/asterisk/agx-ast-addons/app_rxfax.c: Got hangup
[Apr  9 11:52:58] VERBOSE[12856] logger.c: [Apr  9 11:52:58]     -- Hungup 'Zap/4-1'
[Apr  9 12:04:40] VERBOSE[12857] logger.c: [Apr  9 12:04:40]     -- Starting simple switch on 'Zap/4-1'

PHHHT. Huk!


From an older log:
[Oct 11 10:09:14] DEBUG[4959]: Fax successfully received.
[Oct 11 10:09:14] DEBUG[4959]: Remote station id: Mortgage Services   
[Oct 11 10:09:14] DEBUG[4959]: Local station id:  
[Oct 11 10:09:14] DEBUG[4959]: Pages transferred: 1
[Oct 11 10:09:14] DEBUG[4959]: Image resolution:  7700 x 3850
[Oct 11 10:09:14] DEBUG[4959]: Transfer Rate:     9600
[Oct 11 10:09:14] DEBUG[4959]: ==============================================================================
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "REMOTESTATIONID Mortgage Se
rvices   ") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "FAXPAGES 1") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "FAXBITRATE 9600") in new st
ack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "FAXRESOLUTION 3850") in new
 stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing System("Zap/4-1", "/usr/local/bin/printfax -
p 1 -r 3850 /var/spool/asterisk-fax/1192111704.363.tif") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "Fax Complete") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing NoOp("Zap/4-1", "") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]     -- Executing Hangup("Zap/4-1", "") in new stack
[Oct 11 10:09:14] VERBOSE[4959]: [Oct 11 10:09:14]   == Spawn extension (co2, fax, 99) exited non-zero on 'Zap/4
-1'


I'm at a loss, I can think of a few work-arounds, but this must have something to do with a change in asterisk on a hangup. Processing stops now? Perhaps an explicit off-hook is needed. Any insight useful.

by ksmithaz1, Monday 11 of June, 2012 (04:07:19 UTC)
Newer information

There is a newer package with installation instructions. I've never had any success with the instructions on this page with the latest versions of asterisk (>=1.4). If you don't have any luck with this stuff try AGX's Asterisk Extra AddOns instead and ignore the instructions above.

by pcrane, Wednesday 05 of March, 2008 (11:40:10 UTC)
Asterisk 1.4.4, spandsp 0.0.3

And another experience:
Asterisk 1.4.4, spandsp 0.0.3, Debian 4.0 etch, libtiff, autconf (2.61-4) and automake from the standard Debian 4.0 archive.

Don't remember how exactly i compiled spandsp, but for Asterisk 1.4.2 and Asterisk 1.4.4, i didn't do autconf in
autoconf
./bootstrap.sh
./configure
make menuselect
just boststrap.sh in a FRESH unzipped asterisk-1.4.x dir was enough.
I use the app-r/tx.c files from January 2007, the latest are from June 2007, haven't tested them.
If you have problems, also check, if app_t/rxfax.so are linked against libspandsp and libtiff (with ldd apps/app_rxfax.so)

Edit /BTW: Haven't had the problem that Leonardo reported.


by cibi, Wednesday 04 of July, 2007 (18:32:23 UTC)
rxfax and txfax with Asterisk 1.4.4

First of all, thanks Ray Collett for the tips.

I've compiled it exactly as Ray's comment below, but with a bit difference when re-creating the Makefile with bootstrap.sh

I'm using:
Asterisk 1.4.4
SpanDSP 0.0.3: http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.3.tgz

Hint: The autoconf 2.6 or above and automake are essentially.

Do the same things that Ray said below, then after run ./bootstrap.sh, it re-creates the configure file, but it merge the SPEEX and SPANDSP session incorrectly. So, open the configure, find the SPANDSP session (below the RADIUS), then remove everything from SPANDSP and SPEEX (there are lot of things repeated). The clean code is this:

SPANDSP_DESCRIP="spandsp Library"
SPANDSP_OPTION="spandsp"

if test "${with_spandsp+set}" = set; then
withval=$with_spandsp;
case ${withval} in
n|no)
USE_SPANDSP=no
;;
y|ye|yes)
SPANDSP_MANDATORY="yes"
;;
  • )
SPANDSP_DIR="${withval}"
SPANDSP_MANDATORY="yes"
;;
esac

fi

PBX_SPANDSP=0





SPEEX_DESCRIP="Speex"
SPEEX_OPTION="speex"

if test "${with_speex+set}" = set; then
withval=$with_speex;
case ${withval} in
n|no)
USE_SPEEX=no
;;
y|ye|yes)
SPEEX_MANDATORY="yes"
;;
  • )
SPEEX_DIR="${withval}"
SPEEX_MANDATORY="yes"
;;
esac

fi

PBX_SPEEX=0


Now just continue with ./configure and the next steps.

by leo_lns, Friday 18 of May, 2007 (02:41:25 UTC)
Re: rxfax and txfax with Asterisk 1.4.2

Ray, did you tested sending/receiving a fax?
I followed your instructions; compiling was ok, but when invoking rxfax asterisk instantly dies...

by ojaksch, Tuesday 24 of April, 2007 (11:26:20 UTC)
rxfax and txfax with Asterisk 1.4.2

I spent about 5 hours today trying to get this all to work. Here is the process that I used to get it to install:<BR>
(using an older Fedora 3 i686 system)<BR><BR>

wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.2.tar.gz<BR>
wget http://www.soft-switch.org/downloads/snapshots/spandsp/spandsp-20070413.tar.gz<BR>
wget http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_rxfax.c<BR>
wget http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_txfax.c<BR>
wget http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/asterisk.patch<BR><BR>

tar -zxvf spandsp-20070413.tar.gz<BR>
cd spandsp-0.0.4<BR>
make uninstall<BR>
make clean<BR>
autoconf<BR>
./configure<BR>
make<BR>
make install<BR><BR>

tar -zxvf asterisk-1.4.2.tar.gz<BR>
cd asterisk-1.4.2<BR>
cp ../asterisk.patch .<BR>
cp ../app_rxfax.c apps/<BR>
cp ../app_txfax.c apps/<BR><BR>

(at this point, you SHOULD be able to do "patch -bp0 < asterisk.patch", but the patch is partially broken. Look at the asterisk.patch and you'll see several different sections where the patch looks for one block of text in a certain file, then inserts the lines that starts with the "+". You need to manually add the lines with the "+" character into the spots that the patch file point to. Remember to remove the "+" from the beginning of the line.)<BR><BR>

cp /usr/local/include/spandsp/plc.h include/asterisk/plc.h<BR><BR>

(I had to copy the plc.h that was installed from the spandsp into the asterisk folder to get around some error messages)<BR><BR>

make clean<BR>
autoconf<BR>
./bootstrap.sh<BR>
./configure<BR>
make menuselect<BR><BR>

(at this point, check to see if the app_txfax and app_rxfax are selected. It should not be marked as unavailable, ie., no XXX's)<BR><BR>

make<BR>
make install<BR><BR>

If it compiles without error, If it does not coredump when you run asterisk, you should be able to see usage information from the console by running these commands:<BR>
core show application RxFax<BR>
core show application TxFax<BR><BR>

I had to manually upgrade my autoconf, because there are no RPM's for autoconf 2.6 or newer.<BR><BR>

Ray


by rcollett, Tuesday 24 of April, 2007 (00:19:54 UTC)
State consult

Here there is another patch, but for different purposes. This patch allows to consult the successfully state of the transmitted fax, the status is show in the variable "RESULTADO". To apply the patch:

  1. patch app_txfax.c < app_txfax.patch

The complete post is here.</p>

by highwayman, Wednesday 07 of March, 2007 (08:56:29 UTC)
rxfax and txfax vs. Asterisk 1.4

OK. To answer my own question, I found an updated app_rxfax.c, app_txfax.c and a patch file for asterisk 1.4 in http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4. The patch must be for a beta of 1.4 as it didn't quite work (patch -p0) but it was easy enough to figure out how to fix the issues. Then I did a ./configure; make; make install and the modules were copied to /usr/lib/asterisk/modules. Note that the patch does not attempt to patch menuselect so there is no fax entry when you do a make menuselect.

by ChicagoBud, Wednesday 21 of February, 2007 (17:45:27 UTC)
rxfax and txfax vs. Asterisk 1.4

Can someone update the instructions for compiling with Asterisk 1.4?

by ChicagoBud, Tuesday 20 of February, 2007 (23:32:42 UTC)
Zap channel lockups, requiring complete reboot

OK, I have been fighting with this for a couple of weeks now. My config is:
- debian 3.1r2 (kernel 2.4.27)
- libtiff 3.7.2-7 (apt-get install libtiff4 libtiff4-dev)
- Asterisk 1.2.13
- Zaptel 1.2.10
- Libpri 1.2.4
- spandsp 0.0.2pre25

I was able to get a clean compile, but any time the rxfax command is executed, there is no sound, no modem tones, nothing at all generated. I'm expecting it to generate a modem tone to the calling fax machine, right?

After it times out, the incoming Zap channel is locked hard, no incoming calls possible, only recourse is a complete reboot of the machine (/init.d/zaptel stop won't kill it). Anybody got an idea what I'm doing wrong here.

by Pepperdotnet, Monday 23 of October, 2006 (16:27:33 UTC)