• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

8.2. Sending and receiving faxes with spandsp

1. What is spandsp

Spandsp is a library for Digital Signal Processing(DSP). DSP is used to turn images into audio and back. In Asterisk, spandsp, is required for sending and receiving faxes.

The main web site of spandsp is http://soft-switch.org/. There you can find the latest version.

 


2. Packages required by spandsp

1) Libtiff - This is the only package, required by spandsp. This package provides support for the Tag Image File Format(TIFF). This is a format, used for storing image data. If you need more information about the TIFF format, you can follow the link in our references.

Libtiff contains the library, used for the reading and writing of TIFF files, on UNIX-based systems.

To install the libtiff package, go to the main website of libtiff, which is http://www.libtiff.org/. Go to the download section - http://dl.maptools.org/dl/libtiff/ and download the desired package. According to the information from the spandsp web site, the libtiff version 3.5.7, 3.6.0 or 3.7.1 works OK.

NOTE: For this tutorial we will use the libtiff version 3.7.1.

Now, go to the directory where you downloaded the file and unzip it.

Enter the directory, where the unzipped files are- cd tiff-version.

Execute the following commands, one by one:

./configure
make clean
make
make install
ldconfig

 


3. How to install spandsp

Once, you have finished with the libtiff package, it is time to install the spandsp package.

STEP 1) Download the spandsp package. You can do this from the main web site http://soft-switch.org/downloads/spandsp/. Also, you need to download 3 more files from here. They are: app_rxfax.c, app_txfax.c and apps_makefile.patch.

NOTE: For this tutorial we will use the spandsp version 0.0.2pre21

STEP 2) The installation.

Unzip the spandsp package by using the command: tar -xvzf spandsp-version.tar.gz

Go to the directory of the spandsp and type the following commands, one by one.

./configure --prefix=/usr
make clean
make
make install

STEP 3) Put the app_rxfax.c, app_txfax.c and apps_makefile.patch files in the Asterisk application directory. Usually it is /usr/src/asterisk/apps

STEP 4) Patch the Makefile. You can achieve this by typing the following command:

patch <apps_makefile.patch

Remember, that you have to be in the Asterisk application directory(usually /usr/src/asterisk/apps), when you are executing the command.

STEP 5) Check your ld.so.conf file. It has to be in the /etc/ directory. If you do not have such file - make one. In the file you need to add the path to the spandsp library. By default the directory is /usr/local/lib. So if you do not have such line in your file, you have to add it manually.

STEP 6) Rebuild your Asterisk. Go to the asterisk directory (usually /usr/src/asterisk) and type the following commands:

make clean
make
make install

At the end, if everything is OK you will have two more applications added - rx_fax and fx_fax. You can check this by starting the Asterisk and using the show applications command.

 


4. Sending faxes to the Asterisk, through SIP by using spanDSP


Prerequisites

You need a working Asterisk PBX with registered user in the sip.conf file and made extensions. Also, you need a fax machine and an ATA device.

NOTE:We will use Asterisk CVS HEAD version. Our fax machine is Brother FAX-T94. The ATA device is Grandstream HandyTone-486 - the firmware is 1.0.6.2. To learn more about the configuration of this ATA device please take a look at our tutorial


Asterisk PBX configurations

sip.conf Configurations

We need one registered user in the sip.conf file.

sipfax.jpg

So, we have registered the user sip_fax.

Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test1 - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.

IMPORTANT: You can send and receive faxes with spandsp only through the G.711(alaw or ulaw) codecs.


extensions.conf Configurations

Now lets take a look at the extensions.conf file.

sipfaxext.jpg

On the picture above you can see our extensions.conf file.

We have an extension 300. This will be the extension on which we will receive faxes. As you can see the first application is Answer. If you want to receive faxes, you have always to answer the channel by using this application. In this way the Asterisk will hear for a fax signal.

It seems that there is a problem with the hanging up after the sending of fax. So, if you try to execute the Hangup application in the extension 300 with priority 5, nothing will happen. So, the solution is to use the AbsoluteTimeout application. As argument in its brackets we have set 35, which means that after 35 seconds the execution will continue with the extension with letter T. This one will execute the Hangup application, which will hang up the channel.

Then we have the Set application. It will set the path and the name of the file, where we would like the fax to be stored. They will be set to a variable, named FAXFILE.

The name of the file is test.tif. The directory where it will be stored is /tmp/.

NOTE: Please pay attention, that you will have to allow the reading and writing in this directory.

Finally we have the extension with the RxFax application. It will allow us to send a fax from the fax machine to the Asterisk and to store it in a file. As argument in the brackets we have set only the variable ${FAXFILE}, which we have used in the Set application, to set the location and the name of the file.

