Author Topic: Anyone install spandsp to enable faxing with asterisk?  (Read 5576 times)

sedgington

  • Veteran
  • ***
  • Posts: 82
    • View Profile
Anyone install spandsp to enable faxing with asterisk?
« on: March 31, 2009, 08:57:04 pm »
I am really enjoying the capabilities of Asterisk in linuxMCE. One problem has been discovering where the Asterisk application directory (usually /usr/src/asterisk/apps) is so that I can add functionality to the Asterisk app such as faxing through my Digium card connected to a pots line. Can anyone enlighten me as a newbie how Asterisk is built into LinuxMCE and how I might patch the existing Asterisk source with spandsp? I searched the forum and found only one 2005 reference which suggested that it would be built into future releases. However when I go the asterisk CLI and do "show applications" it is not listed. Many thanks for any help in advance.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Anyone install spandsp to enable faxing with asterisk?
« Reply #1 on: April 01, 2009, 01:11:29 am »
Not sure about the patching, but I had better results in using IAXMODEM together with HylaFax for my faxing with Asterisk.

sedgington

  • Veteran
  • ***
  • Posts: 82
    • View Profile
Re: Anyone install spandsp to enable faxing with asterisk?
« Reply #2 on: April 01, 2009, 05:56:10 pm »
Thank You for your response.

On LinuxMCE 7.10 to get rxFax and txFax (the applications that spandsp installs) into asterisk I had to:

apt-get install asterisk-app-fax

then if you do a:

asterisk -vvvvvvr
core show applications

they are there.

Apparently 7.10 left them out of the package. From this point I believe that you can choose whether to go with Asterfax or Hylafax or something else. I will try and post if there are any problems.

sedgington

  • Veteran
  • ***
  • Posts: 82
    • View Profile
Re: Anyone install spandsp to enable faxing with asterisk?
« Reply #3 on: April 07, 2009, 04:37:46 pm »
After playing around with spandsp I did not find it that reliable. I tried the IAXMODEM and hylafax approach and it seems to work much better. The real problem for me was getting it set up correctly between linuxmce and freepbx as there are too many instructions on the web that caused me to unnecessarily or incorrectly duplicate files resulting in a buggy IAXMODEM at first.

The view from 30,000 feet:

1. Use Linuxmce to create an IAX2 extension from Wizard Devices Phones by selecting IAXy adapter as the type--this will create the freePBX extension automatically.

2.use apt-get install to install the IAXMODEM software. Create a file named ttyIAX0 in /etc/iaxmodem that looks like this:

device /dev/ttyIAX0
owner uucp:uucp
mode 660
port 4570 (you want it to be 1 or more above 4569 which it binds to)
refresh 1800
server 127.0.0.1
peername (whatever number linuxmce created)
secret the (same number as the peer name)
cidname (Whatever you want to show up when receiving a fax)
cidnumber (your fax phone number)
codec ulaw (if you live in the US)

3. Go to freepbx and on your fax extension change the port to 4570 from the default--depending on your context, you may want to change that there as well

3. use apt-get install hylafax-server to get the server installed

4. from the command line run "faxsetup" this will setup hylafax and then ask you if you want to add a modem. Say "yes"

5.In the modem config type in ttyIAX0 when it asks you where your modem is--go through the rest of the steps answering the default except where you need to fill in specific info about your location, phone number etc. it will test you modem and set it up for you as well as create all the files to have it automatically start on boot.

6. create a file called FaxDispatch in /etc/hylafax that looks like this:

FILETYPE=pdf;
SENDTO=(your email address);

7. Go to the tutorial on linuxmce wiki about postfix (just search on that word); I just followed the instructions and it worked perfectly. I found postfix was great for emailing me the faxes.


8. Go back to freepbx and set up an inbound route to the IAX2 extension you have created--In my case I used a pstn trunk and only let it go to that extension number so I didn't need to do any fax detection. If you need fax detection there is a lot of info out there on how to do it with zaptel or nvdetect. Also create an outbound route for anything dialed from that extension if you need to.

9. Reboot the machine.

10. login to machine and do a sudo -s to become root. type asterisk -vvvvvr to get to the asterisk CLI. Type "iax2 show peers" to see that your modem is registered and hylafax is running. Send yourself a fax (or have a friend do it) so you can watch the fax come in. If everything went well, the phone will ring and connect to that extension then nothing will happen until it disconnects. You will then receive an email with your fax attached.

If anyone has more to add or sees some mistakes here, please add them as a reply. Eventually, this would be a good tutorial topic for the wiki...


dlewis

  • Guru
  • ****
  • Posts: 401
    • View Profile
Re: Anyone install spandsp to enable faxing with asterisk?
« Reply #4 on: April 07, 2009, 05:02:13 pm »
In case you didn't already know what I was going to say as you're reading this.................................Please update the wiki (preferably the asterisk page) :)

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Anyone install spandsp to enable faxing with asterisk?
« Reply #5 on: April 07, 2009, 10:28:28 pm »
Or even better. Create a device template for it! That way, people who want the fax functionality, just need to select the required device template.