Koozali.org: home of the SME Server

iaxmodem

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
iaxmodem
« on: November 27, 2007, 12:07:34 AM »
I have got iaxmodem working with hylafax on my sme/sail box, but only if I manually start iaxmodem with either

/etc/rc.d/init.d/iaxmodem
or
/usr/sbin/iaxmodem ttyIAX0
then do
faxgetty /dev/ttyIAX0  this loads the faxgetty and everything works just as it should.

Then to make it automatically start I have a custom hylafax template that adds
IAX:2345:respawn:/usr/sbin/iaxmodem ttyIAX0
FX0:2345:respawn:/usr/sbin/faxgetty ttyIAX0  to /etc/inittab

I do a /sbin/e-smith/expand-template /etc/inittab
and /sbin/init q
to reload the template, but iaxmodem doesn't restart.
What am I doing wrong??

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: iaxmodem
« Reply #1 on: November 27, 2007, 04:36:17 AM »
Hi Gippsweb,

This looks like pretty cool stuff you are doing.  I think the reason you are having problems might have to do with the fact that SME uses runlevel 7 and the way in which SME stops and starts tasks.  Have a look at this page in the developers manual...

http://ftp.surfnet.nl/ftp/pub/os/Linux/distr/smeserver/contribs/gordonr/devguide/html/x844.htm

Basically, to get SME to start your etc/init.d/iaxmodem you have to do a two things...

create a symlink in /etc/rc.d/rc7.d/ ...

Sxxiaxmodem     -> /etc/rc.d/init.d/e-smith-service

Where xx is a number which dictates when in the startup sequence your task will be started (in relation to all of the other running tasks - take a look at rc7.d).

You also have to create a service entry in the config database and set it to enabled....

config set iaxmodem service status enabled

You can do other stuff in the service entry, like opening firewall ports, but the above is the absolute minimum you need to get a task auto-started.  The advantage to doing it the SME way is that it is database driven.  You can schedule tasks to be started (or not) at the next reboot simply by changing their status in the database, which is pretty cool.

Hope this helps.

Kind Regards

S




Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: iaxmodem
« Reply #2 on: November 27, 2007, 05:05:26 AM »
Cool, thanks Jeff.
Symlink made, I think I'd already set it to enabled because I'd copied a little of the setup/config from the way hylafax is configured.
I've set it to start before hylafax so it should see it running and load the faxgetty for it. (I think).

We'll see how it goes after a reboot after we close tonight. I let you know how it goes.

Offline jester

  • *
  • 496
  • +1/-0
Re: iaxmodem
« Reply #3 on: November 27, 2007, 09:20:31 AM »
Do i understand this correct: is iaxmodem the way to go if you want to send and receive faxes with HylaFAX through SAIL without the use of a modem?!
If yes, Gippsweb do you maybe have some notes on how you set this up?!

Thanx!
jester.

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: iaxmodem
« Reply #4 on: November 27, 2007, 11:32:55 PM »
If you have a digium card, yes.
Otherwise it can be done just with hylafax as per the wiki.
I just decided to try and get iaxmodem to work (because I can)...
If and when I get it sorted to a reliable point I'll attempt a write up as most of the howto's for iaxmodem don't include RHEL or SME.

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Re: iaxmodem
« Reply #5 on: November 28, 2007, 02:54:15 AM »
This would be awesome!
Please let us know!!!  :-)

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: iaxmodem
« Reply #6 on: November 28, 2007, 04:42:56 AM »
Hi guys,