Now, when somebody dials the number 300 from its fax machine and then press the start button for sending faxes. The Asterisk will answer the channel, hear the fax signal and execute the RxFax application. The fax will be stored in the file test.tif in the /tmp directory.


Grandstream HandyTone-486 configurations

There are a few settings which you have to do in the ATA. Using the web interface go to the Advanced Settings.

Set the SIP Proxy Server. This is the IP address of your Asterisk Server. In our case the IP is 10.3.3.34, but in your case it could be different. For the Outbound Proxy set the same IP address (The IP address of your Asterisk).

For the SIP User ID, write the name of the user, as it is set in your sip.conf file. In our case this is sip_fax. In your case it could be different. Authenticate ID - write the same username as in the previous option. In our case again sip_fax. Authenticate Password is related with the secret setting in the sip.conf file. So here you have to write the same as you have written in the secret option for the user which you are going to use. In our example we have set for the user sip_fax, a secret=sip_fax. So for Authenticate Password, we will write again sip_fax. In your case could be different.

Do not forget, that you can send faxes through the spandsp only by using the G.711 (ulaw or alaw) codec. So, it is very important to set the preferred codecs for the Grandstream HandyTone-486 to either PCMA(alaw) or PCMU(ulaw). In our case the codecs are set to PCMU(ulaw).

The most import option which you have to set is the FaxMode. It is set to T.38(Auto Detect) by default. You have to change it to Pass-Through.

grandsteam.jpg

More about the configuration of the Grandstream HandyTone-486 you can learn from our tutorial


 


Screenshot of what you can see on the CLI of the Asterisk PBX

clisendfax spandsp.jpg
 


Additional information

For more information about extensions.conf you can check here.
For more information about sip.conf you can check here.

This application is tested with Brother FAX-T94 fax machine and Asterisk CVS HEAD version. They are connected through Grandstream HandyTone-486 ATA (firmware 1.0.6.2).

 


Uploaded files

extensions.conf
sip.conf

 


5. Receiving faxes from Asterisk through SIP by using spanDSP


 


6. Troubleshooting

1) If you have problems with the patching of the Makefile. If you receive like the following:

patching file Makefile
Hunk #1 FAILED at 55.
Hunk #2 FAILED at 93.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej

Then you have to change the Makefile file manually.

Open the apps_makefile.patch. Find the lines which started with "+". These are the lines which you have to add to the Makefile file. In our case these lines are:

+APPS+=$(shell if [ -f /usr/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
+APPS+=$(shell if [ -f /usr/local/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)


and

+app_rxfax.so : app_rxfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff
+
+app_txfax.so : app_txfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff

You have to add the lines in the following places:

The first two lines have to be added after the following line:

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

and the next two lines after:

app_sql_odbc.so: app_sql_odbc.o
	$(CC) $(SOLINK) -o $@ $< -lodbc

NOTE: The "+" signs at the beginning of the lines does not have to be included in the Makefile. So, omit them.

2) If you receive a message like the following:

[app_txfax.so]Oct 5 12:05:24 WARNING[14665]: loader.c:314 __load_resource: /usr/lib/asterisk/modules/app_txfax.so: undefined symbol: fax_set_header_info
Oct 5 12:05:24 WARNING[14665]: loader.c:543 load_modules: Loading module app_txfax.so failed!
Ouch ... error while writing audio data: : Broken pipe

When you execute the asterisk -vvvvvvvc command and the Asterisk crashes when you try to execute the safe_asterisk command, then very probably you have the following problem:

The previously installed version of spandsp has been 0.0.3, but now you have installed version 0.0.2. The problem is that the installation of version 0.0.3 creates a symlink, which is not replaced by installation of version 0.0.2. So the symlink points to the library of version 0.0.3, which actually does not exist.

The solution is to find the location of this symlink and to delete it manually. Usually it is in the /usr/lib/ directory.

Then go through the steps from section 3. How to install spandsp.

3)The system executes the RxFax application. The fax machine seems to start the sending, but unexpectedly the Asterisk hangs up the line.

The solution. The problem could be in the directory, where you would like to store the faxes. Check whether it is created. Also check whether do you have rights to read and write into this directory.

4)If you receive a message like this one:

Jun 3 10:20:05 WARNING[14277]: chan_sip.c:3063 process_sdp: Unknown SDP media type in offer: image 49170 udptl t38

Then probably your ATA is configured to use T.38. Go through the web interface to the Advanced Settings and switch the FAX Mode to Pass-Through

 


7. Packages

This are the software and the packages, we are using. You can download them by clicking the links.

The RxFax and TxFax applications
Spandsp-0.0.2pre21
Libtiff-3.7.1
Libpri
Zaptel
Asterisk

 


8. References

