Asterisk 1.4 - rxfax/txfax - Sending/Receiving Fax

Digg This
Del.icio.us

We have recently upgraded our Asterisk server to version 1.4. And while almost everything worked, fax portion was broken. In 1.2, we were using spandsp 0.2 and app_rxfax and app_txfax successfully to receive/send faxes.

After the 1.4 upgrade, I tried to compile the 1.4 versions of the apps (located at http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/). For those, you have to apply the patch (asterisk.patch) manually. After that compiling failed.

Then I uninstalled spandsp (it has nice feature of "make uninstall"), and installed 0.3 version, spandsp-20061206.tar.gz, switch to /usr/src/asterisk-1.4.0, run configure, make clean, make menuselect and it showed app_txfax and app_rxfax as XX (unavailable). I put the proper path in /etc/ld.so.conf and run ldconfig, prior to compiling Asterisk as well.

Then after a Digium forum post (Thanks Dnico), I made following changes:

/./build_tools/menuselect-deps
SPANDSP=1
../makeopts
SPANDSP_LIB=-lspandsp

And voila, menuselect was now showing the rxfax and txfax. However, after compiling, and installing, I realized something was still amiss. This time, as soon as rxfax runs in dialplan, Asterisk crashed.

Doing more research, I found one user group post, suggesting to run autoconf, as the patch involved changes to configure.ac. Furthermore, someone suggested to use bootstrap.sh located in asterisk source. Running it on my box, corrupted the configure file.

So to start from scratch, on my test box, I installed spandsp 0.3 (same as above), copied asterisk source files from the production box, to make the changes permanent (for Dnico's suggestion), I edited menuselect-deps.in and makeopts.in, downloaded latest version of autoconf, 2.60-1, and run the bootstrap.sh. After few warnings, it generated the configure file fine. Then I run the usual suspects, configure, make menuselect, adjust the selections, x to exit and save, run make and finally make install. Voila, finally success.

The incoming faxes are working fine now, I replicated it to the production box as well. I had to hunt down the Newman Telecom's nvfaxdetect and nvbackgrounddetect scripts, as the author had sold his work to a company. I got my copy from x68k.net and they compiled fine. Now I can detect if the incoming call is a fax and act on it in the dialplan accordingly.

If you need any help compiling rxfax and txfax on Asterisk 1.4, drop in a comment :)

Posted 2/19/2007 3:00:00 AM @ 13:24:00 | Asterisk

Comments

Hi there,

I am currently struggling with getting Asterisk 1.4 to work with the app_rxfax and app_txfax.

I was wondering if you could provide me with a step by step guidance on how you get your network working.

Thanks

Posted by Dana (email) on 3/4/2007 3:00:00 AM

The steps are listed above is what I did pretty much. To reiterate:

1. Download Asterisk 1.4.1 (released couple days ago)
2. Grab http://www.soft-switch.org/downloads/snapshots/spandsp/spandsp-20061206.tar.gz
3. Untar both to /usr/src
4. Compile spandsp.
5. Copy http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_rxfax.c and http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_txfax.c to /usr/src/asterisk-1.4.1/apps folder.
6. Copy http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/asterisk.patch to /usr/src/asterisk-1.4.1 folder.
7. cd /usr/src/asterisk-1.4.1
8. Run the asterisk.patch (patch -p0 < asterisk.patch)
9. Manually patch the spandsp line in configure.ac if the patch doesn't succeed.
10. If you need copy app_nv_faxdetect-1.0.6_1.c and app_nv_backgrounddetect-1.0.6_1.c to /usr/src/asterisk-1.4.1/apps (you can find them on the net, I got my copy from x68k.net) - these help to detect faxes.
11. Run bootstrap.sh
12. Run configure
13. Run make menuselect
14. Make sure rxfax and txfax is listed under Applications. Make your selections under various sections
15. x to exit and save
16. Run make
17. Once make completes, run make install.

That's it.

Posted by Sems on 3/4/2007 3:00:00 AM

Hi Sems,

Thx for your manual. I am running Asterisk 1.4.1 on Debian 3.1 (2.6.8-3-386) and have experienced the same troubles. I did every thing according to your steps, but the result was the same - Asterisk crashed as soon the rxfax is accessed in the dialplan.

The only difference was that the app_ entry did not come up in the menu (even not as unavailable). I did also implement the mentioned hack - no change.

Thx for some tips in advance,
Alex

Posted by Alex on 3/6/2007 3:00:00 AM

Hi Alex,

If app_rxfax and app_txfax was not listed in your menuselect, then you might not have recompiled it and probably using the old copy. Make sure to remove files from /usr/lib/asterisk/modules before running make install in asterisk source folder.

Also, when did you grab the copies of rxfax and txfax, there had been recent updates.

If you are still stuck, shoot an email to sems at sems dot org and we can take it from there.

Posted by Sems on 3/7/2007 3:00:00 AM

Dear Sems,