This might be something or not, I don't know.  We have a near neighbour (literally about half a mile away) who's a bit of an SME buff.  He has a lot of customers running SME and he contributes quite a bit on here from time to time.  Anyhow, turns out we have a joint customer who uses one of our boxes to run their PBX and one of his boxes to run vanilla SME.  His box also runs Hylafax through a Multitech modem.  I spoke to him the other day and he said that they always used Hylafax+ (http://hylafax.sourceforge.net/) because it was easier to install than Hylafax and there were binaries available for RHEL4.  Don't know if this is of any help but I thought it worth mentioning. 

Kind Regards

S

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: iaxmodem
« Reply #7 on: November 28, 2007, 05:47:59 AM »
I'd actually looked at that because it's a fork done by the guy that wrote iaxmodem, but for the life of me I just got confused as to which one to use.

There are heaps of Fedora Core and redhat 7 & 9 ones, but I couldn't see a REHL version. I ended up installing hylafax as per the wiki and a couple of threads in the contribs forum. It works well with an external dialup modem, and is currently working real well with iaxmodem and the digium card.

Once I sort out getting it started correctly I will try and write something up.

That said there is fax software in *1.4, but the consensus everywhere seems to be that hylafax and iaxmodem work better.

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: iaxmodem
« Reply #8 on: November 28, 2007, 10:38:19 AM »
Hi. I'm not sure which one is the best between hylafax and hylafax+, anyway, I've installed several times hylafax, asterisk (with smeserver-trixbox) and iaxmodem, and it's working great. Here are the steps:

- configure dungog repo
Code: [Select]
db yum_repositories set dungog repository \
BaseURL http://sme.dungog.net/packages/smeserver/7.0/i386/dungog/ \
EnableGroups yes \
GPGCheck no \
Name 'SME Server 7 - dungog' \
Visible yes \
status disabled
expand-template /etc/yum.conf

now install hylafax and smeserver-hylafax (you must install it in two time or you'll have an error message saying that two files are in conflict):
Code: [Select]
yum --enablerepo=dungog install hylafax
yum --enablerepo=dungog install smeserver-hylafax

Now, configure trixbox repo, you'll find an iaxmodem here:
Code: [Select]
db yum_repositories set trixbox repository BaseURL http://yum.trixbox.org/centos/4/RPMS/ \
EnableGroups yes GPGCheck no Name "trixbox RPM Repository for CentOS and RHEL" Visible yes \
status disabled Exclude "php*,kernel*,dnsmasq,webmin*,tbm*,*rrdtool"

And install iaxmodem
Code: [Select]
yum --enablerepo=trixbox install iaxmodem

Configure hylafax to use ttyIAX:
Code: [Select]
db configuration setprop hylafax port ttyIAX
expand-template /etc/inittab
telinit q

Create an IAX2 extension for iaxmodem on your asterisk system (in this example it's extension num 3000 with secret 3000)
and configure iaxmodem to use it (/etc/iaxmodem/iaxmodem-cfg.ttyIAX)

Code: [Select]
device          /dev/ttyIAX
owner           uucp:uucp
mode            660
port            4570
refresh         300
server          127.0.0.1
peername        3000
secret          3000
cidname         "YOUR COMPANY"
cidnumber       __YOUR_PHONE_NUMBER__
codec           alaw

Configure hylafax:
Code: [Select]
faxsetup

And eventually, add iaxmodem to hylafax configuration:
Code: [Select]
faxaddmodem ttyIAX

answer the question (you can let the default one for most options)

Now you can create a route with a special prefix to force calls to your PSTN line (because fax over VoIP isn't reliable), and add this in /etc/hylafax/etc/config.ttyIAX (in this example, th eprefix is 9)

Code: [Select]
ModemDialCmd:           ATDT9%s

Then, you can configure who receive the faxs in /etc/hylafax/etc/FaxDispatch.

Hope this help.

Cheers, Daniel
C'est la fin du monde !!! :lol:

Offline jester

  • *
  • 496
  • +1/-0
Re: iaxmodem
« Reply #9 on: November 28, 2007, 11:06:13 AM »
Somehow i can't get my head around this and can't seem to find an answer by googling for it. I just want to get this clear before i start messing up things with testing.

Can someone maybe tell me if it is possible to send/receive faxes with HylaFAX over SAIL/Asterisk that i've got connected to the PSTN with a simple hfc-BRI card? And if you know of a good howto...

Thanx!
jester.

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: iaxmodem
« Reply #10 on: November 29, 2007, 05:45:40 AM »
the only step I see missing there Daniel, is getting faxgetty running on iaxmodem.
Your howto works great, but the iaxmodem extension won't work unless I manually start faxgetty with;
faxgetty /dev/ttyIAX0
If I run that from the CLI it works great, which is pretty much where I was at anyway.
But your writeup is definately easier than how I got there.. 8-) 8-) 8-)


Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: iaxmodem
« Reply #11 on: November 29, 2007, 08:54:04 AM »
setting the port to be ttyIAX in the db, then expanding inittab and re-reading it (with telinit q) should start faxgetty. Can you check the file /etc/inittab, there should be a line like this:

fax:23457:respawn:/usr/sbin/faxgetty ttyIAX

then type telinit q, and check if faxgetty is running with:

ps aux | grep faxgetty
C'est la fin du monde !!! :lol:

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: iaxmodem
« Reply #12 on: November 29, 2007, 10:42:56 AM »
Thankyou for your help with this Daniel. 
It is very much appreciated.

Kind Regards

jeff@selintra.com

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: iaxmodem
« Reply #13 on: November 29, 2007, 12:29:10 PM »
You bloody ripper, thank you Daniel.
I had it right, well almost, if it was running on a windoze box that it.

It turns out I set it to fax:23457:respawn:/usr/sbin/faxgetty ttyiax0 , not fax:23457:respawn:/usr/sbin/faxgetty ttyIAX0 as it should be.
To much damn time on Windoze boxes, got my upper and lower case confused..... :grin: :grin: :grin: :grin: :grin:

Now Jeff, if I dial 5002, which iss my fax extension and is set in globals, iaxmodem answers and I get fax tones. I can transfer faxes to that ext and recieve them fine. But if someone sends a fax in Sail thinks there is no fax extension set? What gives.
The CLI says fax detected, but no fax extension found.....

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: iaxmodem
« Reply #14 on: November 29, 2007, 01:00:22 PM »
Try setting a longer fax delay value in globals.

What happens is this....

When asterisk autodetects a fax then the "fax" extension MUST be in the context which asterisk is currently processing or it will fail.  The agi is so damn fast that by the time asterisk figures out it has a fax, the agi has already delivered the call to an extension.  The faxdelay parameter in globals introduces a wait in the fax context so that SAIL effectively "hangs around a bit" while asterisk figures out if it's got a fax or not.

;-)

Best

S