The spandsp on ScottStuff
A forum post with example about spandsp extension
E-fax on AsteriskBrasil
The TIFF graphics format on wikipedia

 

 
User Comments
Kvaxmymn (wiljwxvjyhadrwd5gphi at gmail dot com)
11 February 2021 14:42:16
safe online payday loans <a href="http://rirocash.com/ ">payday loans lenders alabama</a> cash loans in durban central
Karen Strong (100wmc at gmail dot com)
02 December 2020 17:27:05
REMOVE 860-454-8469
FOMR EVERY COMPANY YOU ARE FAXING FROM. IHAVE FILED A FORMAL COMPLAINT AGAINST YOUR BUSINESS.
alternatives to ventolin hfa (tonja-macbain68 at welcore dot ml)
17 August 2020 10:09:34
alternatives to ventolin hfa https://amstyles.com/
DennisVor (temptest261214990 at gmail dot com)
01 April 2020 01:57:54
Comments for xe-88.asia http://www.xe-88.asia/comments/feed/ - Show more!..
DonVukovic (donvukovic at gmail dot com)
13 November 2019 04:04:54
Is there a procedure to receive a FAX into a tiff file to an SDCard on the RasPi_3 ?

Thank You
GeorgeSip (tatyanamariyaklimenko1991978oaf at mail dot ru)
31 March 2019 21:55:14
slot machine games free no download no registration barista toglie slot machine best slot machine fire red <a href="http://hlaastmu.com/#slot">scarica giochi gratis</a> fifa 16 slot machine simulator slot machine abano terme metodi per vincere alle slot machine dei bar
slot machine vtl imposte sulle slot machine gallina slot machine gratis <a href=http://hlaastmu.com/#slot>slot machine bar</a>

http://hlaastmu.com
embassy of egypt in tokyo (koh_egypt at yahoo dot co dot jp)
01 February 2019 04:57:25
Someone sends us everyday a same fax, titled FAX TEST nearly 10 times. It really wastes our papers occupies our only fax.... too much embarrassed. Please stop it immediately.

Embassy of Egypt in Tokyo
Fax: 0081-3-3770-8021
Adam Korbl (marketing at crowdedroad dot com)
26 March 2016 16:34:55
Nice Post, I would like to add here one more faxing services for mobile and web . Try Now IfaxApp - ifaxapp.com
Asmaa (rxj0nsefjc at gmail dot com)
19 December 2015 15:16:41
より:The best Microsoft mouse button<a href="http://zqqorzu.com"> aqeuircd</a> the wide-ranging teardrop condition by using a pair of links.The initial environmentally friendly buttoned design had a metal golf ball which spawned a great business within foam sensitive mouse pads.Another iteration<a href="http://zqqorzu.com"> aqeuircd</a> larger switches, a larger shape, and a plastic covered ball.
Asep (t7pqp0bh8d0 at yahoo dot com)
18 December 2015 08:40:42
I took this course on an iPad and do not have a prtiner. When will the hard copy be sent via mail. Also, is there a site that you can see the questions you answered incorrect
Foreign Press Association (fpa at netvision dot net dot il)
24 June 2015 12:01:13
PLEASE REMOVE OUR FAX NUMBER FROM YOUR DATA BASE!
fatemeh (faza_404 at yahoo dot com)
25 January 2009 13:19:34
Hi:
I can't find any link for download app_rxfax.c, app_txfax.c and apps_makefile.patch files.
I'd appreciate any help.
fatemeh (faza_404 at yahoo dot com)
24 January 2009 08:39:45
Hi:
I want to receive fax.I've installed asterisk 1.2.24 and spandsp -0.0.2pre26 and tiff-3.7.1 .Now,I need app_rxfax.c, app_txfax.c and apps_makefile.patch files.Where can I download them?
Regards.
doddel (subscriptions at stroomer dot com)
09 September 2008 19:38:22
Thanks for this page.
Just did an integration of tx_fax and rx_fax with asterisk (1.4.21.2).
The link given in the directions for spandsp doesn't carry the tx_fax and rx_fax as files.
Still had them from an earlier installation.
The patch file is incomplete as somehow the file 'makeopts' doesn't get properly set. It should contain the lines:
SPANDSP_INCLUDE=
SPANDSP_LIB= -lspandsp -ltiff
(other patches in patchfine are fine and necessary)
Then had to make a link in /usr/lib to make asterisk find the libtiff.so.3 library in /usr/local/lib. Then it worked.

To make my combination of mISDN (1.1.8) and Asterisk (1.4.21.2) compile under Debian Etch4 I needed 'apt-get install' of
build-essential
libncurses-dev
linux-headers-<your version-subversion>
linux-kbuild-<your version>
flex

To use the nice fax2pdf script (make asterisk send incoming faxes per email as pdf attachment) two more packages are needed:
libtiff
mime-construct

