app_fax or equivalent in AsteriskNOW

Get help with installing and running AsteriskNOW.

Moderators: Moderator, Support

app_fax or equivalent in AsteriskNOW

Postby sgifford » Wed Sep 01, 2010 9:01 pm

Hello!

I have recently installed AsteriskNOW after several years of building Asterisk from source. The automatic updates and well-tested configuration are great. Thanks for your hard work!

I am currently trying to get faxing working. On our old system we used app_fax.so to do this, but I can't find an RPM containing app_fax.so. I see res_fax, but it seems to require res_fax_digium which is commercial and has licensing fees, which I'd like to avoid if possible (the free app_fax has worked great for us).

Has anybody gotten this to work? Any advice on how you did it?

I tried downloading the SRPM from http://packages.asterisk.org/centos/5/current/SRPMS/ and built this module by hand with rpmbuild -bb. Unfortunately Asterisk refuses to load it, reporting that the compile-time options aren't the same ones Asterisk was compiled with (which surprised me since the SRPM should do the configuration properly). The only solution I have so far is to rebuild all of Asterisk, which for me at least kind of defeats the point of using AsteriskNOW.

Is app_fax somewhere else that I'm not looking? Or maybe somebody has a prebuilt binary that is compatible?

Anybody know how to get modules to build from the SRPM in a way that is compatible with the AsteriskNOW-distributed Asterisk binary?

Or is there something I can do to use res_fax with the free spandsp library?

Thanks!
sgifford
Newsterisk
 
Posts: 4
Joined: Wed Sep 01, 2010 8:45 pm


Builing app_fax and res_fax_spandsp for AsteriskNOW

Postby Ebor » Sat Mar 31, 2012 3:28 am

After much reading and trying different things I solved a similar(or identical) problem for me.

My goal was:
  • use AsteriskNOW binary distribution. Manage updates with 'yum' as much as possible.
  • Support receiving faxes, preferably to email, as supported by FreePBX
  • use spandsp based fax solution simply because it is not encumbered by licensing problems. Installing res_fax_digium conflicts with GPL packages and breaks yum update management. I'm doing this for a company, so a few dollars for licenses is not an issue here. The big deal for me is keeping things simple and easy to manage.

While trying to get it to work I ran into several problems with building and incompatible module compile-time options that caused Asterisk to reject .so module.

Eventually I got this working with both:
  • Asterisk 1.6 using app_fax
  • Asterisk 1.8 using res_fax + res_fax_spandsp. Asterisk 10 is probably the same, not sure

Much of it documented in spandsp and Asterisk itself, but putting it together was not obvious to me at the start.

Since this thread seems fairly old I'll only provide the summary, I won't go into details, but if someone asks here I am happy to answer with what I know.

Asterisk 1.6
  • Install asterisk-devel package matching your Asterisk version
  • Install latest spandsp following instructions on spandsp page.
  • download and extract Asterisk source matching your version of Asterisk. Since this is for Asterisk 1.6 copy file "app/app_fax.c". That's all you'll need from the source.
  • spandsp instructions http://www.soft-switch.org/installing-spandsp.html say that in order to compile older programs written for older versions of spandsp against latest spandsp version you need to edit the program source to add "#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES". Instead I just added "-DSPANDSP_EXPOSE_INTERNAL_STRUCTURES" argument to compiler.
  • Build the module. I suspect some of those options are important, because I have had Asterisk not load module complaining about different compile-time options. These options worked for me using the binary distribution of Asterisk from Digium's RPM repository.
    Code: Select all
    gcc -g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC -DAST_MODULE=\"app_fax\" -DSPANDSP_EXPOSE_INTERNAL_STRUCTURES -c -o app_fax.o app_fax.c
    gcc -shared -Xlinker -x /usr/lib/libspandsp.so -o app_fax.so  app_fax.o
  • install the module, configure dial plans

Asterisk 1.8 (and possibly for Asterisk 10)
  • Install asterisk-devel package matching your Asterisk version
  • Install latest spandsp following instructions on spandsp page.
  • download and extract Asterisk source matching your version of Asterisk. Since this is for Asterisk 1.8 copy file "res/res_fax_spandsp.c". That's all you'll need from the source.
  • Build the module. I suspect some of those options are important, because I have had Asterisk not load module complaining about different compile-time options. These options worked for me using the binary distribution of Asterisk from Digium's RPM repository.
    Code: Select all
    gcc -g -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC -DAST_MODULE=\"res_fax_spandsp\"   -c -o res_fax_spandsp.o res_fax_spandsp.c
    gcc -shared -Xlinker -x /usr/lib/libspandsp.so -o res_fax_spandsp.so  res_fax_spandsp.o
  • install the module, configure dial plans
Ebor
Newsterisk
 
Posts: 8
Joined: Wed Aug 31, 2011 9:35 pm


Return to AsteriskNOW Support

Who is online

Users browsing this forum: No registered users and 1 guest