I follow your instruction and install in fedora 6.
Finishing the patch and when doing make...
Everything seems ok. But app_rxfax.c compile generate
[cc'> app_rxfax.c -> app_rxfax.o
app_rxfax.c:79: warning: 't30_flush' defined but not used
[ld'> app_rxfax.o -> app_rxfax.so
....

although I find the app_rxfax.so is compiled out, but I have no luck in receipt any fax, but fax out is ok.

Is t30_flush a problem?

Many thanks for your advise.

B. Rdgs., Ken

Posted by Ken Lin (email) on 3/17/2007 3:00:00 AM

I believe it could be the problem, though I am not the author of the software.

Which version of spandsp libraries are you using? I have seen this error before on some mailing lists, caused by the version of spandsp.

Which version of asterisk? Also make sure you only have one copy of spandsp, multiples will cause issues.

Try uninstalling all copies of spandsp, then start over. As the spandsp faq suggests, some versions of spandsp can create issues, see http://www.soft-switch.org/spandsp_faq/ar01s12.html

Posted by Sems on 3/17/2007 3:00:00 AM

Hi Alex

I have followed these steps and im still having issues.
I have installed

Asterisk 1.4.2
spandsp 0.0.3pre28


dtmfmode=rfc2833
insecure=very
nat=yes
disallow=all
allow=ulaw
t38pt_udptl= yes
qualify=yes
canreinvite=yes


(I have tried 1.4 and 1.4.0 exact same issue)

Everything compiles ok

Everything works in terms of voice but faxing gives me this error.

- Attempting call on SIP/XXXXXXX@XXXXXXXXXXXfor application txfax(/tmp/test.tif|XXXXX|debug) (Retry 2)
> Channel SIP/XXXXXXXXXX-081da5b8 was answered.
> Launching txfax(/tmp/test.tif|XXXXXXXXX|debug) on SIP/XXXXXXXXX-081da5b8
[mar 26 12:03:27'> WARNING[21854'>: rtp.c:1116 ast_rtp_read: RTP Read too short
[mar 26 12:03:27'> WARNING[21854'>: rtp.c:1116 ast_rtp_read: RTP Read too short
[mar 26 12:03:27'> WARNING[21854'>: rtp.c:1116 ast_rtp_read: RTP Read too short
[mar 26 12:03:27'> WARNING[21854'>: rtp.c:1116 ast_rtp_read: RTP Read too short
[mar 26 12:03:27'> WARNING[21854'>: rtp.c:1116 ast_rtp_read: RTP Read too short


This warning is repeated maybe 100 times or so.

It is the same for rx fax.

Any ideas would help.

Dave

Posted by Dave (email) on 3/25/2007 3:00:00 AM

Hi Dave,

Take a look at:

http://lists.digium.com/pipermail/asterisk-dev/2005-June/013349.html

and

http://www.mail-archive.com/openpbx-dev@openpbx.org/msg00385.html

I never used the t38pt_udptl parameter in my setup and set canreinvite to no, see if this helps. Also with 1.4, insecure = very is depriciated, you should use insecure=port,invite




Posted by Sems on 3/26/2007 3:00:00 AM

- Asterisk 1.4.2
- spandsp 0.0.3pre28

Followed the instructions and I have successfully built Asterisk with rx_fax and tx_fax. Trouble is, whenever there is an incoming fax, Asterisk would crash:

-- Executing [s@incoming:25'> BackGround("Zap/5-1",
"Custom/Home/home-menu") in new stack
-- <Zap/5-1> Playing 'Custom/Home/home-menu' (language 'en')
-- Redirecting Zap/5-1 to fax extension
== Spawn extension (incoming, fax, 0) exited non-zero on 'Zap/5-1'
-- Executing [fax@incoming:1'> GotoIf("Zap/5-1", "0?s|40:2") in new stack
-- Goto (incoming,fax,2)
-- Executing [fax@incoming:6'> RxFAX("Zap/5-1",
"/var/spool/faxes/20070326-150200.tif") in new stack
asterisk*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
asterisk:/usr/src/1.4/asterisk#

Hope you can shine some light at this!

Thanks in advance.
-Heison

Posted by Heison Chak on 3/26/2007 3:00:00 AM

I haven't tried rxfax/txfax with Zaptel, my experience is majorly with SIP. With that said, spandsp can be very picky, as I stated couple of comments earlier. So, I'd suggest couple of items:

1. Uninstall all spandsp versions, grab another version, the one I used worked so far on 3 different platforms (all debian based).

2. There might be an issue with spandsp's dependencies, such as libtiff.

3. Turn on full debug logging, setup through logger.conf and set verbose and debug levels to at least 4 and see if the logs will tell anything more.

Btw, which OS are you running? What is kernel version?

Posted by Sems on 3/26/2007 3:00:00 AM

It's Debian Etch with 2.6.8-2-386. I have libtiff 3.7.2-7, is that the same as what you're running?

I have noticed toward the end of my spandsp-0.0.3pre28
installation, make check returns the following:

# make check
Making check in src
make[1'>: Entering directory `/usr/src/1.4/spandsp-0.0.3/src'
make[1'>: Leaving directory `/usr/src/1.4/spandsp-0.0.3/src'
make[1'>: Entering directory `/usr/src/1.4/spandsp-0.0.3'
make[1'>: Nothing to be done for `check-am'.
make[1'>: Leaving directory `/usr/src/1.4/spandsp-0.0.3'

Can you also comment on app_nv_backgrounddetect & app_nv_faxdetect? I can only build them after commenting out one of the integer declaration (STANDARD_HANGUP_LOCALUSERS). However, Asterisk refuses to load the apps :(

Posted by Heison Chak on 3/27/2007 3:00:00 AM

I have tried removing spandsp (make uninstall) and installing the 20061206 and 20070327 snapshots, I'm getting the same behavior, Asterisk would crash when RxFAX is called:

[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'BackGround'
-- Executing [s@incoming:25'> BackGround("Zap/5-1", "Custom/Home/home-menu") in new stack
[mar 28 12:59:25'> DEBUG[2743'>: devicestate.c:161 ast_device_state: No provider found, checking channel drivers for Zap - 5
[mar 28 12:59:25'> DEBUG[2743'>: devicestate.c:287 do_state_change: Changing state for Zap/5 - state 2 (In use)
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:2845 set_format: Set channel Zap/5-1 to write format gsm
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:1997 ast_settimeout: Scheduling timer at 160 sample intervals
-- <Zap/5-1> Playing 'Custom/Home/home-menu' (language 'en')
[mar 28 12:59:25'> DEBUG[2871'>: chan_zap.c:4790 zt_read: DTMF digit: f on Zap/5-1
-- Redirecting Zap/5-1 to fax extension
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:1480 ast_softhangup_nolock: Soft-Hanging up channel 'Zap/5-1'
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:1997 ast_settimeout: Scheduling timer at 0 sample intervals
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:2845 set_format: Set channel Zap/5-1 to write format ulaw
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:2393 __ast_pbx_run: Spawn extension (incoming,fax,0) exited non-zero on 'Zap/5-1'
== Spawn extension (incoming, fax, 0) exited non-zero on 'Zap/5-1'
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1648 pbx_substitute_variables_helper_full: Function result is '20070328-125925'
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'Set'
-- Executing [fax@incoming:1'> Set("Zap/5-1", "TIMESTAMP=20070328-125925") in new stack
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'Set'
-- Executing [fax@incoming:2'> Set("Zap/5-1", "FAXDIR=/var/spool/faxes") in new stack
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'Set'
-- Executing [fax@incoming:3'> Set("Zap/5-1", "TIFFILE=/var/spool/faxes/20070328-125925.tif") in new stack
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'Set'
-- Executing [fax@incoming:4'> Set("Zap/5-1", "PDFFILE=/var/spool/faxes/20070328-125925.pdf") in new stack
[mar 28 12:59:25'> DEBUG[2871'>: pbx.c:1795 pbx_extension_helper: Launching 'RxFAX'
-- Executing [fax@incoming:5'> RxFAX("Zap/5-1", "/var/spool/faxes/20070328-125925.tif") in new stack
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:2845 set_format: Set channel Zap/5-1 to read format slin
[mar 28 12:59:25'> DEBUG[2871'>: channel.c:2845 set_format: Set channel Zap/5-1 to write format slin
asterisk*CLI>
Disconnected from Asterisk server
Executing last minute cleanups
asterisk:~#

Posted by Heison Chak on 3/28/2007 3:00:00 AM

On the Debian Etch box we have, I am running libtiff4, v. 3.8.2-7, and on the Kubuntu box, it is 3.8.2-6. Both are using spandsp from 20061206 snapshots.

I just checked my notes and here is some more details:

1. Download and untar the spandsp.
2. apt-get install libtiff4-dev
3. cd /usr/src/spandsp-0.0.3
4. ./configure --prefix=/usr
5. make
6. make install
7. Add /usr/local/lib to /etc/ld.so.conf, run ldconfig
8. cd /usr/src/asterisk-1.4.1/apps
wget http://www.sems.org/content/download/asterisk/app_nv_faxdetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_nv_backgrounddetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_rxfax.c
wget http://www.sems.org/content/download/asterisk/app_txfax.c

9. cd /usr/src/asterisk-1.4.1/
wget http://www.sems.org/content/download/asterisk/asterisk.patch
patch -p0 < asterisk.patch

10. Edit configure.ac manually to add:
AST_EXT_LIB_SETUP([spandsp'>, [spandsp library'>, [spandsp'>)

11. apt-get install autoconf automake
./bootstrap.sh
./configure
make menuselect
make
make install

These were the relevant steps to faxing on my third box. I put the src files I used so you can directly download what I used.

There wasn't anything special to app_nv_faxdetect and app_nv_backgrounddetect. They compiled from the sources I found just fine.

Is there any chance you can try it out with a SIP trunk? Like I said, I never done it with ZAP and can't point you to what might be wrong, if there is something related to your zaptel or zapata conf files.

Posted by Sems on 3/28/2007 3:00:00 AM

okay, here's what I got:

PSTN -- FXO(x100P), FXS (TDM400) -- Fax machine

If I tried to send fax to Asterisk from the PSTN, it would fail 99% of the time (it worked 99% with 1.2.15)

If I tried to send fax to Asterisk from fax machine connected to Asterisk via FXS, it works 100% of the time (it also worked 100% with 1.2.15)

The funny thing I found out last night, rxfax() gets a disconnect signal by something and call gets terminated after rxfax() even though the dialplan hasn't completed.


Here's the dialplan:
exten => astfax,1,Set(TIMESTAMP=${STRFTIME(${EPOCH},GMT+8,%Y%m%d-%H%M%S)})
exten => astfax,n,Set(FAXDIR=/var/spool/faxes)
exten => astfax,n,Set(TIFFILE=${FAXDIR}/${TIMESTAMP}.tif)
exten => astfax,n,Set(PDFFILE=${FAXDIR}/${TIMESTAMP}.pdf)
exten => astfax,n,rxfax(${TIFFILE})
exten => astfax,n,System('/usr/bin/tiff2pdf -o ${PDFFILE} ${TIFFILE})
exten => astfax,n,System('rm ${TIFFILE}')
exten => astfax,n,Set(EMAIL=heison@chak.ca)
exten => astfax,n,System('/var/lib/asterisk/agi-bin/fax_to_email.sh ${PDFFILE}')


and the disconnect (from a successful fax on FXS):
#
-- Executing [astfax@incoming:5'> RxFAX("Zap/4-1", "/var/spool/faxes/20070328-223241.tif") in new stack
#

#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:143 phase_d_handler: ==============================================================================
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:144 phase_d_handler: Pages transferred: 1
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:145 phase_d_handler: Image size: 1728 x 2137
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:146 phase_d_handler: Image resolution 8037 x 7700
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:147 phase_d_handler: Transfer Rate: 9600
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:148 phase_d_handler: Bad rows 1
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:149 phase_d_handler: Longest bad row run 1
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:150 phase_d_handler: Compression type 3
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:151 phase_d_handler: Image size (bytes) 0
#
[mar 28 22:33:47'> DEBUG[14138'>: app_rxfax.c:152 phase_d_handler: ==============================================================================
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:98 phase_e_handler: ==============================================================================
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:99 phase_e_handler: Fax successfully received.
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:100 phase_e_handler: Remote station id: 9058874694
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:101 phase_e_handler: Local station id:
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:102 phase_e_handler: Pages transferred: 1
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:103 phase_e_handler: Image resolution: 8037 x 7700
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:104 phase_e_handler: Transfer Rate: 9600
#
[mar 28 22:33:49'> DEBUG[14138'>: app_rxfax.c:105 phase_e_handler: ==============================================================================
#
[mar 28 22:33:51'> DEBUG[14138'>: chan_zap.c:4493 __zt_exception: Exception on 19, channel 4
#
[mar 28 22:33:51'> DEBUG[14138'>: chan_zap.c:3614 zt_handle_event: Got event On hook(1) on channel 4 (index 0)
#
[mar 28 22:33:51'> DEBUG[14138'>: chan_zap.c:1465 zt_disable_ec: disabled echo cancellation on channel 4
#
[mar 28 22:33:51'> DEBUG[14138'>: app_rxfax.c:329 rxfax_exec: Got hangup
#
[mar 28 22:33:51'> DEBUG[14138'>: channel.c:2845 set_format: Set channel Zap/4-1 to read format ulaw
#
[mar 28 22:33:51'> DEBUG[14138'>: channel.c:2845 set_format: Set channel Zap/4-1 to write format ulaw


I thought it might be a problem with Zaptel, and so I tried using zaptel 1.2.12 with Asterisk 1.4.2, I can make and receive calls on TDM and I'm getting very similar symptom (rxfax disconnects without completing dialplan).

This morning I tried connecting fax machine to a linksys 3102 and the fax went through one out of the 5 times I tried. And eventhough Asterisk received the fax, I also experienced a disconnection without completing the dialplan.

I'm going to follow your steps and reinstall spandsp.

Posted by Heison Chak on 3/29/2007 3:00:00 AM

Rxfax is supposed to do that. Then you handle the fax via hangup (h) extension along with DeadAGI.

For example:

exten => h,1,GotoIf($[${receivedafax} = 1'>?h,receivedafax:h,receivedavoice)
exten => h,n(receivedafax),DeadAGI(receivefax.php|${FAXFILE}|${EMAILADDR}|${CALLERIDNUM}|${CALLERIDNAME})
exten => h,n(receivedavoice),Hangup

Posted by Sems on 3/29/2007 3:00:00 AM

After reinstalling everything, it's still the same... I can receive fax from FXS, but not FXO. I have tried SIP trunk, it works fine on the FXS port but not on the FXO (PSTN) side.

And thanks for pointing out the hangup normality, that's another change I have to get used to since 1.2 ;)

Posted by Heison Chak on 3/29/2007 3:00:00 AM

With a linksys 3102, I'm having trouble receiving fax on the PSTN interface. NVBackGroundDetect recognized RTP 100 and spawn rxfax() but the connection was soon dropped by channel.c due to incompatible voice frame.
I'm going to try including 100 in frame.h and try again.


-- Executing [s@incoming:23'> System("SIP/sipura-fxo-0823af70", "/bin/echo -n -e ""Soma Networks" <4169774584>" | nc -w 1 10.155.1.9 10629 &") in new stack
-- Executing [s@incoming:24'> NVBackgroundDetect("SIP/sipura-fxo-0823af70", "Custom/Home/home-menu") in new stack
-- <SIP/sipura-fxo-0823af70> Playing 'Custom/Home/home-menu' (language 'en')
[mar 30 11:19:33'> NOTICE[27281'>: app_nv_backgrounddetect-1.0.6_1.c:222 nv_background_detect_exec: Redirecting SIP/sipura-fxo-0823af70 to fax extension
-- Executing [fax@incoming:1'> Answer("SIP/sipura-fxo-0823af70", "") in new stack
-- Executing [fax@incoming:2'> Goto("SIP/sipura-fxo-0823af70", "incoming_fax|fax|1") in new stack
-- Goto (incoming_fax,fax,1)
-- Executing [fax@incoming_fax:1'> Set("SIP/sipura-fxo-0823af70", "TIMESTAMP=20070330-111933") in new stack
-- Executing [fax@incoming_fax:2'> Set("SIP/sipura-fxo-0823af70", "FAXDIR=/var/spool/faxes") in new stack
-- Executing [fax@incoming_fax:3'> Set("SIP/sipura-fxo-0823af70", "TIFFILE=/var/spool/faxes/20070330-111933.tif") in new stack
-- Executing [fax@incoming_fax:4'> Set("SIP/sipura-fxo-0823af70", "PDFFILE=/var/spool/faxes/20070330-111933.pdf") in new stack
-- Executing [fax@incoming_fax:5'> RxFAX("SIP/sipura-fxo-0823af70", "/var/spool/faxes/20070330-111933.tif") in new stack
[mar 30 11:19:33'> NOTICE[27281'>: channel.c:2287 __ast_read: Dropping incompatible voice frame on SIP/sipura-fxo-0823af70 of format slin since our native format has changed to ulaw
-- Executing [h@incoming_fax:1'> System("SIP/sipura-fxo-0823af70", "/usr/bin/tiff2pdf -o /var/spool/faxes/20070330-111933.pdf /var/spool/faxes/20070330-111933.tif") in new stack
-- Executing [h@incoming_fax:2'> System("SIP/sipura-fxo-0823af70", "rm /var/spool/faxes/20070330-111933.tif") in new stack
-- Executing [h@incoming_fax:3'> Set("SIP/sipura-fxo-0823af70", "EMAIL=heison@chak.ca") in new stack
-- Executing [h@incoming_fax:4'> System("SIP/sipura-fxo-0823af70", "/var/lib/asterisk/agi-bin/fax_to_email.sh /var/spool/faxes/20070330-111933.pdf") in new stack
-- Executing [h@incoming_fax:5'> System("SIP/sipura-fxo-0823af70", "/usr/bin/rsync -e ssh -aHq /var/spool/faxes/* bartlett-fs:/export/samba/INCOMING_FAX") in new stack
-- Executing [h@incoming_fax:6'> Hangup("SIP/sipura-fxo-0823af70", "") in new stack
== Spawn extension (incoming_fax, h, 6) exited non-zero on 'SIP/sipura-fxo-0823af70'

Posted by Heison Chak on 3/30/2007 3:00:00 AM

I remember people complaining about Sipura with faxes, something related to T38, if I am not mistaken.

I haven't tried faxing with Sipura yet, but it is on my to do list, hopefully this weekend, I got a Sipura 3000.

One note though, I have similar line of error, related to slin and ulaw, but on my system the fax comes through fine.

-- Executing [416xxxyyzzzz@from_mci:1'> Set("SIP/5060-08f8bb58", "FAXRECEPIENT=416xxxyyzzzz") in new stack
-- Executing [416xxxyyzzzz@from_mci:2'> Goto("SIP/5060-08f8bb58", "fax|s|1") in new stack
-- Goto (fax,s,1)
-- Executing [s@fax:1'> Answer("SIP/5060-08f8bb58", "") in new stack
-- Executing [s@fax:2'> Set("SIP/5060-08f8bb58", "CALLERIDNUM=") in new stack
-- Executing [s@fax:3'> Set("SIP/5060-08f8bb58", "CALLERIDNAME=") in new stack
-- Executing [s@fax:4'> PlayTones("SIP/5060-08f8bb58", "ring") in new stack
-- Executing [s@fax:5'> NVFaxDetect("SIP/5060-08f8bb58", "6") in new stack
[mar 30 19:34:43'> NOTICE[13661'>: app_nv_faxdetect-1.0.6_1.c:222 nv_detectfax_exec: Redirecting SIP/5060-08f8bb58 to fax extension
-- Executing [fax@fax:1'> StopPlayTones("SIP/5060-08f8bb58", "") in new stack
-- Executing [fax@fax:2'> NoOp("SIP/5060-08f8bb58", "416xxxyyzzzz") in new stack
-- Executing [fax@fax:3'> Set("SIP/5060-08f8bb58", "RECEIVEDAFAX=1") in new stack
-- Executing [fax@fax:4'> Macro("SIP/5060-08f8bb58", "faxreceive|416xxxyyzzzz") in new stack
-- Executing [s@macro-faxreceive:1'> Set("SIP/5060-08f8bb58", "FAXFILE=/var/spool/asterisk/fax/1175297679.1722.tif") in new stack
-- Executing [s@macro-faxreceive:2'> Set("SIP/5060-08f8bb58", "EMAILADDR=abc@def.com") in new stack
-- Executing [s@macro-faxreceive:3'> GotoIf("SIP/5060-08f8bb58", "0?103") in new stack
-- Executing [s@macro-faxreceive:4'> RxFAX("SIP/5060-08f8bb58", "/var/spool/asterisk/fax/1175297679.1722.tif") in new stack
[mar 30 19:34:43'> NOTICE[13661'>: channel.c:2287 __ast_read: Dropping incompatible voice frame on SIP/5060-08f8bb58 of format slin since our native format has changed to ulaw
-- Executing [h@fax:1'> GotoIf("SIP/5060-08f8bb58", "1?h|receivedafax:h|receivedavoice") in new stack
-- Goto (fax,h,2)
-- Executing [h@fax:2'> DeadAGI("SIP/5060-08f8bb58", "apps/receivefax.php|/var/spool/asterisk/fax/1175297679.1722.tif|abc@def.com||") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/apps/receivefax.php
-- AGI Script apps/receivefax.php completed, returning 0
-- Executing [h@fax:3'> Hangup("SIP/5060-08f8bb58", "") in new stack
== Spawn extension (fax, h, 3) exited non-zero on 'SIP/5060-08f8bb58'

Posted by Sems on 3/30/2007 3:00:00 AM

Which ATA are you using, if you don't mind sharing?

Posted by Heison Chak on 3/31/2007 3:00:00 AM

I am not using any ATA for my system. Faxes come from SIP, converted to pdf and emailed. Outgoing faxes are sent via email, I download and process the messages, convert pdf to tiff and fax it out.

Posted by Sems on 4/1/2007 3:00:00 AM

After 6 hours and many headhechs, I found your post.

IN one word : THANKS!

The steps above work fully with spandsp-0.0.4 and Asterisk 1.4.4 ...

Humberto

Posted by Humberto on 5/5/2007 3:00:00 AM

Glad to hear it worked out well and it works fine with 0.0.4 and 1.4.4. I am still running 0.0.3 and 1.4.1 on our production environment. Time to test those two :)

Posted by Sems on 5/6/2007 3:00:00 AM

Upgraded to Asterisk 1.4.4 and came across some problems with app_nv_backgrounddetect and app_nv_faxdetect.

I got both files from here:

wget http://x68k.net/download/Asterisk/app_nv_backgrounddetect-1.0.6_1.c
wget http://x68k.net/download/Asterisk/app_nv_faxdetect-1.0.6_1.c

and had to comment out:

LOCAL_USER_ADD(u);
LOCAL_USER_REMOVE(u);
STANDARD_HANGUP_LOCALUSERS;

for them to build. However, after the compilation, it doesn't register itself into Asterisk (the .so files are in /usr/lib/asterisk/modules after make install, but aren't loaded as applications when Asterisk starts).

Turns out both .c files are missing its last line (it was there when I wget the files back in March 20, 2007)
# for app_nv_backgrounddetect
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "NV BG Detection Application");

# for app_nv_faxdetect
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "NV Fax Detection Application");

Putting those 2 lines back in and make && make install, now i can see the applications being registered.

Posted by Heison Chak (email) on 5/11/2007 3:00:00 AM

I wonder x68k.net has made changes to the files. I used the files I downloaded couple of months ago and they compiled and registered fine under 1.4.4

Posted by Sems on 5/21/2007 3:00:00 AM

I tried downloading the files again from x68k.net and they did not install under 1.4.4. I'm getting what appears to be a similar error, and it looks like editing the files takes care of the error for nv_faxdetect and nv_backgrounddetect

Makes me nervous editing files though!

If it hadn't been for this site I'd still be scratching my head......

Posted by Kev (email) on 6/17/2007 3:00:00 AM

It seems like the original files I got from x68k.net still works. If you need them they are at:

http://www.sems.org/content/download/asterisk/app_nv_faxdetect-1.0.6_1.c
http://www.sems.org/content/download/asterisk/app_nv_backgrounddetect-1.0.6_1.c
http://www.sems.org/content/download/asterisk/app_rxfax.c
http://www.sems.org/content/download/asterisk/app_txfax.c

I upgraded two more systems to 1.4.4 and they worked fine. Tried sending/receiving faxes on each system.

Posted by Sems on 6/17/2007 3:00:00 AM

Patch for version 1.4.10.1
Includes app_rxfax.c, app_txfax.c and the respective patch. You still need to compile your own spandsp.

http://pllamosas.googlepages.com/asterisk-fax-patch

Posted by pllamosas on 8/10/2007 3:00:00 AM

Thanks pllamosas,

As far I can see from your patch, nothing new is there, just the patch now contains app_rxfax.c and app_txfax.c, right?


Posted by Sems on 8/11/2007 3:00:00 AM

Hi

I think I have followed all the instructions you gave - btw GREAT POSTING.
I am trying to make RxFax work with Asterisk 1.4.10.1 .
I have applied the patch and compiled everything but still it crashes whenever RxFax kicks in.

Are you sure this is all about the build process? As I understand from here, all the successes are with SIP, not with Zaptel. In my environment, I use Zap.

I have tried to use the following combinations:
spandsp-0.0.3 with libtiff 0.8.2
spandsp-20061206 with libtiff 0.8.2
spandsp-20061206 with libtiff 0.8.2 when app_rxfax.so is compiled with '-static'
spandsp-20061206 with libtiff 0.6.1
spandsp-0.0.4(20070813) with libtiff 0.8.2
spandsp-0.0.4(20070813) with libtiff 0.8.2 when app_rxfax.so is compiled with '-static'
spandsp-0.0.4(20070813) with libtiff 0.6.1
spandsp-0.0.4(20070813) with libtiff 0.6.1 app_rxfax.so is compiled with '-static'

All the tests produces crashes. The difference was where it crashed. Sometimes it crashed after the hangup and sometimes immediately after answering the fax call.

Is there anything I can change in my environment and produce more test results?

Posted by Isaac Aaron on 8/18/2007 3:00:00 AM

What is your extensions.conf showing? Did you try increasing verbosity and debug levels on Asterisk, they might give you a clue.

Also make sure there is only one copy of spandsp on the system at all times, sometimes there are left over symlinks to other versions and it can cause troubles.

One last thing, though I don't think it is a Zap channel issue, you can get a free SIP account, and first try to set everything through SIP. Once all is fine, you can try to make it work Zap.

I haven't tried 1.4.10.1 with fax yet, it might also be an issue there. 1.4.4 is the last version I tested with fax.

Posted by Sems on 8/18/2007 3:00:00 AM

The verbose and debug logs do not show anything helpful.

gdb does tell that the offending code comes from spandsp, however I believe that if other people are successful in using RxFax without modifying the code, then I should too.

Here is the callstack:


#0 0x005b4c4c in _int_malloc () from /lib/tls/libc.so.6
#1 0x005b66e1 in malloc () from /lib/tls/libc.so.6
#2 0x005bb3b0 in strdup () from /lib/tls/libc.so.6
#3 0x06e48700 in t4_rx_init (s=0xffffffe8, file=0x1324858 "/tmp/fax2.tiff",
output_encoding=2) at t4.c:1080
#4 0x06e50d12 in process_rx_dcs (s=0x1313ec0, msg=Variable "msg" is not available.) at t30.c:1893
#5 0x06e51159 in hdlc_accept_control_msg (s=0x1313ec0, ok=Variable "ok" is not available.) at t30.c:3305
#6 0x06e3d1e8 in rx_flag_or_abort (s=0x1324b0c) at hdlc.c:297
#7 0x06e376e5 in fsk_rx (s=0x1324ee4, amp=0x95f9534, len=160) at fsk.c:349
#8 0x06e368b3 in fax_rx (s=0x1313ec0, amp=0x95f9534, len=160) at fax.c:167
#9 0x00964c2c in rxfax_exec (chan=0x9612730, data=0x132a8c0)
at app_rxfax.c:308
#10 0x080c9571 in pbx_extension_helper (c=0x9612730, con=Variable "con" is not available.) at pbx.c:532
#11 0x080ca8bf in __ast_pbx_run (c=0x9612730) at pbx.c:2288
#12 0x080cbc2f in ast_pbx_run (c=0x9612730) at pbx.c:2644
#13 0x05ad3c1a in ss_thread (data=0x9612730) at chan_zap.c:6522
#14 0x080f97f5 in dummy_start (data=0x9619990) at utils.c:775
#15 0x003d33cc in start_thread () from /lib/tls/libpthread.so.0
#16 0x0061ac3e in clone () from /lib/tls/libc.so.6

Here is the full log during the tranfer:

[aug 18 14:33:24'> DEBUG[27496'> channel.c: Set channel Zap/1-1 to read format ulaw
[aug 18 14:33:24'> DEBUG[27496'> channel.c: Set channel Zap/1-1 to write format ulaw
[aug 18 14:33:24'> DEBUG[27496'> app_rxfax.c: ==============================================================================
[aug 18 14:33:24'> DEBUG[27496'> app_rxfax.c: Fax receivenot successful - result
(61) The call dropped prematurely.
[aug 18 14:33:24'> DEBUG[27496'> app_rxfax.c: ====================================
==========================================
[aug 18 14:33:24'> DEBUG[27496'> pbx.c: Extension fax, priority 3 returned normally even though call was hung up
[aug 18 14:33:24'> DEBUG[27496'> channel.c: Soft-Hanging up channel 'Zap/1-1'
[aug 18 14:33:24'> DEBUG[27496'> channel.c: Hanging up channel 'Zap/1-1'
[aug 18 14:33:24'> DEBUG[27496'> chan_zap.c: zt_hangup(Zap/1-1)
[aug 18 14:33:24'> DEBUG[27496'> chan_zap.c: Hangup: channel: 1 index = 0, normal
= 13, callwait = -1, thirdcall = -1
[aug 18 14:33:24'> DEBUG[27496'> chan_zap.c: disabled echo cancellation on channel 1
[aug 18 14:33:24'> DEBUG[27496'> chan_zap.c: Set option TDD MODE, value: OFF(0) on Zap/1-1
[aug 18 14:33:24'> DEBUG[27496'> chan_zap.c: Updated conferencing on 1, with 0 conference users
[aug 18 14:33:24'> VERBOSE[27496'> logger.c: -- hungup 'Zap/1-1'

<<crash>>

Any ideas?

Posted by Isaac Aaron on 8/18/2007 3:00:00 AM

Did you get the latest app_rxfax.c code? You can grab it from spandsp snapshots folder or http://www.sems.org/content/download/asterisk/app_rxfax.c

That one is working for me with 1.4.4, haven't tried it yet with 1.4.10.1 (hopefully they haven't broke it during the code changes). If possible try switching back to 1.4.4, as I know that works fine for me.

Besides these, all I can think of is to try and see if it will work via SIP, to eliminate possibility of ZAP problems.

Posted by Sems on 8/18/2007 3:00:00 AM

I used the app_tx/rxfax files that came from the snapshots directory.

using http://www.sems.org/content/download/asterisk/app_rxfax.c
produces the same error.

As for the SIP test, I ran another asterisk on a virtual machine and created a SIP extension. The asterisk running rxfax did not crash, but it did not receive the fax either. Instead it complained about a premature hangup. I tried switching alaw/ulaw codecs with no result. I also didn't hear the fax handshake noise (which I do hear when zap answers). The virtual machine is running exactly the same asterisk+packages as the asterisk connected to the FXO.

I tried downgrading to 1.4.4 and it still crashed with the zap.

I am using CentOS 4 with the latest 'yum update'. All the dependencies were manually downloaded and installed to a relocated path. Can you provide some more details about your environment so we can comparre?
Do you have a copy of the spandsp source that is running on your production environment?

Here is an "ls" of my "/usr/src". This can also be used as a list of packages incorporated into or used with the asterisk installation:
autoconf-2.60 mysql-5.0.45.tar.gz spandsp-20061206.tar.gz
curl-7.16.4 net-snmp-5.4.1 spandsp-20070413.tar.gz
curl-7.16.4.tar.gz net-snmp-5.4.1.tar.gz spandsp-20070813.tar.gz
e1000-7.6.5 newt-0.52.2 speex-1.2beta2
e1000-7.6.5.tar.gz newt-0.52.2.tar.gz speex-1.2beta2.tar.gz
freetds-0.64 openh323_1.12.2.tar.gz sqlite-3.4.1
freetds-0.64.tar.gz openh323_v1_19_0_1 sqlite-3.4.1.tar.gz
iksemel-1.3 openh323-v1_19_0_1-src-tar.gz stund
iksemel-1.3.tar.gz openssl-0.9.8e stund_0.96_Aug13.tgz
imap-2006j openssl-0.9.8e.tar.gz tiff-3.7.1
imap.RELEASE.tar pwlib tiff-3.7.1.tar.gz
kernels pwlib_1.5.2.tar.gz tiff-3.8.2
libogg-1.1.3 pwlib-v1_10_3-src-tar.gz tiff-3.8.2.tar.gz
libogg-1.1.3.tar.gz pwlib_v1_11_0 tiff-v3.6.1
libvorbis-1.2.0 pwlib-v1_11_0-src-tar.gz tiff-v3.6.1.tar.gz
libvorbis-1.2.0.tar.gz radiusclient-ng-0.5.6 unixODBC-2.2.12
m4-1.4.10 radiusclient-ng-0.5.6.tar.gz unixODBC-2.2.12.tar.gz
mpg123-0.67 redhat zlib-1.2.3
mpg123-0.67.tar.bz2 spandsp-0.0.3.tgz zlib-1.2.3.tar.gz
mysql-5.0.45 spandsp-0.0.4


Thanks in advance
Isaac

Posted by Isaac Aaron on 8/19/2007 3:00:00 AM

The production environment is running Debian Sarge, with kernel 2.6.18.4. Anything that was not included in Debian packages is compiled from source, including Asterisk (1.4.4).

Autoconf - 2.61.4
Spandsp - spandsp-20061206.tar.gz (v 0.0.3)
Freetds 0.62.4
Openh323 v1.18.0
PWLib v1.10.0
Libtiff-tools 3.8.2-7
Libtiff4 3.8.2-7
Libtiff4-dve 3.8.2-7

I have place spandsp.tar.gz to http://www.sems.org/content/download/asterisk/spandsp.tar.gz, just tar'd it from my /usr/src.

Posted by Sems on 8/20/2007 3:00:00 AM

HI,

Moving my test system from asterisk/zaptel v1.2 to v1.4 resulted in a strange symptom I could not resolve.

zaptel svn 1.4 and asterisk svn 1.4 (SVN-branch-1.4-r81426M) with no spandsp & fax support compiles & runs fine, with all audio codec having good quality.

Then I installed spandsp (spandsp-0.0.3.tgz/spandsp-0.0.4pre9.tgz) and patched asterisk like so, this is Debian etch kernel 2.6.21:

apt-get install libtiff4-dev
cd /usr/src/spandsp-0.0.3 (or 0.0.4)
./configure --prefix=/usr
make
make install
cd /usr/src/asterisk-1.4/apps
wget http://www.sems.org/content/download/asterisk/app_nv_faxdetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_nv_backgrounddetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_rxfax.c
wget http://www.sems.org/content/download/asterisk/app_txfax.c
cd ..
wget http://www.sems.org/content/download/asterisk/asterisk.patch
patch -p0 < asterisk.patch

The patch fails on configure.ac so I manually added:
AST_EXT_LIB_SETUP([spandsp'>, [spandsp library'>,[spandsp'>)

apt-get install autoconf automake
./bootstrap.sh
./configure
make menuselect (Verify that rxfax/txfax are selected)
make
make install

This all results in a functional fax in asterisk, but all audio codecs apart from gsm sounds *very* metallic to the point of not being usable.

Does this ring any bell?

Any pointer will be greatly appreciated.

Regards,

Dudi Goldenberg
CTO
Kolcore Ltd.

Posted by ikaRus (email) on 10/13/2007 3:00:00 AM

Never had such an issue, so I don't know what's causing the issue. Spandsp should not affect the codec quality. Do you see any high cpu usage? Did you try the release code, instead of SVN?

Posted by Sems on 10/13/2007 3:00:00 AM


Yes I did...

I tried 1.4.3, latest stable with the same results.

cpu is idle, that machine has a gig of memory so this is not a problem as well.

One thing I forgot to mention - the distortion is always one way, and always the same direction.

Like dialing *60 I get a distorted verbal time.

If I call another extention, I hear the other ext. distorted, but the other ext. hears me just fine.

Again - if I select gsm, everything works like expected.

I tried to implement spandsp 1.2 (works fine on my asterisk/zaptel 1.2 combos), rxfax did not compile, complained about T30 something so I did not invest any time is this.

Regards,

Dudi

Posted by ikaRus (email) on 10/14/2007 3:00:00 AM

That's a weird situation, I have to admit, because it is not all codecs are broken, it is just most. You can try to install some pre-compiled codecs from other systems.

Take a look at:

http://asterisk.hosting.lv/

See if G729 and G723 gives you issues as well.

Posted by Sems on 10/14/2007 3:00:00 AM


We do have G729 licenses, this will be an interesting experiment.

I'll try G729 and have a look at the above link.

Thanks a million, I'll keep u updated on the results.

Dudi

Posted by ikaRus (email) on 10/14/2007 3:00:00 AM

No problems, glad to help :)

Posted by Sems on 10/14/2007 3:00:00 AM

Well,

I tested the G729 codecs, worked fine.

SO - this must be screwed during compilation.

So I started fresh, to a working asterisk/zaptel 1.4, no spandsp, no fax, good sound quality.

I saved the codec modules, repeated the spandsp 0.0.4/rxfax & txfax procedure to a working fax solution with bad sound quality just like before.

I then restored the saved codecs, now I have a working fax and a good sound quality.


I can send u codec_alaw.so (or any other) - both working & non working versions for analysis if u think it will help others.

Regards,

Dudi

Posted by ikaRus (email) on 10/15/2007 3:00:00 AM

Glad to hear all is well. I am no expert in debugging compiled code on Unix, but if anyone is interested at least there is a solution listed here, plus they can contact you :)

Posted by Sems on 10/15/2007 3:00:00 AM

Sems,

I followed your instruction but I am getting compile errors (BTW I had to path the code manually as patch did fail)

Any help would be appreciated.




[cc'> app_nv_backgrounddetect-1.0.6_1.c -> app_nv_backgrounddetect-1.0.6_1.o
app_nv_backgrounddetect-1.0.6_1.c:77: warning: data definition has no type or storage class
app_nv_backgrounddetect-1.0.6_1.c:77: warning: type defaults to ‘int’ in declaration of ‘STANDARD_LOCAL_USER’
app_nv_backgrounddetect-1.0.6_1.c:79: warning: data definition has no type or storage class
app_nv_backgrounddetect-1.0.6_1.c:79: warning: type defaults to ‘int’ in declaration of ‘LOCAL_USER_DECL’
app_nv_backgrounddetect-1.0.6_1.c: In function ‘nv_background_detect_exec’:
app_nv_backgrounddetect-1.0.6_1.c:159: warning: implicit declaration of function ‘LOCAL_USER_ADD’
app_nv_backgrounddetect-1.0.6_1.c:213:60: warning: trigraph ??) ignored, use -trigraphs to enable
app_nv_backgrounddetect-1.0.6_1.c:323: warning: implicit declaration of function ‘LOCAL_USER_REMOVE’
app_nv_backgrounddetect-1.0.6_1.c: At top level:
app_nv_backgrounddetect-1.0.6_1.c:329: warning: no previous prototype for ‘unload_module’
app_nv_backgrounddetect-1.0.6_1.c: In function ‘unload_module’:
app_nv_backgrounddetect-1.0.6_1.c:330: error: ‘STANDARD_HANGUP_LOCALUSERS’ undeclared (first use in this function)
app_nv_backgrounddetect-1.0.6_1.c:330: error: (Each undeclared identifier is reported only once
app_nv_backgrounddetect-1.0.6_1.c:330: error: for each function it appears in.)
app_nv_backgrounddetect-1.0.6_1.c: At top level:
app_nv_backgrounddetect-1.0.6_1.c:335: warning: no previous prototype for ‘load_module’
app_nv_backgrounddetect-1.0.6_1.c:340: warning: no previous prototype for ‘description’
app_nv_backgrounddetect-1.0.6_1.c:345: warning: no previous prototype for ‘usecount’
app_nv_backgrounddetect-1.0.6_1.c: In function ‘usecount’:
app_nv_backgrounddetect-1.0.6_1.c:347: warning: implicit declaration of function ‘STANDARD_USECOUNT’
app_nv_backgrounddetect-1.0.6_1.c: At top level:
app_nv_backgrounddetect-1.0.6_1.c:352: warning: function declaration isn’t a prototype
make[1'>: *** [app_nv_backgrounddetect-1.0.6_1.o'> Error 1
make: *** [apps'> Error 2

Posted by Gaju on 11/16/2007 3:00:00 AM

Which version of libraries are you using? Compiler? Which distro? You are not providing much of information other than compile output.

Also where did you get the app_nv_background_detect source? From here? The ones I have on the site are already patched.

Finally take a look at http://www.voip-info.org/wiki/view/NewmanTelOnAsterisk14

Posted by Sems on 11/16/2007 3:00:00 AM

Sems,

Thanks for prompt reply. I read further through user posts and realized that the 68k source was corrupted. I downloaded from your site and at least it has compiled. I will test the actual stuff tomorrow and post the results. I am using lastest asterisk 1.4.x and zaptel from asterisk. I followed everything else from your links.

Once again thanks again. Your guide is a great help.

Gaju

Posted by gaju on 11/16/2007 3:00:00 AM

My pleasure :)

Posted by Sems on 11/17/2007 3:00:00 AM

Sems here is the promised update.

nvfax worked right out of the box. So your solution works for me too.

Here is my setup if anybody else wants to test it in-house.

PAP2 is setup with two separate extensions on asterisk.
PAP2 - Line 1 fax machine
PAP2 - Line 2 zap channle X100P clone.

PAP2 has two extensions. I call from one extension to other (line 1 fax to line 2 - zap) Zap picks up the call as external call.

Unfortunately zap does not hang up the call although calling party has ended the call. I had done this for asteisk 1.2 testing and it worked fine on exact same hardware. Not today. Do you have any tips on why zap is not hanging up?

Posted by gaju on 11/18/2007 3:00:00 AM

I haven't worked with Zap channels much, it could be an issue with your dialplan. Or check your zapata.conf and see if there is a missing config there.

If you want send the parts of your dialplan to sems at sems dot org and i'll take a look.

Posted by Sems on 11/19/2007 3:00:00 AM

Sems,

What kind of spandsp, libtiff library need to have to get work with Asterisk-1.4.16/17?

I installed Asterisk-1.4.16/17 on Debian 4.0 (Etch).

My idea is trying to setup followings:

PSTN line---->TDM400p FXO--Asterisk--->TDM400p FXS--->Fax machine

Is this setup will to work? Or any other setup required to get work Fax?

Thanks

Posted by Balgaa (email) on 1/13/2008 3:00:00 AM

While I haven't used any PSTN lines in my setup, it should also work with your suggested config. As for the libraries, just grab the latest ones via apt-get and Spandsp site and it should be fine. I am using some older versions (see the comments above) but latest ones should work fine too.

Posted by Sems on 1/14/2008 3:00:00 AM

I can't find following files:

5. Copy http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_rxfax.c and http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_txfax.c to /usr/src/asterisk-1.4.1/apps folder.
6. Copy http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/asterisk.patch to /usr/src/asterisk-1.4.1 folder.

Posted by Balgaa (email) on 1/17/2008 3:00:00 AM

Sems,

Thank you very much I compiled and installed using step-by-step instruction.

Can you put sample extensions.conf, sip.conf, zapata.conf on this forum?

I don't have any idea how to configure it when try to test send/receive fax.

Thanks

Posted by Balgaa (email) on 1/17/2008 3:00:00 AM

Sems,

My new config for inbound/outbound:

PSTN line---->TDM400p FXO--Asterisk--->SIP ATA FXS--->Fax machine

PSTN line---->SIP ATA FXO--Asterisk--->SIP ATA FXS--->Fax machine

Is this setup will to work?

Thanks

Posted by Balgaa (email) on 1/17/2008 3:00:00 AM

In our config, we receive the fax, then email it. So sip.conf and zapata.conf has pretty much nothing specific to fax in it. (we only have SIP lines anyways, no PSTN).

Similarly, when sending, we use email. Emails get picked via cron job, converted and faxed. So most of the magic is done via dial plan, ie extensions.conf

I am out of office right now, I'll look for the extensions.conf sample.

Those two suggested configs should work.

Posted by Sems on 1/17/2008 3:00:00 AM

Sems,

Please let me see your extensions.conf.

I want it similiar setup as yours.

Is it possible to see your config?

Posted by Balgaa (email) on 1/17/2008 3:00:00 AM

Info and question at the same time
Did somebody tried rxfax on ast 14.17 with spandsp?
I used few days ago 1.4.16.2 spandsp-0.0.4 with app_rxfax.c I’ve got from:
http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_rxfax.c
which is not available any more. It was crashing from time to time. Did the upgrade to 1.4.17 with spandsp-0.0.4pre16.tgz and app_rxfax from agx-ast-addons-1.4.3.tar.bz2 and it was crashing immediately as rxfax where called. Then I put back old app_rxfax.c and now it is working. From 10 fax’s I’ve sent no crash yet. I have this working on ast 1.2.24 for quite a long time without problems. Any experience with this problem ? I need to have this working stable.

Posted by vb on 1/17/2008 3:00:00 AM

While I can't put the whole thing, here is something to get you started. There is plenty of info at the www.voip-info.org/ site to help you out.

Below is for incoming fax

exten => 12,1,Set(FAXRECEPIENT=${EXTEN})
exten => 12,2,Goto(fax,s,1)


[fax'>

exten => s,1,Answer
exten => s,n,Set(CALLERIDNUM=${CALLERID(num)})
exten => s,n,Set(CALLERIDNAME=${CALLERID(name)})
exten => s,n,Playtones(ring)
exten => s,n,NVFaxDetect(6) ; while playing ring sound, detect faxes for 4 seconds (goes to "fax" extension if detected)
exten => s,n,NoOp(${FAXRECEPIENT})
exten => s,n,Goto(incoming,${FAXRECEPIENT:6},1)

exten => fax,1,StopPlaytones()
exten => fax,n,NoOp(${FAXRECEPIENT})
exten => fax,n,Set(RECEIVEDAFAX=1)
exten => fax,n,Macro(faxreceive,${FAXRECEPIENT})

exten => h,1,GotoIf($[${receivedafax} = 1'>?h,receivedafax:h,receivedavoice)
exten => h,n(receivedafax),DeadAGI(receivefax.php|${FAXFILE}|${EMAILADDR}|${CALLERIDNUM}|${CALLERIDNAME})
exten => h,n(receivedavoice),Hangup

exten => i,1,Hangup ;invalid event
exten => t,1,Hangup ;timeout event

Vb, I have installed 1.4.17 but haven't tested fax yet. Have you checked the debug logs? When it comes to fax 1.2.x is more stable than 1.4.

Posted by Sems on 1/18/2008 3:00:00 AM

Thank you Sems for your info. I do have a call flow for rxfax that is working quite well. The fanny thing I have one system with ast 1.4.12.1 that is using http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/app_rxfax.c it is working fine since October. A have customer who is getting about 25 fax’s per day without any problem. I asked about rxfax on 1.4.16.2 because in full log it was the last app before crash. But in core dump it was showing some memory operation failure(not physical ram). May be it was a coincidence? I so on intenet that 1.4.16.2 do have some memory leak issues. After I posted the note I sent more fax’s without problem. Once I try rxfax from agx-ast-addons-1.4.3.tar.bz2 it crashes instantly at rxfax app. Wanted to let you guys to know about it.
Off topic question. I need a virtual parking with BLF. No valetparking. I couldn’t find one. Any suggestions ? I am trying to use http://bugs.digium.com/view.php?id=10836 but it not supporting BLF. Have to do it somehow with devastate. That in 1.4.17 has an issue in res_features.c that crash ast. We fixed it. Will post a note on ast bugs hope it is just a mistake.

Posted by vb on 1/18/2008 3:00:00 AM

You're welcome Vb.

It might have been a coincidence, I never run 1.4.16.2, so can't share much experience there. I never used anything from agx-ast-addons package, mine was direct download softswitch site. I guess I am bit out of loop here. Did Steve Underwood decide to move them to agx-ast-addons?

I'll try this weekend latest code and see what happens with fax.

Can you define what you mean by "virtual parking?" If you want we can take discussion offline, you can reach me at sems at sems dot org

Posted by Sems on 1/18/2008 3:00:00 AM

Sems,

Thank you very much for sample config.

Can I see faxreceive macro and receivedfax.php?

Last few days I tried to use app_txfax. But there no much information on net. I did bit googled.

Finally, I configured following:

exten => _6327XX,1,Set(FAXFILE=/tmp/sendfax.tif)
exten => _6327XX,n,Set(LOCALHEADERINFO=Boldsoft NOC room)
exten => _6327XX,n,Set(LOCALSTATIONID=Boldsoft Co., Ltd)
exten => _6327XX,n,txfax(${FAXFILE}|caller)
exten => h,1,NoOp(TX: REMOTESTATIONID is ${REMOTESTATIONID})

Still didn't work. Yesterday, I found that there need to do create call file for outbound fax.

I don't have idea how to create it and how to automatically generate everytime send outbound fax.

Can you give me some idea and suggestion?

Posted by Balgaa (email) on 1/18/2008 3:00:00 AM

Sems,

I tested few inbound fax using app_rxfax and it is working fine.

I am using spandsp-0.0.4pre16, asterisk-1.4.17 and libtiff-3.8.2

Posted by Balgaa (email) on 1/18/2008 3:00:00 AM

[macro-faxreceive'>
exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => s,2,Set(EMAILADDR=${DB(extensionemail/${ARG1})})
exten => s,3,GotoIf($[&quot${emailaddr}&quot = &quot&quot'>?103)
exten => s,4,rxfax(${FAXFILE})
exten => s,103,Set(EMAILADDR=default@email.address)
exten => s,104,Goto(4)

receivefax.php processes the /var/spool/asterisk/fax/${UNIQUEID}.tif, I convert it into pdf and email, but you can do however you want.

As for creating call files, voip-info wiki has plenty info on it. Here is a sample:

$calltxt = "Channel: SIP/provider/phonenumber"."\n";
$calltxt .= "SetVar: LOCALHEADERINFO=Company"."\n";
$calltxt .= "SetVar: LOCALSTATIONID=4165551212"."\n";
$calltxt .= "SetVar: FAXRECEIVER=phonenumber"."\n";
$calltxt .= "SetVar: NEWFILENAME=$newfilename"."\n";
$calltxt .= "MaxRetries: 1"."\n";
$calltxt .= "WaitTime: 20"."\n";
$calltxt .= "Context: sendfax"."\n";
$calltxt .= "Extension: s"."\n";
$calltxt .= "Priority: 1"."\n";

I create a textfile as above (there is more fancy stuff you can do if you need to), the sendfax context is:


[sendfax'>

exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,TXFAX(${NEWFILENAME}|caller|debug)

Then you can add error detection and such using the h extension.

Posted by Sems on 1/18/2008 3:00:00 AM

Balgaa, I have exactly the same application versions as you mentioned. The problem was app_rxfax.c one version was working fine other one was crashing. So question would be what app_rxfax you used ? see my comments earlier.

Posted by vb (email) on 1/19/2008 3:00:00 AM

Vb,

I download all files from Sems site.

wget http://www.sems.org/content/download/asterisk/app_nv_faxdetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_nv_backgrounddetect-1.0.6_1.c
wget http://www.sems.org/content/download/asterisk/app_rxfax.c
wget http://www.sems.org/content/download/asterisk/app_txfax.c
wget http://www.sems.org/content/download/asterisk/asterisk.patch

Those files works for me.

Posted by Balgaa (email) on 1/19/2008 3:00:00 AM

Sems,

Can you share your receivefax.php file with me?

Is asterisk generate automatically call file every time I try to send fax?

Or I need to do manually or I need to write some script to do it automatically generate call file?

If possible can you give me more clear suggestion?

Thanks

Posted by Balgaa (email) on 1/19/2008 3:00:00 AM

Sems,

Can you share your cron job tab?

Posted by Balgaa (email) on 1/19/2008 3:00:00 AM

Sems,

I am getting following error when try to use app_txfax;

-- Executing [632789@lawyer:1'> Set("SIP/901-08242600",
"FAXFILE=/tmp/sendfax.tiff") in new stack
-- Executing [632789@lawyer:2'> Set("SIP/901-08242600",
"LOCALHEADERINFO=Boldsoft NOC room") in new stack
-- Executing [632789@lawyer:3'> Set("SIP/901-08242600",
"LOCALSTATIONID=Boldsoft Co.| Ltd") in new stack
-- Executing [632789@lawyer:4'> TxFAX("SIP/901-08242600",
"/tmp/sendfax.tiff|caller|debug") in new stack
[jan 22 17:15:54'> NOTICE[30733'>: rtp.c:1283 ast_rtp_read: Unknown RTP
codec 100 received from 'x.x.x.x'
[jan 22 17:16:33'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set rx type 4
[jan 22 17:16:33'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set tx type 0
[jan 22 17:16:34'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set rx type 0
[jan 22 17:16:34'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set tx type 1
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:261 txfax_exec: Got hangup
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:96 phase_e_handler:
==============================================================================
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:97 phase_e_handler: Fax
send not successful - result (38) Unexpected DCN while waiting for DCS
or DIS.
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:98 phase_e_handler:
==============================================================================
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set rx type 13
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
FAX exchange complete
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
Set tx type 13
[jan 22 17:16:35'> DEBUG[30733'>: app_txfax.c:70 span_message: FLOW FAX
FAX exchange complete
-- Executing [h@lawyer:1'> NoOp("SIP/901-08242600", "TX:
REMOTESTATIONID is ") in new stack

My setup is following:
----------------------
Analog fax machine-->FXS-ATA-SIP-->Asterisk with app_txfax


But I made following test:
--------------------------
Analog fax machine-->FXS-ATA-SIP-->Asterisk--->FXO-->PSTN--->Analog fax machine

In this case analog fax machine can to send fax to other end analog fax machine. But I can get error "ast_rtp_read: Unknown RTP
codec 100 received from 'x.x.x.x'"

My SIP ATA doesn't support T.38 protocol

Posted by Balgaa (email) on 1/20/2008 3:00:00 AM

Balgaa,

I can't share the file, but like I said it is simple to build. Get the tiff file, do whatever you want with it (convert to sth else, email, etc), do clean up.

When you send a fax, in my case, cron job runs a script, which downloads the email, converts the attachment, generates a call file and let asterisk do its magic.

I am not too familiar with txfax error codes, but you can either check the source code or contact Spandsp author, Steve Underwood. Another idea is to check Asterisk forums or mailing lists at digium.

According to source code, it is a T30 error code listed under, "/* Phase E status values returned to a receiver */"

The error could be at the FXS or Asterisk itself. Or could be a simple error at the analog fax machine. Can you duplicate the issue all the time? Have you checked your FXS settings?

Posted by Sems on 1/20/2008 3:00:00 AM

Hi all,

I am using asterisk-1.4.4,libtiff-3.8.2,spandsp-0.0.4 and
agx-ast-addons for the fax,

i have got folling error...
-- Executing [136669@fax:1'> Answer("SIP/1002-08ecec80", "") in new stack
-- Executing [136669@fax:2'> NVFaxDetect("SIP/1002-08ecec80", "") in new stack
Really destroying SIP dialog '1862329951KDYA@172.16.50.200' Method: OPTIONS
[jan 28 21:45:56'> NOTICE[15875'>: /usr/src/late/agx-ast-addons/app_nv_faxdetect.c:219 nv_detectfax_exec: Redirecting SIP/1002-08ecec80 to fax extension
-- Executing [fax@fax:1'> Set("SIP/1002-08ecec80", "FAXFILE=/var/lib/asterisk/fax/test.tif|g") in new stack
== Setting global variable 'FAXFILE' to '/var/lib/asterisk/fax/test.tif'
-- Executing [fax@fax:2'> RxFAX("SIP/1002-08ecec80", "/var/lib/asterisk/fax/test.tif") in new stack
[jan 28 21:45:56'> NOTICE[15875'>: channel.c:2353 __ast_read: Dropping incompatible voice frame on SIP/1002-08ecec80 of format slin since our native format has changed to ulaw


Please help me ..how to i reslove this problem..


Thanks & Rgards
Abhishek Kumar

Posted by abhishek kumar (email) on 1/28/2008 3:00:00 AM

Hi Abhishek,

I haven't seen any errors in the log you have posted. What is the issue?

Posted by Sems on 1/28/2008 3:00:00 AM

Hi,

when this lines comes...

[jan 28 21:45:56'> NOTICE[15875'>: channel.c:2353 __ast_read: Dropping incompatible voice frame on SIP/1002-08ecec80 of format slin since our native format has changed to ulaw

asterisk wait for the transcoding and able to write the tif file....i am using alaw and ulaw

please suggest how can i achive fax on asterisk

Thanks & Regards
Abhishek Kumar

Posted by abhsihek kumar (email) on 1/29/2008 3:00:00 AM

asterisk wait for the transcoding and not able to write the tif file....i am using alaw and ulaw

Posted by abhsihek kumar (email) on 1/29/2008 3:00:00 AM

That line is a normal line, as you can see it is a "NOTICE", not even a warning or error. I see that line every time I receive a fax.

I suggest reading the comments on this page, it contains lots of info. Then taking a look at voip-info wiki. That should give you enough material to build your system.

Posted by Sems on 1/29/2008 3:00:00 AM

Hi,

Bur its never write the tif file...


I am not understanding why? please tell me reason..


Thanks & Regards
Abhishek Kumar

Posted by abhsihek kumar (email) on 1/29/2008 3:00:00 AM

There can be many reasons. Increase your verbose levels in Asterisk, enable Debug, check your log files for clues.

Posted by Sems on 1/29/2008 3:00:00 AM

app_rxfax.c and app_txfax.c are no longer available on th e www.soft-switch.org site.

I can confirm that the app files included in agx-addons package with spandsp 0.0.4 and asterisk 1.4.17 crashes asterisk.

Since I no langer have the files featured earlier on soft-switch.og i'm pretty much 'up s**t creek without a paddle'

Can someone please drop me a link were the original app_rxfax.c and app_txfax.c files from soft-switch.org can be found? I would be VERY gratefull.

kind regards,

dreeze

Posted by dreeze (email) on 1/31/2008 3:00:00 AM

http://www.sems.org/content/download/asterisk/app_rxfax.c
http://www.sems.org/content/download/asterisk/app_txfax.c

The agx-addons won't crash the Asterisk, but I can't receive faxes yet. It will fail with error (50).

Posted by Sems on 1/31/2008 3:00:00 AM

Hi,

I have successfully recive fax by using asterisk-1.4.4,libtiff-3.8.2,spandsp-0.0.4...

please tell me,how i can do mailtofax? please tell me the step...


Thanks & Regards
Abhishek Kumar

Posted by abhsihek kumar (email) on 2/1/2008 3:00:00 AM

http://www.voip-info.org/wiki-Asterisk+fax is a good start point.

Posted by Sems on 2/1/2008 3:00:00 AM

Just want to let you know that original fax is still crashing ast 1.4.17 from time to time, not permanently. debug shows memory allocation issue...

Posted by vb on 2/4/2008 3:00:00 AM

Incoming or outgoing? You mean by "original fax", the app_txfax and app_rxfax downloaded from this site?

Posted by Sems on 2/4/2008 3:00:00 AM

Sorry, I was meaning app_rxfax.c,not using txfax, that is posted few lines above, that is the orignal one.
Meantime we fixed rxfax from agx-addons, for some reason they miised dependences. add <depend>spandsp</depend> and should be ok. Very interested in test rezults on latest asterisk release.

Posted by vb on 2/4/2008 3:00:00 AM

Just an update:
I found today that if incomming call is answerd by channel before rxfax engaed it will crash asterisk-1.4.17.
for example this will crash:
exten => s,1,Set(CDR(accountcode)=xxxxx)
exten => s,n,Answer
exten => s,n,Wait(2); wait for fax tones
exten => s,n,Congestion
; receive fax
exten => fax,1,Set(FAXFILE=/tmp/faxes/fax_${CDR(clid)}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.tif)
exten => fax,2,rxfax(${FAXFILE})

and this one will work fine:
exten => s,1,Set(CDR(accountcode)=xxxxx)
exten => s,n,goto(fax,1)
exten => s,n,Wait(2); wait for fax tones
exten => s,n,Congestion
; receive fax
exten => fax,1,Set(FAXFILE=/tmp/faxes/fax_${CDR(clid)}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.tif)
exten => fax,2,rxfax(${FAXFILE})

I am tried rxfax from agx-ast-addons-1.4.3.tar.bz2 and loaded with about 50 faxes with about 3-4 simutanious rxfax, worked fine. Actually this rxfax working with 14k that i didn't have with old rxfax:
http://www.sems.org/content/download/asterisk/app_rxfax.c

Posted by vb on 2/5/2008 3:00:00 AM

Hi Sems,

I got problem Zap channel didn't hangup after receive fax.

zapata-channels.conf
;;; line="2 WCTDM/0/1"
signalling=fxs_ks
allow=ulaw
allow=alaw
callerid=asreceived
group=0
context=towerfax
rxgain=1.0
txgain=1.0
channel => 2
context=default

extensions.conf
[towerfax'>
exten => s,1,Wait(2)
;exten => s,2,Answer(5)
exten => s,2,NoOp
exten => s,3,NoOp(${CALLERID(all)})
exten => s,4,NoOp(${CALLERID(num)})
exten => s,5,Set(FAXFILE=/tmp/fax_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.tif)
exten => s,6,rxfax(${FAXFILE})
exten => s,7,Hangup()
exten => h,1,Hangup()
exten => i,1,Hangup()
exten => t,1,Hangup()

I tried several type of hangup method and all doesn't work.

Anything I configured wrong?

Balgaa

Posted by Balgaa on 2/22/2008 3:00:00 AM

Haven't used any ZAP channels in Asterisk, so can't help there much. Did you check out Digium forums?

Posted by Sems on 2/23/2008 3:00:00 AM

No respone from Digium forum. I submit bug report to Digium.

They told me contact author of app_rx/app_tx.

Posted by Balgaa on 2/26/2008 3:00:00 AM

Hi All !

this configuration working for me
my instalation is
asterisk 1.4.18.1
spandsp 0.0.4pre18
agx-ast-addons 1.4.5

[pri1_incoming'> ;(Context for Zap PRI1)
;Incoming FAX
exten => 5020112,1,Answer()
exten => 5020112,2,Dial(Local/000@vtv_fax)
exten => 5020112,3,Hangup()

[vtv_fax'>
exten => 000,1,Set(FAX_FILE_PATH='/var/spool/asterisk/fax/');
exten => 000,2,Set(FAX_FILE_NAME=${UNIQUEID});
exten => 000,3,Set(FAX_FILE_EXT='.tif');
exten => 000,4,Set(FAXFILE=${FAX_FILE_PATH}${FAX_FILE_NAME}${FAX_FILE_EXT});
exten => 000,5,Set(EMAILADDR="my_email@mydomain.com");
exten => 000,6,Set(LOCALSTATIONID='My Station ID');
exten => 000,7,RxFax(${FAXFILE});
exten => 000,8,HangUp();

exten => h,1,system(/usr/local/bin/fax2mail ${FAXFILE} ${EMAILADDR} "${CALLERID(all)}");
exten => h,2,DeadAGI(incoming_fax_holder.agi);

If I using Goto, Asterisk crash :(

Thanks.

Posted by Apollo (email) on 4/2/2008 3:00:00 AM

Thanks Apollo for the comment. I'll keep this in mind. I have not extensive tested my config, but so far 1.4.18 with spandsp0.0.4pre6 and original txfax/rxfax copies I have (which are posted here as well) have been working fine.

Posted by Sems on 4/4/2008 3:00:00 AM

Hi all
I use asterisk 1.4.11 and spandsp-0.0.4. I can't download fax app ans patch in http://www.soft-switch.org/downloads/snapshots/spandsp/test-apps-asterisk-1.4/
so I get from http://www.sems.org/content/download/asterisk/
I build ok , but when I receive fax from client ZOIPER , app rxfax don't do any thing, after 10' , it don't auto hangup , until I hangup in client.So, no fax receive in asterisk
My extension.conf
[fax'>

exten => _.,1,Answer()

exten => _.,n,Set(FAXFILE=/tmp/${EXTEN}.tif)

exten => _.,n,Wait(5)

exten => _.,n,rxfax(${FAXFILE})

exten => h,1,Hangup

What problem I met? and how can I solve it?

Posted by vantranbk (email) on 5/8/2008 3:00:00 AM

What does the Asterisk CLI show? Don't forget to set verbose and debug levels at CLI like:

core set verbose 3
core set debug 3

Also for the incoming fax call are you using SIP or ZAP?

Posted by Sems on 5/8/2008 3:00:00 AM

What does the Asterisk CLI show? Don't forget to set verbose and debug levels at CLI like:

core set verbose 3
core set debug 3

Also for the incoming fax call are you using SIP or ZAP?

I use Zoiper to send fax to asterisk
I receive
-- Executing [555602@from-extension:1'> AGI("SIP/603-08f338c8", "get_frext.agi|603") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/get_frext.agi
-- AGI Script get_frext.agi completed, returning 0
-- Executing [555602@from-extension:2'> GotoIf("SIP/603-08f338c8", "0?no-routing|603|1") in new stack
-- Executing [555602@from-extension:3'> Set("SIP/603-08f338c8", "CHANNEL(language)=vn") in new stack
-- Executing [555602@from-extension:4'> GotoIf("SIP/603-08f338c8", "1?next:write") in new stack
-- Goto (from-extension,555602,7)
-- Executing [555602@from-extension:7'> Goto("SIP/603-08f338c8", "extension-line|555602|1") in new stack
-- Goto (extension-line,555602,1)
-- Executing [555602@extension-line:1'> GotoIf("SIP/603-08f338c8", "1?:nofax") in new stack
-- Executing [555602@extension-line:2'> Goto("SIP/603-08f338c8", "fax|555602|1") in new stack
-- Goto (fax,555602,1)
-- Executing [555602@fax:1'> Answer("SIP/603-08f338c8", "") in new stack
-- Executing [555602@fax:2'> Set("SIP/603-08f338c8", "FAXFILE=/tmp/555602.tif") in new stack
-- Executing [555602@fax:3'> Wait("SIP/603-08f338c8", "5") in new stack
-- Executing [555602@fax:4'> RxFAX("SIP/603-08f338c8", "/tmp/555602.tif") in new stack


It only hangup when I press hangup on client

Posted by vantranbk (email) on 5/12/2008 3:00:00 AM

Hi all
I use
Asterisk : 1.4.17
spandsp: 0.0.4-pre15
agx_asterisk_addons (app_rxfax): 1.4.5
tiff: 3.8.2

my extension.conf
[general'>
static=yes
writeprotect=no
clearglobalvars=no
[fax'>
exten => 102,1,Set(CDR(accountcode)=${EXTEN})
exten => 102,n,Answer
exten => 102,n,goto(fax,1)
exten => 102,n,Wait(2); wait for fax tones
exten => 102,n,Congestion
; receive fax
exten => fax,1,Set(FAXFILE=/tmp/faxes/fax_${EXTEN}.tif)
exten => fax,2,rxfax(${FAXFILE})
exten => fax,3,Hangup


my sip.conf
allow=ulaw
allow=alaw
t38pt_udptl = yes
canreinvite=no
[101'>
username=101
secret=123
host=dynamic
type=friend
;allow=all
context=fax
[102'>
username=102
secret=123
host=dynamic
type=friend
;allow=all
context=fax




All config file in /etc/asterisk I use default

I use Zoiper client send fax to another Zoiper client : OK
I use Zoiper client send fax to asterisk and want asterisk save it to file but it hang after call rxfax and don't do any thing, asterisk still alive, not crash

Here my log
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = No match Their Call ID: MDI1MWMxYjY3YWYxYzgzM2Y5ZDQwNzhlNzM2MDlkNDQ. Their Tag 0336b402 Our tag: as6522146b
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2733 do_setnat: Setting NAT on RTP to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2743 do_setnat: Setting NAT on UDPTL to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4509 sip_alloc: Allocating new SIP dialog for YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. - INVITE (With RTP)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received INVITE (5) - Command in SIP INVITE
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2733 do_setnat: Setting NAT on RTP to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2743 do_setnat: Setting NAT on UDPTL to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = Found Their Call ID: YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. Their Tag 357c270c Our tag: as59fec3e3
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received ACK (6) - Command in SIP ACK
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2170 __sip_ack: Stopping retransmission on 'YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ.' of Response 1: Match Not Found
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = Found Their Call ID: YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. Their Tag 357c270c Our tag: as59fec3e3
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received INVITE (5) - Command in SIP INVITE
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2733 do_setnat: Setting NAT on RTP to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2743 do_setnat: Setting NAT on UDPTL to On
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5388 process_sdp: T38 state changed to 0 on channel <none>
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5468 process_sdp: We're settling with these formats: 0xc (ulaw|alaw)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:13834 handle_request_invite: Checking SIP call limits for device 101
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:3173 update_call_counter: Updating call counter for incoming call
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:3993 sip_new: *** Our native formats are 0x4 (ulaw)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:3994 sip_new: *** Joint capabilities are 0xc (ulaw|alaw)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:3995 sip_new: *** Our capabilities are 0xc (ulaw|alaw)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:3996 sip_new: *** AST_CODEC_CHOOSE formats are 0x4 (ulaw)
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4019 sip_new: This channel will not be able to handle video.
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:8241 build_route: build_route: Contact hop: <sip:101@222.254.190.119:5060>
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:13913 handle_request_invite: SIP/101-b7815570: New call is still down.... Trying...
[may 14 03:46:12'> DEBUG[13642'>: devicestate.c:304 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel SIP/101-b7815570
[may 14 03:46:12'> DEBUG[13602'>: devicestate.c:161 ast_device_state: No provider found, checking channel drivers for SIP - 101
[may 14 03:46:12'> DEBUG[14102'>: pbx.c:1831 pbx_extension_helper: Launching 'Set'
-- Executing [102@fax:1'> Set("SIP/101-b7815570", "CDR(accountcode)=102") in new stack
[may 14 03:46:12'> DEBUG[13602'>: chan_sip.c:15788 sip_devicestate: Checking device state for peer 101
[may 14 03:46:12'> DEBUG[14102'>: pbx.c:1831 pbx_extension_helper: Launching 'Answer'
-- Executing [102@fax:2'> Answer("SIP/101-b7815570", "") in new stack
[may 14 03:46:12'> DEBUG[13602'>: devicestate.c:287 do_state_change: Changing state for SIP/101 - state 1 (Not in use)
[may 14 03:46:12'> DEBUG[13618'>: app_queue.c:589 handle_statechange: Device 'SIP/101' changed to state '1' (Not in use) but we don't care because they're not a member of any queue.
[may 14 03:46:12'> DEBUG[14102'>: devicestate.c:304 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel SIP/101-b7815570
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:3647 sip_answer: SIP answering channel: SIP/101-b7815570
[may 14 03:46:12'> DEBUG[13602'>: devicestate.c:161 ast_device_state: No provider found, checking channel drivers for SIP - 101
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:6657 transmit_response_with_sdp: Setting framing from config on incoming call
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:6421 add_sdp: ** Our capability: 0xc (ulaw|alaw) Video flag: True
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:6422 add_sdp: ** Our prefcodec: 0x0 (nothing)
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:6553 add_sdp: -- Done with adding codecs to SDP
[may 14 03:46:12'> DEBUG[14102'>: channel.c:2579 ast_internal_timing_enabled: Internal timing is disabled (option_internal_timing=0 chan->timingfd=-1)
[may 14 03:46:12'> DEBUG[13602'>: chan_sip.c:15788 sip_devicestate: Checking device state for peer 101
[may 14 03:46:12'> DEBUG[14102'>: chan_sip.c:6598 add_sdp: Done building SDP. Settling with this capability: 0xc (ulaw|alaw)
[may 14 03:46:12'> DEBUG[13602'>: devicestate.c:287 do_state_change: Changing state for SIP/101 - state 1 (Not in use)
[may 14 03:46:12'> DEBUG[14102'>: pbx.c:1831 pbx_extension_helper: Launching 'Goto'
-- Executing [102@fax:3'> Goto("SIP/101-b7815570", "fax|1") in new stack
[may 14 03:46:12'> DEBUG[13618'>: app_queue.c:589 handle_statechange: Device 'SIP/101' changed to state '1' (Not in use) but we don't care because they're not a member of any queue.
-- Goto (fax,fax,1)
[may 14 03:46:12'> DEBUG[14102'>: pbx.c:1831 pbx_extension_helper: Launching 'Set'
-- Executing [fax@fax:1'> Set("SIP/101-b7815570", "FAXFILE=/tmp/faxes/fax_fax.tif") in new stack
[may 14 03:46:12'> DEBUG[14102'>: pbx.c:1831 pbx_extension_helper: Launching 'RxFAX'
-- Executing [fax@fax:2'> RxFAX("SIP/101-b7815570", "/tmp/faxes/fax_fax.tif") in new stack
[may 14 03:46:12'> DEBUG[14102'>: channel.c:3069 set_format: Set channel SIP/101-b7815570 to read format slin
[may 14 03:46:12'> DEBUG[14102'>: channel.c:3069 set_format: Set channel SIP/101-b7815570 to write format slin
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = Found Their Call ID: YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. Their Tag 357c270c Our tag: as7282a289
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received ACK (6) - Command in SIP ACK
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2170 __sip_ack: Stopping retransmission on 'YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ.' of Response 2: Match Not Found
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = Found Their Call ID: YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. Their Tag 357c270c Our tag: as7282a289
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received INVITE (5) - Command in SIP INVITE
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5076 process_sdp: T38 state changed to 4 on channel SIP/101-b7815570
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5353 process_sdp: RateManagement: transferredTCF
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5320 process_sdp: FaxVersion: 0
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5292 process_sdp: MaxBufferSize:400
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5340 process_sdp: Transcoding MMR: 0
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5361 process_sdp: UDP EC: t38UDPRedundancy
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5334 process_sdp: FillBitRemoval: 0
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5296 process_sdp: T38MaxBitRate: 14400
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5328 process_sdp: FaxMaxDatagram: 400
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5347 process_sdp: Transcoding JBIG: 0
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:5423 process_sdp: Have T.38 but no audio codecs, accepting offer anyway
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:13987 handle_request_invite: SIP/101-b7815570: This call is UP....
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:6208 t38_get_rate: T38MaxFaxRate 9600 found
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:14042 handle_request_invite: T38 state changed to 5 on channel SIP/101-b7815570
[may 14 03:46:12'> DEBUG[14102'>: rtp.c:1177 ast_rtp_read: RTP NAT: Got audio from other end. Now sending to address 222.254.190.119:49864
[may 14 03:46:12'> DEBUG[14102'>: rtp.c:2759 ast_rtp_write: Ooh, format changed from unknown to ulaw
[may 14 03:46:12'> DEBUG[14102'>: rtp.c:2776 ast_rtp_write: Created smoother: format: 4 ms: 20 len: 160
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:4562 find_call: = Found Their Call ID: YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ. Their Tag 357c270c Our tag: as7282a289
[may 14 03:46:12'> DEBUG[14102'>: udptl.c:656 ast_udptl_read: UDPTL NAT: Using address 222.254.190.119:49864
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:15154 handle_request: **** Received ACK (6) - Command in SIP ACK
[may 14 03:46:12'> DEBUG[13642'>: chan_sip.c:2170 __sip_ack: Stopping retransmission on 'YmQ0ZWQ4ODk0Y2Y2ZjIzMTQzZTU0MjI0OTJiY2UyMWQ.' of Response 3: Match Not Found

how can i fix it?

Thanks all

Posted by vantranbk (email) on 5/13/2008 3:00:00 AM

Never used Zoiper, so it makes me wonder if it is an issue there. Have you tried to send from a real fax machine hooked to a land line?

Posted by Sems on 5/14/2008 3:00:00 AM

Hi all
I use
asterisk-1.4.17.tar.gz
spandsp-0.0.4pre15.tgz
tiff-3.8.2.tar.gz
cmake-2.6.0.tar.gz
agx-ast-addons-1.4.5.tar.bz2

I don't use Zoiper , I use fax machine connect to Sipura 2100 , connect to asterisk, and I can receive fax , save it to tiff file

I receive fax to pstn , save it as tiff file OK

But when I forward fax from pstn to fax machine connect to Sipura 2100, but it fail

I use
t38pt_udptl=yes
t38pt_rtp=no
t38pt_tcp=no
canreinvite=yes
insecure=port,invite

what things I must note to solve it?

Posted by vantranbk (email) on 5/21/2008 3:00:00 AM

I am trying to pickup bits of information you are providing Vantranbk. First as far as I know Sipura 2100 does not provide a PSTN port. So can you elaborate on your full setup. What do you mean by "forward fax from pstn" as well as "receive fax to pstn"?

It would be easier to understand what's going on and which part is working and which part is not, once we have your config details.

Posted by Sems on 5/21/2008 3:00:00 AM

Hi Sems,
Here is my setup
Fax1 machine <----> Sipura 2100 <---> Asterisk <---> PBX <---> Fax2 machine

I mean "Fax from PSTN" is Fax 2 send fax to asterisk via PBX, and i want Fax1 receive it.
I also try send fax from Fax1 to Fax2 but it fail too

Posted by vantranbk (email) on 5/21/2008 3:00:00 AM

What do you use as PBX?

So, if I understand correctly, I fax is sent from fax1 or fax2 to Asterisk, everything is fine. But it will not passthrough from fax1 to fax2 or fax2 to fax1.

If I am not mistaken, T38 passthrough is not supported in 1.4, you might want to check http://www.voip-info.org/wiki/view/T.38

Posted by Sems on 5/22/2008 3:00:00 AM

Hi Sems
I read from page
http://www.voip-info.org/tiki-index.php?page=Asterisk%20T.38

"Asterisk support T.38 fax passthrough from version 1.4"

and if I use setup
Zoiper <---> Asterisk <---> Zoiper , it can send fax between, so I think asterisk support T38 passthrough

I use Sipura 2100, in nat, does it affect ?

I use Panasonic 1232 as PBX.
If you say "T38 passthrough is not supported in 1.4" how can I passthrough fax from fax1 to fax2? Use new version asterisk ? or use new setup?
Thanks

Posted by vantranbk (email) on 5/22/2008 3:00:00 AM

T38, fax and all is a complicated mess. Sipura 2100 may not be properly transmitting the data, never used one, only a 3000, but that was for voice only.

For me receiving/sending fax from Asterisk is more than enough, the whole point of using Asterisk for me is to get rid of fax machines.

Correct me if I am wrong but Zoiper is using IAX, not SIP, IAX protocol's T38 implementation might be different than SIP. Have you tried posting at Digium forums?

Posted by Sems on 5/22/2008 3:00:00 AM

I have just got asterisk with rxFax working and it works a treat! although it was a pain to get compiled and working etc. specially as i have no experience in asterisk OR linux :-s

As i said i can now receieve faxes however once the fax is receieved it automatically hangs up, this isnt a problem however how can i tell in the hangup context wether the hang up was through an error or wether the fax was succesfully receieved? is there a variable set to indicate a succesull fax reciept?

Posted by Chris Venables (email) on 6/19/2008 3:00:00 AM

You can edit the app_rxfax.c, the segment is:

pbx_builtin_setvar_helper(chan, "REMOTESTATIONID", far_ident);
snprintf(buf, sizeof(buf), "%i", t.pages_transferred);
pbx_builtin_setvar_helper(chan, "FAXPAGES", buf);
snprintf(buf, sizeof(buf), "%i", t.y_resolution);
pbx_builtin_setvar_helper(chan, "FAXRESOLUTION", buf);
snprintf(buf, sizeof(buf), "%i", t.bit_rate);
pbx_builtin_setvar_helper(chan, "FAXBITRATE", buf);

These are set if there was no error. Add after FAXBITRATE line:

pbx_builtin_setvar_helper(chan, "RXFAXRESULT", "SUCCESS");

This sets a channel variable RXFAXRESULT with value SUCCESS. So in your dial plan you can check it and act accordingly.

Posted by Sems on 6/21/2008 3:00:00 AM

Hi!

We ran into the rxfax crash recently.

asterisk-1.4.21.2
spandsp-0.0.5pre4.tgz

agx-ast-addons is taken from the current svn trunk via
svn co https://agx-ast-addons.svn.sourceforge.net/svnroot/agx-ast-addons/trunk agx-ast-addons

To get agx-ast-addons to compile I had to remove the -Werror compile define in CMake and then it compiled and installed in /usr/lib/asterisk/modules the modules.

With a sample extension we can receive one fax fine, or cancel it by hanging up, but seemingly exactly at the end (either positiv with received pages or negativ without any) asterisk crashes hard.

If we receive a fax the tiff-file looks fine, so reception and encoding it into tiff seems to work.

Any clues as to what could cause the crashes (at the end of rxfax)?

Regards
Philipp Ott

Posted by Philipp Ott (email) on 8/25/2008 3:00:00 AM

Regarding asterisk 1.4.21.2 + spandsp 0.0.5pre4: going back to spandsp 0.0.4pre18 did the trick, app_rxfax no longer crashes at the end (with spandsp 0.0.5pre4 it got until the call of t30_terminate()).

Regards

Posted by Philipp Ott (email) on 8/25/2008 3:00:00 AM

Thanks for the update Phillipp, I'll keep it in mind not to upgrade spandsp :)

Posted by Sems on 8/27/2008 3:00:00 AM


Hello
I haven't taken problems to send fax.I using asterisk 1.4.4, agx-ast-addons-1.4.17.5 and tiff-3.7.1. Fax machine responde the asterisk fax call, next asterisk Launch the fax, next i receive Fax Transmission complete form txfax.c, but fax doesn't progress. This is the debug:

Attempting call on SIP/8095301252@outbound-calls for application txfax(/root/output.tif,caller,debug) (Retry 1)
[oct 17 18:16:20'> WARNING[8461'>: pbx.c:5150 ast_pbx_outgoing_app: SIP/outbound-calls-081f3dc8 already has a call record??
Channel SIP/outbound-calls-081f3dc8 was answered.
Launching txfax(/root/output.tif,caller,debug) on SIP/outbound-calls-081f3dc8

..... Wait Fax Machine handcheking ... but no receive nothing. Next fax machine hungup the line. Next I receive this:

[oct 17 18:17:26'> WARNING[8461'>: /usr/src/asterisk/agx-ast-addons/app_txfax.c:426 txfax_exec: Channel INF is NULL.
[oct 17 18:17:26'> WARNING[8461'>: /usr/src/asterisk/agx-ast-addons/app_txfax.c:402 txfax_exec: TXFAX: Channel has been hanged at fax.
[oct 17 18:17:26'> WARNING[8461'>: /usr/src/asterisk/agx-ast-addons/app_txfax.c:492 txfax_exec: Fax Transmission complete, check return code
[oct 17 18:17:26'> NOTICE[8461'>: pbx_spool.c:351 attempt_thread: Call completed to SIP/8095301252@outbound-calls

EXTENSIONS.CONF
exten =>s,1,Set(FAXFILE=/root/output.tif)
exten =>s,2,TxFAX(${FAXFILE},caller,debug)
exten =>s,3,Hangup

CALL FILE
Channel: SIP/8095301252@outbound-calls
MaxRetries: 3
WaitTime: 30
Set: LOCALSTATIONID=8095301252
Set: LOCALHEADERINFO=Fax with T38
Set: T38CALL=1
Set: T38TXDETECT=yes
Context: verazsw
Extension: 8095301252
priority:1

Posted by Alex on 10/17/2008 3:00:00 AM

Alex,

Afaik, asterisk 1.4 does not support t38 fully (see http://www.voip-info.org/wiki/view/T.38), so I never use T38 options. That's one thing you should try. Also you can increase verbose and debug levels and see what is the return code from app_txfax.

Also, in SIP.conf, ensure the peer is set to use alaw and ulaw only. Compressed codecs, such as G729 does not fare well with faxes

Posted by Sems on 10/29/2008 3:00:00 AM

I need help installing the app_ fax
please email me at mail"at"yougetmail.com
how long and how much it would take to give me a hand with that.

Thanks,

Paul

Posted by paul (email) on 11/10/2008 3:00:00 AM

My hands are pretty much busy these days Paul. I can't do an installation.

Posted by Sems on 11/12/2008 3:00:00 AM

I use asterisk 1.4.22 and spandsp0.0.4pre16

agx-ast-addons gives this error:

./build.sh
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/agx-ast-addons/trunk
Building C object CMakeFiles/app_devstate.dir/app_devstate.o
/usr/src/agx-ast-addons/trunk/app_devstate.c:45: warning: initialization from incompatible pointer type
/usr/src/agx-ast-addons/trunk/app_devstate.c:45: warning: initialization from incompatible pointer type
/usr/src/agx-ast-addons/trunk/app_devstate.c: In function ‘devstate_cli’:
/usr/src/agx-ast-addons/trunk/app_devstate.c:61: warning: ‘ast_device_state_changed_literal’ is deprecated (declared at /usr/include/asterisk/devicestate.h:184)
/usr/src/agx-ast-addons/trunk/app_devstate.c:63: warning: ‘ast_device_state_changed_literal’ is deprecated (declared at /usr/include/asterisk/devicestate.h:184)
/usr/src/agx-ast-addons/trunk/app_devstate.c: In function ‘devstate_exec’:
/usr/src/agx-ast-addons/trunk/app_devstate.c:96: warning: ‘ast_device_state_changed_literal’ is deprecated (declared at /usr/include/asterisk/devicestate.h:184)
/usr/src/agx-ast-addons/trunk/app_devstate.c: At top level:
/usr/src/agx-ast-addons/trunk/app_devstate.c:121: error: ‘AST_FORMAT_MAX_AUDIO’ undeclared here (not in a function)
/usr/src/agx-ast-addons/trunk/app_devstate.c: In function ‘action_devstate’:
/usr/src/agx-ast-addons/trunk/app_devstate.c:163: warning: ‘ast_device_state_changed’ is deprecated (declared at /usr/include/asterisk/devicestate.h:168)
make[2'>: *** [cmakefiles/app_devstate.dir/app_devstate.o'> Fout 1
make[1'>: *** [cmakefiles/app_devstate.dir/all'> Fout 2
make: *** [all'> Fout 2

Following all the steps given here (installing the files in apps, make menuconfig, select txfax and rxfax, etc etc) gives an enourmous long error on app_nv_backgrounddetect.

I am completely stuck and I just can't get it compiled. What should I do? It doesn't matter to me which method to use.

Posted by Arjan (email) on 12/20/2008 3:00:00 AM

I solved the problem above, but now agx-ast-addons gives the same error as compiling the patched asterisk version directly on app_nv_backgrounddetect.

This error appears:

Building C object CMakeFiles/app_nv_backgrounddetect.dir/app_nv_backgrounddetect.o
In file included from /usr/include/asterisk/lock.h:56,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:28:
/usr/include/asterisk/logger.h: In function ‘ast_register_verbose’:
/usr/include/asterisk/logger.h:86: error: expected declaration specifiers before ‘attribute_warn_unused_result’
/usr/include/asterisk/logger.h:87: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:28:
/usr/include/asterisk/lock.h:1485: error: storage class specified for parameter ‘ast_mutex_t’
/usr/include/asterisk/lock.h:1492: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1507: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1512: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1517: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1522: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1527: error: storage class specified for parameter ‘ast_cond_t’
/usr/include/asterisk/lock.h:1529: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1534: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1539: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1544: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1549: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1554: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1560: error: storage class specified for parameter ‘ast_rwlock_t’
/usr/include/asterisk/lock.h:1570: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1586: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1591: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1596: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1601: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1606: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/lock.h:1611: error: expected ‘)’ before ‘*’ token
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:28:
/usr/include/asterisk/lock.h:1742: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/lock.h:1777: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
In file included from /usr/include/asterisk/frame.h:32,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:29:
/usr/include/sys/time.h:63: error: storage class specified for parameter ‘__timezone_ptr_t’
/usr/include/sys/time.h:74: error: expected declaration specifiers or ‘...’ before ‘__timezone_ptr_t’
/usr/include/sys/time.h:74: error: storage class specified for parameter ‘gettimeofday’
/usr/include/sys/time.h:81: error: storage class specified for parameter ‘settimeofday’
/usr/include/sys/time.h:88: error: storage class specified for parameter ‘adjtime’
/usr/include/sys/time.h:120: error: storage class specified for parameter ‘__itimer_which_t’
/usr/include/sys/time.h:127: error: expected ‘)’ before ‘__which’
/usr/include/sys/time.h:133: error: expected ‘)’ before ‘__which’
/usr/include/sys/time.h:141: error: storage class specified for parameter ‘utimes’
/usr/include/sys/time.h:146: error: storage class specified for parameter ‘lutimes’
/usr/include/sys/time.h:149: error: storage class specified for parameter ‘futimes’
/usr/include/sys/time.h:157: error: storage class specified for parameter ‘futimesat’
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:29:
/usr/include/asterisk/frame.h:159: error: expected specifier-qualifier-list before ‘uint32_t’
/usr/include/asterisk/frame.h:191: error: storage class specified for parameter ‘ast_null_frame’
/usr/include/asterisk/frame.h:380: error: expected specifier-qualifier-list before ‘uint16_t’
/usr/include/asterisk/frame.h:601: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/frame.h:627: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
In file included from /usr/include/asterisk/channel.h:131,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/poll-compat.h:102: error: storage class specified for parameter ‘poll’
In file included from /usr/include/asterisk/channel.h:145,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/sched.h:130: error: storage class specified for parameter ‘ast_sched_cb’
/usr/include/asterisk/sched.h:137: error: expected specifier-qualifier-list before ‘ast_sched_cb’
/usr/include/asterisk/sched.h:152: error: expected declaration specifiers or ‘...’ before ‘ast_sched_cb’
/usr/include/asterisk/sched.h:152: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
/usr/include/asterisk/sched.h:165: error: expected declaration specifiers or ‘...’ before ‘ast_sched_cb’
/usr/include/asterisk/sched.h:165: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
/usr/include/asterisk/sched.h:180: error: expected declaration specifiers or ‘...’ before ‘ast_sched_cb’
/usr/include/asterisk/sched.h:180: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
/usr/include/asterisk/sched.h:193: error: expected declaration specifiers or ‘...’ before ‘ast_sched_cb’
/usr/include/asterisk/sched.h:193: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
/usr/include/asterisk/sched.h:214: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
/usr/include/asterisk/sched.h:229: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_warn_unused_result’
In file included from /usr/include/asterisk/utils.h:26,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/network.h:57:2: error: #error "don't know how to handle network functions here."
In file included from /usr/include/asterisk/utils.h:26,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/network.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
In file included from /usr/include/asterisk/utils.h:29,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/unistd.h:236: error: storage class specified for parameter ‘intptr_t’
/usr/include/unistd.h:243: error: storage class specified for parameter ‘socklen_t’
/usr/include/unistd.h:256: error: storage class specified for parameter ‘access’
/usr/include/unistd.h:262: error: storage class specified for parameter ‘euidaccess’
/usr/include/unistd.h:266: error: storage class specified for parameter ‘eaccess’
/usr/include/unistd.h:274: error: storage class specified for parameter ‘faccessat’
/usr/include/unistd.h:299: error: storage class specified for parameter ‘lseek’
/usr/include/unistd.h:311: error: storage class specified for parameter ‘lseek64’
/usr/include/unistd.h:318: error: storage class specified for parameter ‘close’
/usr/include/unistd.h:325: error: storage class specified for parameter ‘read’
/usr/include/unistd.h:331: error: storage class specified for parameter ‘write’
/usr/include/unistd.h:342: error: storage class specified for parameter ‘pread’
/usr/include/unistd.h:350: error: storage class specified for parameter ‘pwrite’
/usr/include/unistd.h:370: error: storage class specified for parameter ‘pread64’
/usr/include/unistd.h:374: error: storage class specified for parameter ‘pwrite64’
/usr/include/unistd.h:382: error: storage class specified for parameter ‘pipe’
/usr/include/unistd.h:391: error: storage class specified for parameter ‘alarm’
/usr/include/unistd.h:403: error: storage class specified for parameter ‘sleep’
/usr/include/unistd.h:411: error: storage class specified for parameter ‘ualarm’
/usr/include/unistd.h:418: error: storage class specified for parameter ‘usleep’
/usr/include/unistd.h:427: error: storage class specified for parameter ‘pause’
/usr/include/unistd.h:432: error: storage class specified for parameter ‘chown’
/usr/include/unistd.h:436: error: storage class specified for parameter ‘fchown’
/usr/include/unistd.h:442: error: storage class specified for parameter ‘lchown’
/usr/include/unistd.h:451: error: storage class specified for parameter ‘fchownat’
/usr/include/unistd.h:455: error: storage class specified for parameter ‘chdir’
/usr/include/unistd.h:459: error: storage class specified for parameter ‘fchdir’
/usr/include/unistd.h:469: error: storage class specified for parameter ‘getcwd’
/usr/include/unistd.h:475: error: storage class specified for parameter ‘get_current_dir_name’
/usr/include/unistd.h:483: error: storage class specified for parameter ‘getwd’
/usr/include/unistd.h:488: error: storage class specified for parameter ‘dup’
/usr/include/unistd.h:491: error: storage class specified for parameter ‘dup2’
/usr/include/unistd.h:494: error: storage class specified for parameter ‘__environ’
/usr/include/unistd.h:496: error: storage class specified for parameter ‘environ’
/usr/include/unistd.h:503: error: storage class specified for parameter ‘execve’
/usr/include/unistd.h:509: error: storage class specified for parameter ‘fexecve’
/usr/include/unistd.h:515: error: storage class specified for parameter ‘execv’
/usr/include/unistd.h:520: error: storage class specified for parameter ‘execle’
/usr/include/unistd.h:525: error: storage class specified for parameter ‘execl’
/usr/include/unistd.h:530: error: storage class specified for parameter ‘execvp’
/usr/include/unistd.h:536: error: storage class specified for parameter ‘execlp’
/usr/include/unistd.h:541: error: storage class specified for parameter ‘nice’
/usr/include/unistd.h:546: error: storage class specified for parameter ‘_exit’
In file included from /usr/include/asterisk/utils.h:29,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/unistd.h:556: error: storage class specified for parameter ‘pathconf’
/usr/include/unistd.h:559: error: storage class specified for parameter ‘fpathconf’
/usr/include/unistd.h:562: error: storage class specified for parameter ‘sysconf’
/usr/include/unistd.h:566: error: storage class specified for parameter ‘confstr’
/usr/include/unistd.h:571: error: storage class specified for parameter ‘getpid’
/usr/include/unistd.h:574: error: storage class specified for parameter ‘getppid’
/usr/include/unistd.h:579: error: storage class specified for parameter ‘getpgrp’
/usr/include/unistd.h:589: error: storage class specified for parameter ‘__getpgid’
/usr/include/unistd.h:591: error: storage class specified for parameter ‘getpgid’
/usr/include/unistd.h:598: error: storage class specified for parameter ‘setpgid’
/usr/include/unistd.h:615: error: storage class specified for parameter ‘setpgrp’
/usr/include/unistd.h:632: error: storage class specified for parameter ‘setsid’
/usr/include/unistd.h:636: error: storage class specified for parameter ‘getsid’
/usr/include/unistd.h:640: error: storage class specified for parameter ‘getuid’
/usr/include/unistd.h:643: error: storage class specified for parameter ‘geteuid’
/usr/include/unistd.h:646: error: storage class specified for parameter ‘getgid’
/usr/include/unistd.h:649: error: storage class specified for parameter ‘getegid’
/usr/include/unistd.h:654: error: storage class specified for parameter ‘getgroups’
/usr/include/unistd.h:658: error: storage class specified for parameter ‘group_member’
/usr/include/unistd.h:665: error: storage class specified for parameter ‘setuid’
/usr/include/unistd.h:670: error: storage class specified for parameter ‘setreuid’
/usr/include/unistd.h:675: error: storage class specified for parameter ‘seteuid’
/usr/include/unistd.h:682: error: storage class specified for parameter ‘setgid’
/usr/include/unistd.h:687: error: storage class specified for parameter ‘setregid’
/usr/include/unistd.h:692: error: storage class specified for parameter ‘setegid’
/usr/include/unistd.h:699: error: storage class specified for parameter ‘getresuid’
/usr/include/unistd.h:704: error: storage class specified for parameter ‘getresgid’
/usr/include/unistd.h:709: error: storage class specified for parameter ‘setresuid’
/usr/include/unistd.h:714: error: storage class specified for parameter ‘setresgid’
/usr/include/unistd.h:721: error: storage class specified for parameter ‘fork’
/usr/include/unistd.h:728: error: storage class specified for parameter ‘vfork’
/usr/include/unistd.h:734: error: storage class specified for parameter ‘ttyname’
/usr/include/unistd.h:739: error: storage class specified for parameter ‘ttyname_r’
/usr/include/unistd.h:743: error: storage class specified for parameter ‘isatty’
/usr/include/unistd.h:749: error: storage class specified for parameter ‘ttyslot’
/usr/include/unistd.h:755: error: storage class specified for parameter ‘link’
/usr/include/unistd.h:762: error: storage class specified for parameter ‘linkat’
/usr/include/unistd.h:768: error: storage class specified for parameter ‘symlink’
/usr/include/unistd.h:775: error: storage class specified for parameter ‘readlink’
/usr/include/unistd.h:781: error: storage class specified for parameter ‘symlinkat’
/usr/include/unistd.h:786: error: storage class specified for parameter ‘readlinkat’
/usr/include/unistd.h:790: error: storage class specified for parameter ‘unlink’
/usr/include/unistd.h:795: error: storage class specified for parameter ‘unlinkat’
/usr/include/unistd.h:799: error: storage class specified for parameter ‘rmdir’
/usr/include/unistd.h:803: error: storage class specified for parameter ‘tcgetpgrp’
/usr/include/unistd.h:806: error: storage class specified for parameter ‘tcsetpgrp’
/usr/include/unistd.h:813: error: storage class specified for parameter ‘getlogin’
/usr/include/unistd.h:821: error: storage class specified for parameter ‘getlogin_r’
/usr/include/unistd.h:826: error: storage class specified for parameter ‘setlogin’
In file included from /usr/include/unistd.h:835,
from /usr/include/asterisk/utils.h:29,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/getopt.h:59: error: storage class specified for parameter ‘optarg’
/usr/include/getopt.h:73: error: storage class specified for parameter ‘optind’
/usr/include/getopt.h:78: error: storage class specified for parameter ‘opterr’
/usr/include/getopt.h:82: error: storage class specified for parameter ‘optopt’
/usr/include/getopt.h:153: error: storage class specified for parameter ‘getopt’
In file included from /usr/include/asterisk/utils.h:29,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/unistd.h:843: error: storage class specified for parameter ‘gethostname’
/usr/include/unistd.h:851: error: storage class specified for parameter ‘sethostname’
/usr/include/unistd.h:855: error: storage class specified for parameter ‘sethostid’
/usr/include/unistd.h:862: error: storage class specified for parameter ‘getdomainname’
/usr/include/unistd.h:864: error: storage class specified for parameter ‘setdomainname’
/usr/include/unistd.h:870: error: storage class specified for parameter ‘vhangup’
/usr/include/unistd.h:873: error: storage class specified for parameter ‘revoke’
/usr/include/unistd.h:883: error: storage class specified for parameter ‘profil’
/usr/include/unistd.h:889: error: storage class specified for parameter ‘acct’
/usr/include/unistd.h:893: error: storage class specified for parameter ‘getusershell’
/usr/include/unistd.h:894: error: storage class specified for parameter ‘endusershell’
/usr/include/unistd.h:895: error: storage class specified for parameter ‘setusershell’
/usr/include/unistd.h:901: error: storage class specified for parameter ‘daemon’
/usr/include/unistd.h:908: error: storage class specified for parameter ‘chroot’
/usr/include/unistd.h:912: error: storage class specified for parameter ‘getpass’
/usr/include/unistd.h:921: error: storage class specified for parameter ‘fsync’
/usr/include/unistd.h:928: error: storage class specified for parameter ‘gethostid’
/usr/include/unistd.h:931: error: storage class specified for parameter ‘sync’
/usr/include/unistd.h:936: error: storage class specified for parameter ‘getpagesize’
/usr/include/unistd.h:941: error: storage class specified for parameter ‘getdtablesize’
/usr/include/unistd.h:947: error: storage class specified for parameter ‘truncate’
/usr/include/unistd.h:959: error: storage class specified for parameter ‘truncate64’
/usr/include/unistd.h:968: error: storage class specified for parameter ‘ftruncate’
/usr/include/unistd.h:978: error: storage class specified for parameter ‘ftruncate64’
/usr/include/unistd.h:988: error: storage class specified for parameter ‘brk’
/usr/include/unistd.h:994: error: expected ‘)’ before ‘__delta’
/usr/include/unistd.h:1009: error: storage class specified for parameter ‘syscall’
/usr/include/unistd.h:1032: error: storage class specified for parameter ‘lockf’
/usr/include/unistd.h:1042: error: storage class specified for parameter ‘lockf64’
/usr/include/unistd.h:1063: error: storage class specified for parameter ‘fdatasync’
/usr/include/unistd.h:1072: error: storage class specified for parameter ‘crypt’
/usr/include/unistd.h:1076: error: storage class specified for parameter ‘encrypt’
/usr/include/unistd.h:1084: error: storage class specified for parameter ‘swab’
/usr/include/unistd.h:1092: error: storage class specified for parameter ‘ctermid’
In file included from /usr/include/asterisk/utils.h:32,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/time.h:35: error: storage class specified for parameter ‘tv’
/usr/include/asterisk/time.h:36: error: storage class specified for parameter ‘ast_time_t’
/usr/include/asterisk/time.h:37: error: storage class specified for parameter ‘ast_suseconds_t’
/usr/include/asterisk/time.h:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:64: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:78: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:94: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:105: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:124: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:134: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/time.h:156: error: expected ‘)’ before ‘sec’
/usr/include/asterisk/time.h:156: error: expected ‘)’ before ‘sec’
/usr/include/asterisk/time.h:171: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
In file included from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/utils.h:59: error: storage class specified for parameter ‘__unsigned_int_flags_dummy’
/usr/include/asterisk/utils.h:116: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__unsigned_int_flags_dummy64’
/usr/include/asterisk/utils.h:205: error: expected specifier-qualifier-list before ‘uint64_t’
/usr/include/asterisk/utils.h:209: error: field ‘hp’ has incomplete type
/usr/include/asterisk/utils.h:266: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/asterisk/utils.h:279: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/asterisk/utils.h:292: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/asterisk/utils.h:305: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/asterisk/utils.h:417: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_malloc’
/usr/include/asterisk/utils.h:417: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_malloc’
/usr/include/asterisk/utils.h:440: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_calloc’
/usr/include/asterisk/utils.h:440: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_calloc’
/usr/include/asterisk/utils.h:476: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_realloc’
/usr/include/asterisk/utils.h:476: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_realloc’
/usr/include/asterisk/utils.h:503: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_strdup’
/usr/include/asterisk/utils.h:503: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_strdup’
/usr/include/asterisk/utils.h:532: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_strndup’
/usr/include/asterisk/utils.h:532: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_ast_strndup’
/usr/include/asterisk/utils.h:571: error: expected declaration specifiers before ‘__attribute__’
/usr/include/asterisk/utils.h:571: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
In file included from /usr/include/asterisk/strings.h:28,
from /usr/include/asterisk/utils.h:672,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/threadstorage.h:168: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
In file included from /usr/include/asterisk/utils.h:672,
from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/strings.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
/usr/include/asterisk/strings.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:82: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:107: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:125: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:190: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:359: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ast_str_create’
/usr/include/asterisk/strings.h:359: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ast_str_create’
/usr/include/asterisk/strings.h:379: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:407: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:472: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:647: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:668: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/strings.h:691: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
In file included from /usr/include/asterisk/config.h:30,
from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/utils.h:687: error: storage class specified for parameter ‘g_eid’
In file included from /usr/include/asterisk/channel.h:147,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/config.h:68: error: storage class specified for parameter ‘require_type’
/usr/include/asterisk/config.h:88: error: storage class specified for parameter ‘config_load_func’
/usr/include/asterisk/config.h:89: error: storage class specified for parameter ‘realtime_var_get’
/usr/include/asterisk/config.h:90: error: storage class specified for parameter ‘realtime_multi_get’
/usr/include/asterisk/config.h:91: error: storage class specified for parameter ‘realtime_update’
/usr/include/asterisk/config.h:92: error: storage class specified for parameter ‘realtime_store’
/usr/include/asterisk/config.h:93: error: storage class specified for parameter ‘realtime_destroy’
/usr/include/asterisk/config.h:94: error: storage class specified for parameter ‘realtime_require’
/usr/include/asterisk/config.h:95: error: storage class specified for parameter ‘realtime_unload’
/usr/include/asterisk/config.h:100: error: expected specifier-qualifier-list before ‘config_load_func’
/usr/include/asterisk/config.h:210: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:245: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:256: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:266: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:285: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_sentinel’
/usr/include/asterisk/config.h:485: error: expected ‘)’ before ‘type’
/usr/include/asterisk/config.h:485: error: expected ‘)’ before ‘type’
In file included from /usr/include/asterisk/channel.h:149,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/cdr.h:122: error: storage class specified for parameter ‘ast_cdrbe’
/usr/include/asterisk/cdr.h:182: error: expected declaration specifiers or ‘...’ before ‘ast_cdrbe’
/usr/include/asterisk/cdr.h:213: error: storage class specified for parameter ‘ast_cdr_noanswer’
/usr/include/asterisk/cdr.h:350: error: storage class specified for parameter ‘ast_default_amaflags’
/usr/include/asterisk/cdr.h:352: error: storage class specified for parameter ‘ast_default_accountcode’
In file included from /usr/include/asterisk/channel.h:152,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/stringfields.h:114: error: storage class specified for parameter ‘ast_string_field’
/usr/include/asterisk/stringfields.h:120: error: storage class specified for parameter ‘__ast_string_field_empty’
/usr/include/asterisk/stringfields.h:140: error: expected specifier-qualifier-list before ‘ast_string_field’
/usr/include/asterisk/stringfields.h:158: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/asterisk/stringfields.h:172: error: expected declaration specifiers before ‘ast_string_field’
/usr/include/asterisk/stringfields.h:186: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/asterisk/stringfields.h:201: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:32:
/usr/include/asterisk/channel.h:174: error: storage class specified for parameter ‘ast_group_t’
/usr/include/asterisk/channel.h:347: error: storage class specified for parameter ‘global_fin’
/usr/include/asterisk/channel.h:347: error: storage class specified for parameter ‘global_fout’
/usr/include/asterisk/channel.h:434: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘name’
/usr/include/asterisk/channel.h:1265: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_pure’
/usr/include/asterisk/channel.h:1272: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_pure’
/usr/include/asterisk/channel.h:1289: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘attribute_const’
/usr/include/asterisk/channel.h:1506: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/channel.h:1514: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/channel.h:1532: error: expected identifier or ‘(’ before ‘do’
/usr/include/asterisk/channel.h:1532: error: expected declaration specifiers before ‘while’
/usr/include/asterisk/channel.h:1555: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/channel.h:1582: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/include/asterisk/channel.h:1601: error: expected declaration specifiers before ‘ast_group_t’
/usr/include/asterisk/channel.h:1604: error: expected declaration specifiers or ‘...’ before ‘ast_group_t’
In file included from /usr/include/asterisk/pbx.h:28,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:33:
/usr/include/asterisk/hashtab.h:98: error: expected specifier-qualifier-list before ‘ast_rwlock_t’
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:33:
/usr/include/asterisk/pbx.h:73: error: storage class specified for parameter ‘ast_state_cb_type’
/usr/include/asterisk/pbx.h:89: error: storage class specified for parameter ‘ast_switch_f’
/usr/include/asterisk/pbx.h:97: error: expected specifier-qualifier-list before ‘ast_switch_f’
/usr/include/asterisk/pbx.h:329: error: expected declaration specifiers or ‘...’ before ‘ast_state_cb_type’
/usr/include/asterisk/pbx.h:342: error: expected declaration specifiers or ‘...’ before ‘ast_state_cb_type’
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:34:
/usr/include/asterisk/module.h:274: error: storage class specified for parameter ‘ast_module_info’
In file included from /usr/include/asterisk/translate.h:36,
from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:35:
/usr/include/asterisk/plc.h:119: error: storage class specified for parameter ‘plc_state_t’
/usr/include/asterisk/plc.h:132: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/plc.h:140: error: expected ‘)’ before ‘*’ token
/usr/include/asterisk/plc.h:146: error: expected declaration specifiers before ‘plc_state_t’
In file included from /usr/src/agx-ast-addons/app_nv_backgrounddetect.c:35:
/usr/include/asterisk/translate.h:148: error: expected specifier-qualifier-list before ‘uint8_t’
/usr/include/asterisk/translate.h:150: error: expected specifier-qualifier-list before ‘plc_state_t’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:45: error: storage class specified for parameter ‘app’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:45: error: parameter ‘app’ is initialized
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:47: error: storage class specified for parameter ‘synopsis’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:47: error: parameter ‘synopsis’ is initialized
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:49: error: storage class specified for parameter ‘descrip’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:49: error: parameter ‘descrip’ is initialized
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:79: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:329: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:339: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: storage class specified for parameter ‘__mod_info’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: parameter ‘__mod_info’ is initialized
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: ‘AST_BUILDOPT_SUM’ undeclared (first use in this function)
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: (Each undeclared identifier is reported only once
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: for each function it appears in.)
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: ‘load_module’ undeclared (first use in this function)
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: ‘unload_module’ undeclared (first use in this function)
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: storage class specified for parameter ‘ast_module_info’
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: parameter ‘ast_module_info’ is initialized
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: redefinition of parameter ‘ast_module_info’
/usr/include/asterisk/module.h:274: error: previous definition of ‘ast_module_info’ was here
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: old-style parameter declarations in prototyped function definition
/usr/src/agx-ast-addons/app_nv_backgrounddetect.c:362: error: expected ‘{’ at end of input
make[2'>: *** [cmakefiles/app_nv_backgrounddetect.dir/app_nv_backgrounddetect.o'> Fout 1
make[1'>: *** [cmakefiles/app_nv_backgrounddetect.dir/all'> Fout 2
make: *** [all'> Fout 2

What is wrong? I'm still completely lost...

Posted by Arjan (email) on 12/20/2008 3:00:00 AM

Arjan,

It could be related to your Spandsp version. Also this article pre-dates agx-ast-addons. So stick with either the patched files (you can grab them from here) or agx-ast-addons package. Do not use both.

Posted by Sems on 12/30/2008 3:00:00 AM




Comments are locked for this entry.

categories

archive »


recent comments


Click here to see the recent comments from the old comments system
search


statistics

This blog currently has 346 entries and 2327 comments in 9 categories.

There are 30 active users.