extensions.ael has following example for fax reception and forwarding per email.

In the appropriate context of incoming calls:
_${faxno} => {
Set(fflag=1);
Set(fnbody=/var/spool/asterisk/fax${faxno}/f${UNIQUEID});
Set(fnfull=${fnbody}.tif);
rxfax(${fnfull});
};
h => {
if ("${fflag}" = "1") {
System(/usr/sbin/fax2mail -p -f ${fnbody} --cid-name ${CALLERID(name)} --cid-number ${CALLERID(num)} --dest-exten ${faxno} --dest-name <email name> --dest-email <email address>);
Set(fflag=0);
};

Akash (soniaakash03 at yahoo dot com)
28 May 2008 13:55:54
we are working Asterisk PBX. also impliment in bound call center application on asterisk
now we are plan start to make send fax module using with Sip Protocol.
hannibal82_ (ajawadi at oxeane dot com)
20 February 2008 14:50:24
how to find package (app_rxfax.c, app_txfax.c and apps_makefile.patch).


I used files that I found in the package AsterFax, launching the patch command, I had this error:

===============================================

[root@www asterisk-1.4.17]# cd apps/
[root@www apps]# patch <apps_Makefile.patch
patching file Makefile
Hunk #1 FAILED at 52.
Hunk #2 FAILED at 104.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej
==================================================

Here is the file. Rej generated, there is no mdofication made on the original file Makefile:

============ makefile.rej ========================================
***************
*** 52,61 ****

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
--- 52,65 ----

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp.h $(CROSS_COMPILE_TARGET)/usr/include/spandsp.h),)
+ APPS+=app_rxfax.so app_txfax.so
+ endif
+
ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
***************
*** 100,109 ****
rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so

app_curl.so: app_curl.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)

app_sql_postgres.o: app_sql_postgres.c
$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c

app_sql_postgres.so: app_sql_postgres.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
--- 104,119 ----
rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so

app_curl.so: app_curl.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)

+ app_rxfax.so : app_rxfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff
+
+ app_txfax.so : app_txfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff
+
app_sql_postgres.o: app_sql_postgres.c
$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c

app_sql_postgres.so: app_sql_postgres.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq

=====================================================

For more information, here's the code file apps_makefile.patch I used:

=======================================================

--- Makefile.orig 2006-02-09 10:31:21.000000000 +0800
+++ Makefile 2006-05-28 17:57:43.000000000 +0800
@@ -52,10 +52,14 @@

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

+ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp.h $(CROSS_COMPILE_TARGET)/usr/include/spandsp.h),)
+APPS+=app_rxfax.so app_txfax.so
+endif
+
ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
@@ -100,10 +104,16 @@
rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so

app_curl.so: app_curl.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)

+app_rxfax.so : app_rxfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff
+
+app_txfax.so : app_txfax.o
+ $(CC) $(SOLINK) -o $@ $< -lspandsp -ltiff
+
app_sql_postgres.o: app_sql_postgres.c
$(CC) -pipe -I$(CROSS_COMPILE_TARGET)/usr/local/pgsql/include -I$(CROSS_COMPILE_TARGET)/usr/include/postgresql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c

app_sql_postgres.so: app_sql_postgres.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq

=============================================================

thanks in advance.
raytrace (raytrace at sina dot com)
12 December 2007 03:31:13
reply Waseem Hassan
your error becuse new version spanDSP changed t30.h

use old version
Waseem Hassan (waseem at vonics dot com)
22 August 2007 10:54:07
I am using app_rxfax.c app_txfax.c and apps_Makefile.patch from http://www.asteriskguru.com/tutorials/spandsp.html

when i make patch i get error

patching file Makefile
Hunk #1 FAILED at 55.
Hunk #2 FAILED at 93.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej

tried trouble shooting and got error like that

In file included from app_rxfax.c:15:
../include/asterisk/file.h:27:2: #error You must include stdio.h before file.h!
In file included from app_rxfax.c:15:
../include/asterisk/file.h:56: parse error before '*' token
../include/asterisk/file.h:56: warning: function declaration isn't a prototype
../include/asterisk/file.h:57: parse error before '*' token
../include/asterisk/file.h:57: warning: function declaration isn't a prototype
app_rxfax.c: In function `phase_e_handler':
app_rxfax.c:77: warning: implicit declaration of function `fax_get_transfer_statistics'
app_rxfax.c:78: warning: implicit declaration of function `fax_get_far_ident'
app_rxfax.c:79: warning: implicit declaration of function `fax_get_local_ident'
Jorge (spynaker at gmail dot com)
09 July 2007 00:05:00
I have this problem :
spynaker@Inspiron:/usr/src/asterisk/apps$ sudo patch <asterisk.patch
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- build_tools/menuselect-deps.in.orig 2006-09-03 15:50:32.000000000 +0800
|+++ build_tools/menuselect-deps.in 2006-09-03 15:50:44.000000000 +0800
--------------------------
File to patch:


help pls..
Flobi (flobi at flobi dot com)
26 June 2007 22:43:43
Thanks so much, but maybe we could put the part about it hanging up and not having the directory a little larger. This is the only page on the internet with that information.
Rajesh (krajesh_847 at hotmail dot com)
06 June 2007 13:31:12
By the Packages provided in this site
http://www.asteriskguru.com/tutorials/spandsp.html

I am getting 'rxfax' and 'txfax' but i want 'DTMFToText' application also.
I got a information that it is possible with app_dtmftotext.c file along with fax related file.

can u please help me in this, For to get 'DTMFToText' application.
from the packages given in this link.

adrian dabrowski (sorry at this dot is dot private dot com)
15 March 2007 20:06:32
you can convert singlepage and multipage faxes into neat PDFs using the libtiff-tools package:

[fax]
exten => 1,1,Answer()
exten => 1,2,AbsoluteTimeout(600)
exten => 1,3,SetVar(FAXFILE=/tmp/fax/fax-${DATETIME}-${CALLERIDNUM})
exten => 1,4,noop(new fax: ${FAXFILE})
exten => 1,5,rxFax(${FAXFILE}.tif)
exten => 1,6,Goto(1,106)
exten => 1,106,System(test -f ${FAXFILE}.tif && tiff2pdf -o ${FAXFILE}.pdf ${FAXFILE}.tif)
exten => 1,107,Hangup
parisien75 (parisien99 at hotmail dot com)
20 January 2007 04:00:11
hello.

i have a big problem with the spansdp patch.

i put the problem here :
http://www.asteriskguru.com/board/here-vp4935.html#4935

is someone can help my i i will appreciate it bery much.

thank you
hash (hashrk at yahoo dot com)
14 October 2006 14:07:11
Hi, I have a BRI card B410P Digium, any idea of origin of this error.

While starting Asterisk, I am getting something like

WARNING[11450]: loader.c:325 __load_resource: /usr/lib/libmISDN.so

Thanks,

Hash
Minda (mindaugask at erdves dot lt)
24 August 2006 09:22:50
I'm trying this setup on freeBSD 6.1 with installed ports:
spandsp-0.0.2.p26
tiff-3.8.2
asterisk-1.2.9.1_2

fax transmision crashes at a beginig. I don't see errors in log. Rtp flow stops from asterisk and because of it remote UA hangsups. Script creates blank file and thats all.

Here is debug messages:
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW DCS with final frame tag
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW In state 9
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Get at 9600bps, modem 1
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Changed from phase 3 to 5
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier up
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier down
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier up
Aug 24 10:04:38 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier trained
Aug 24 10:04:40 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier down
Aug 24 10:04:40 DEBUG[65667] app_rxfax.c: FLOW Changed from phase 5 to 4
Aug 24 10:04:40 DEBUG[65667] app_rxfax.c: FLOW >>> CFR:Aug 24 10:04:40 DEBUG[65667] app_rxfax.c: 84Aug 24 10:04:40 DEBUG[65667] app_rxfax.c:
Aug 24 10:04:41 DEBUG[65667] app_rxfax.c: FLOW HDLC underflow in state 5
Aug 24 10:04:41 DEBUG[65667] app_rxfax.c: FLOW Post trainability
Aug 24 10:04:41 DEBUG[65667] app_rxfax.c: FLOW Changed from phase 4 to 5
Aug 24 10:04:44 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier up
Aug 24 10:04:44 DEBUG[65667] app_rxfax.c: FLOW Non-ECM carrier trained
Aug 24 10:04:49 DEBUG[65667] app_rxfax.c: Got hangup
Aug 24 10:04:49 DEBUG[65667] pbx.c: Extension 125, priority 3 returned normally even though call was hung up
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is '123'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is '123'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is '125'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is 'default'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is 'SIP/123-2d77'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is '(null)'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is 'RxFAX'
Aug 24 10:04:49 DEBUG[65667] pbx.c: Function result is '/var/log/asterisk/test.tif|debug'

what could be wrong?
timathy (sunhouqi82 at 163 dot com)
27 June 2006 05:44:03
Are you able to send multipages fax with spandsp?I get the following debug messages when I send a multipages tiff file..

FLOW Start sending document
FLOW Changed from phase 2 to 4
FLOW Sending ident
FLOW >>> TSI: 43 6e 75 78 67 6e 61 75 67 20 20 20 20 20 20 20 20 20 20 20 20
FLOW >>> DCS: 83 00 86 80 80 80 00
FLOW HDLC underflow in state 3
FLOW Changed from phase 4 to 6
FLOW Changed from phase 6 to 3
FLOW Slow carrier up
FLOW <<< CFR: 84
FLOW CFR with final frame tag
FLOW In state 4
FLOW Trainability test succeeded
FLOW Slow carrier down
FLOW Changed from phase 3 to 6
FLOW Changed from phase 6 to 4
FLOW >>> MPS: 4f
FLOW HDLC underflow in state 13
FLOW Changed from phase 4 to 3
FLOW T4 timeout in state 13
FLOW Changed from phase 3 to 4
FLOW >>> MPS: 4f
FLOW HDLC underflow in state 13
FLOW Changed from phase 4 to 3
FLOW T4 timeout in state 13
FLOW Changed from phase 3 to 4
FLOW >>> MPS: 4f
FLOW HDLC underflow in state 13
FLOW Changed from phase 4 to 3
FLOW T4 timeout in state 13
FLOW Changed from phase 3 to 4
FLOW >>> MPS: 4f
FLOW HDLC underflow in state 13
FLOW Changed from phase 4 to 3
FLOW T4 timeout in state 13
FLOW Changed from phase 3 to 4
FLOW >>> MPS: 4f
FLOW HDLC underflow in state 13
FLOW Changed from phase 4 to 3
FLOW Slow carrier up
FLOW Slow carrier down
FLOW Slow carrier up
FLOW Slow carrier down
FLOW Slow carrier up
FLOW <<< XCN: fa
FLOW XCN with final frame tag
FLOW In state 13
FLOW Disconnecting
VTech (info at valleytechnologiesllc dot com)
01 June 2006 21:27:03
when loading app_rxfax.so or app_txfax.so I get an error: "Jun 1 11:59:53 WARNING[12940] loader.c: /usr/lib/asterisk/modules/app_rxfax.so: undefined symbol: t30_completion_code_to_str" and it fails to load.

asterisk-1.2.8
spandsp-0.0.2pre26.tar.gz
libpri-1.2.3
asterisk-sounds-1.2.1
asterisk-addons-1.2.2
zaptel-1.2.5

no errors compiling, and I can't seem to find a solution to the "undefined symbol: t30_completion_code_to_str" problem. Anyone run into this and fix it?
Nizar (nizar dot khoury at excendia dot com)
01 June 2006 18:57:17
Hi,

I have just installed asterisk 1.2.7.1 with Spandsp 0.0.2pre25 along with app_rxfax.c, app_txfax.c, and apps_Makefile.patch

When I execute the patch, I get these messages:

Hunk #1 FAILED at 52.
Hunk #2 succeeded at 104 with fuzz 1.
1 out of 2 hunks FAILED -- saving rejects to file Makefile.rej

My Makefile.rej is the following:

***************
*** 52,61 ****

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
--- 52,65 ----

ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
APPS+=app_osplookup.so
endif

+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp.h $(CROSS_COMPILE_TARGET)/usr/include/spandsp.h),)
+ APPS+=app_rxfax.so app_txfax.so
+ endif
+
ifeq ($(findstring BSD,${OSARCH}),BSD)
CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
endif

CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)


If you know what it is please let me know. Any suggestion is appreciated.

Thanks...


Roberto Sanglay (infomate at infomatedgte dot com)
22 May 2006 17:32:29
I've been getting errors upon issuing the "make" command.
What ver. is most applicable to *@Home 2.8?

libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -I. -I. -c tif_stream.cxx -o .libs/tif_stream.o
../libtool: line 837: g++: command not found
make[2]: *** [tif_stream.lo] Error 1
make[2]: Leaving directory `/misc/tiff/tiff-3.8.2/libtiff'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/misc/tiff/tiff-3.8.2/libtiff'
make: *** [all-recursive] Error 1
[root@asterisk1 tiff-3.8.2]#
jsalas (jsalasn1 at gmail dot com)
19 May 2006 17:06:37
Hello

I will try to receive faxes in this scenario:


[FAX]-------->[PSTN]-------->[GW cisco]--------->[ASTERISK]
analog E1 SIP g711
passthrough

I'm using Fedora 3 and I installed tiff-3.7.1 and spandsp-0.0.2pre25.
I'm working with asterisk-1.2.7.1 and Ive compiled and installed
app_rxfax.c and app_txfax.c.
Everything looks fine, but when I make a fax call from the PSTN
asterisk execute the RxFAX aplication and I listen the "fax tones",
but when the first page is sent I don't see anything in the asterisk
and the analog fax machine show an "transmission error".
where can I find some debugs or logs of this fax call to show me what is wrong?

Regards
jsalas.
Did (dpopdonev at goldtech dot com)
16 May 2006 19:51:23
"The previously installed version of spandsp has been 0.0.3, but now you have installed version 0.0.2. The problem is that the installation of version 0.0.3 creates a symlink, which is not replaced by installation of version 0.0.2. So the symlink points to the library of version 0.0.3, which actually does not exist."

Does somebody know what is the name of this symlink?

thks
Razvan (razvandumitrescu at yahoo dot com)
12 May 2006 21:37:27
Hi Aranaud,
Use this combination:
spandsp - http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/spandsp-0.0.2pre25.tar.gz

apps
- http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk-1.2.x/app_rxfax.c
- http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk-1.2.x/app_txfax.c
- http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.2pre25/asterisk-1.2.x/apps_Makefile.patch

The patch file is a bit outdated for 1.2.7.1 and you will have to add the second part of patch by hand
If you can't get the Makefile done send me an email and i'll send you mine.
Arnaud (a dot dupuis at infinityperl dot org)
03 May 2006 14:09:24
On Asterisk 1.2.7.1 with spandsp 0.0.2pre21 I get the following error :

May 3 13:57:39 WARNING[13360] loader.c: /usr/lib/asterisk/modules/app_rxfax.so: undefined symbol: t30_completion_code_to_str
May 3 13:57:39 WARNING[13360] loader.c: Loading module app_rxfax.so failed!


Any idea ?

Thanks in advance.
roberto (torobynet at gmail dot com)
02 May 2006 14:50:37
following the troubleshooting n1) I have also this problem:

[root@localhost apps]# patch <apps_makefile.patch
patching file Makefile
patch: **** malformed patch at line 14: CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib

anyone pls help?
roberto (torobynet at gmail dot com)
02 May 2006 14:47:05
[root@localhost apps]# patch <apps_makefile.patch
patching file Makefile
patch: **** malformed patch at line 14: CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib

Lacho (support at asteriskguru dot com)
28 April 2006 11:32:21
Hi poin,

Please check the Troubleshooting section in the tutorial. There you will find the solution

Regards
Lacho
poin (poin04 at yahoo dot com)
28 April 2006 10:35:03
[root@fax apps]# patch<apps_Makefile.patch
patching file Makefile
Hunk #1 FAILED at 52.
Hunk #2 FAILED at 104.
2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej

anyone pls. help?
poin (poin04 at yahoo dot com)
28 April 2006 06:10:24
patching file Makefile
Hunk #1 FAILED at 52.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
missing header for unified diff at line 21 of patch
can't find file to patch at input line 21
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
| endif
|
| CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
--------------------------



pls help
ah hock (poin04 at yahoo dot com)
12 April 2006 02:57:04
cc -fPIC -c -o app_nv_backgrounddetect.o app_nv_backgrounddetect.c
In file included from app_nv_backgrounddetect.c:26:
/usr/include/asterisk/lock.h: In function `ast_mutex_init':
/usr/include/asterisk/lock.h:525: `PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function)
/usr/include/asterisk/lock.h:525: (Each undeclared identifier is reported only once
/usr/include/asterisk/lock.h:525: for each function it appears in.)
In file included from app_nv_backgrounddetect.c:27:
/usr/include/asterisk/file.h:27:2: #error You must include stdio.h before file.h!
In file included from app_nv_backgrounddetect.c:27:
/usr/include/asterisk/file.h: At top level:
/usr/include/asterisk/file.h:56: syntax error before '*' token
/usr/include/asterisk/file.h:57: syntax error before '*' token
make: *** [app_nv_backgrounddetect.o] Error 1


anyone pls help????????
i still cannot solve this problem..
Gustavo (gustavo at flai dot com dot br)
04 April 2006 17:08:00
[app_rxfax.so]Apr 4 09:01:25 WARNING[23465]: loader.c:325 __load_resource: /usr/lib/asterisk/modules/app_rxfax.so: undefined symbol: t30_get_transfer_statistics
Apr 4 09:01:25 WARNING[23465]: loader.c:554 load_modules: Loading module app_rxfax.so failed!

I comment inside the app_txfax.c and app_rxfax.c which have the follow "if":
/*
if (verbose)
fax.logging.level = SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL
| SPAN_LOG_FLOW;
x = pbx_builtin_getvar_helper(chan, "LOCALSTATIONID");
*/

I did it cause i was having troubles to compile the sources like above:

gcc -D_GNU_SOURCE -shared -Xlinker -x -o app_rxfax.so app_rxfax.c -lspandsp -ltiff
app_rxfax.c: In function `rxfax_exec':
app_rxfax.c:284: error: structure has no member named `logging'
make[1]: ** [app_rxfax.so] Erro 1
make[1]: Leaving directory `/mnt/asterisk-files/asterisk-1.2.6/apps'
make: ** [subdirs] Erro 1

Im running asterisk 1.2.6, zaptel 1.2.5, spandsp 0.0.2pre20

Can anyone help me with this?

Best regards

Gustavo
Jose Maria (sarachaga at yahoo dot com)
28 March 2006 12:07:14
Hi everyone!

I just installed everything successfully using 0.0.2pre25 and asterisk 1.2.5netsec and configured for receiving faxes to files.

When i dial the fax extension y get the fax tone incomplete, as with short cuts, so eventough it sounds like a fax, the real fax doesn't understand a single bit, in fact, they never start making the usual fax tone. It only makes the tone when i call and make noises with my mouth, if not, it just beeps every 2 seconds, like waiting for something :P

Any help? any hint?
Kind regards
Jose Maria
Confused (cjjp at nobounce dot net)
21 March 2006 01:41:37
Well... that module error (undefined symbol) is (at least according to an asterisk-users list archive message) due to mixing STABLE and HEAD (two different versions of * from CVS, svn, or whatever they're using now). I forcibly installed two contemporaneous asterisk and spandsp packages, and that particular problem went away.

Other module problems can be clobbered by uncommenting unnecessary "load" lines in modules.conf and/or rm'ing the evil module from /usr/lib/asterisk/modules (as always, make backup copies).

But now that I have app_txfax.so loading properly, I can't figure out how to associate txfax() with an call in extensions.conf! The code posted on this site uses "_X." as the extension and doesn't specify its context. Many sections refer to *receiving* faxes, but the sections on *sending* faxes with * are blank! So, how does one USE the app_txfax after it's installed?

And what the freck is an ATA anyway?
Loic Foucault (support at infofortin dot net)
24 January 2006 22:09:07
Problem when starting asterisk+spandsp
I got:
Jan 24 10:06:30 WARNING22757: loader.c:325 __load_resource: /usr/lib/asterisk/modules/app_txfax.so: undefined symbol: span_set_message_handler
Jan 24 10:06:30 WARNING22757: loader.c:554 load_modules: Loading module app_txfax.so failed!

I'm using SuSe9.0, libtiff 3.5.7, spandsp 0.0.2pre22

Michele Garribba (michele dot garribba at email dot it)
24 January 2006 17:19:15
Hi, very good and useful tutorial. I've a cisco 827-4v router and i was thinking of using it as an ATA for the fax machine. Could you help me in configuring it? i.e. some tutorial about or link...

What about email to fax using a SIP channel?
Thanks in advance
Michele
Daniel (danielalzate1 at hotmail dot com)
13 January 2006 16:34:34
when make

app_rxfax.o app_rxfax.c
app_rxfax.c: In function `rxfax_exec':
app_rxfax.c:267: error: structure has no member named `logging'
app_rxfax.c: At top level:
app_rxfax.c:67: warning: `t30_flush' defined but not used
make[1]: *** [app_rxfax.o] Error 1
make[1]: Leaving directory `/usr/src/asterisk-1.2.0/apps'
make: *** [subdirs] Error 1.
zoa (support at asteriskguru dot com)
28 December 2005 13:10:30

Read the tutorial carefully,

"The previously installed version of spandsp has been 0.0.3, but now you have installed version 0.0.2. The problem is that the installation of version 0.0.3 creates a symlink, which is not replaced by installation of version 0.0.2. So the symlink points to the library of version 0.0.3, which actually does not exist."
Dov (dovb at terra dot com dot br)
27 December 2005 15:19:06
I get the following error messages when I start Asterisk...

[app_rxfax.so]Dec 27 12:14:27 WARNING[14679]: loader.c:334 __load_resource: No load_module in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:341 __load_resource: No unload_module in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:348 __load_resource: No usecount in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:355 __load_resource: No description in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:362 __load_resource: No key routine in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:371 __load_resource: Key routine returned NULL in module /usr/lib/asterisk/modules/app_rxfax.so
Dec 27 12:14:27 WARNING[14679]: loader.c:380 __load_resource: 6 errors loading module /usr/lib/asterisk/modules/app_rxfax.so, aborted
Dec 27 12:14:27 WARNING[14679]: loader.c:499 load_modules: Loading module app_rxfax.so failed!
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • Who are able to write more clearly conce...
    tutorial: manager.conf
  • В ЦентрКонсалт работа...
    tutorial: Idefisk - IAX2 softphone
  • What a fantastic story I Have recently r...
    tutorial: Sipura Phone Adapter - SIP Analog telephone adapter (ATA)
  • :)[url=https://wmj.su/]:)[/url]:)...
    tutorial: Idefisk - IAX2 softphone
  • where to buy cialis in canada <a href=\"...
    tutorial: VoiceMail (dialplan application)
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™