TUTORIAL HylaFAX / AvantFax for PIAF! - Parts 1-4

I've been trying to get this to work with asterisk 1.6 / dahdi but have some issues, doesn't seem to be able to interface with the IAX modems, even if I change the trunk info to reflect dahdi.

I ran the script twice (facepalm) and now i have 8 modems all with the "please wait" status, i went through and removed the duplicates from iax_duplicates, but it's still showing 8 modems.

Hate rebuilding these phone systems everytime something like avantfax fails and i need to re-install. ANGRY FACE!
 
Hi

It's never a good idea to run these scripts twice, without actually checking what they do and making modifications to the script first. I do mention this in the warning at the beginning of the script.

If IAXModem/Hylafax/Avantfax is already installed, then you should inspect and modify this script, or your installation before executing it.

The first thing to do is open up the script, and follow it line by line, and undue the duplicates. This will also give you a good idea of how it all goes together for later fault-finding.

The presence of Dahdi should have no direct effect on Hylafax, as the interface between Hylafax and Asterisk is as follows:-

  • Avantfax -> Hylafax
  • Hylafax -> IAXMODEM
  • IAXMODEM -> Asterisk
  • Asterisk -> Trunks (Dahdi or voIP)
I have also tested the script with Asterisk 1.6, and found it to work fine.

Once you have removed the duplicates, you should be able to work through each part of the system, and check it all works. In the list above, I would start at the bottom, and work my way up.

Joe
 
You should tail your logs to see what it says when your iaxmodems try to register...

I'm guessing you are facing a problem with the enhanced security of IAX in Asterisk 1.6

You probably need something like:
Code:
requirecalltoken=no
 
Fax Inbound Routing via DID

I have the Hylafax solution installed with Joe's script. It works fine I just can't seem to figure out how to route by individual DID numbers. I have both DID's on the inbound routes and both are set to the custom destination Fax (Hylafax) Each call seems to go to the first modem and then e-mailed to that e-mail address. I have setup different e-mail destinations for modem0 and modem1 each has a specific fax category as well. I just can't seem to figure this out anyone have a solution to my problem ?

PBIAF 1.4.21.2 CentOS 5.4 (final)
 
This really doesn't work with Dahdi... can someone please shed some light?

I have followed the guide to the point, except I have changed the following in extensions_custom.conf

[from-fax]
exten => _.,1,goto(from-internal,9${EXTEN},1)
exten => _x.,n,Hangup()

My Trunk is a ZAP (dahdi compatible), with the identifier g0
This works fine for out going calls, however when I try fax out here's what the asterisk cli says....

Code:
Called g0/0738541381
    -- DAHDI/1-1 is proceeding passing it to IAX2/iax-fax0-3200
    -- Channel 0/1, span 1 got hangup request, cause 17
    -- DAHDI/1-1 is busy
    -- Hungup 'DAHDI/1-1'
  == Everyone is busy/congested at this time (1:1/0/0)
    -- Executing [s@macro-dialout-trunk:20] NoOp("IAX2/iax-fax0-3200", "Dial failed for some reason with DIALSTATUS = BUSY and HANGUPCAUSE = 17") in new stack
    -- Executing [s@macro-dialout-trunk:21] Goto("IAX2/iax-fax0-3200", "s-BUSY,1") in new stack
    -- Goto (macro-dialout-trunk,s-BUSY,1)
    -- Executing [s-BUSY@macro-dialout-trunk:1] NoOp("IAX2/iax-fax0-3200", "Dial failed due to trunk reporting BUSY - giving up") in new stack
    -- Executing [s-BUSY@macro-dialout-trunk:2] PlayTones("IAX2/iax-fax0-3200", "busy") in new stack
    -- Executing [s-BUSY@macro-dialout-trunk:3] Busy("IAX2/iax-fax0-3200", "20") in new stack
  == Spawn extension (macro-dialout-trunk, s-BUSY, 3) exited non-zero on 'IAX2/iax-fax0-3200' in macro 'dialout-trunk'
  == Spawn extension (from-internal, 90738541381, 4) exited non-zero on 'IAX2/iax-fax0-3200'
    -- Executing [h@from-internal:1] Macro("IAX2/iax-fax0-3200", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("IAX2/iax-fax0-3200", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,4)


I haven't tried to inbound faxing.

Any ideas, we have this working on other phone systems, however this is the first asterisk 1.6 / Dahdi system we have tried.
 
Hi

Is this on Digital lines? Do you need to set the CallerID correctly to send out a call via the PRI / BRI?

If this is the case can set the correct caller ID in the /etc/iaxmodem configurations.

Joe
 
I am having three issues.
First, I have specified email addresses in the Contact field of all the modems, but the faxes are not being emailed. If I manually send the email from the AvantFax viewer online, it works fine. Also, sendmail works for anything else on the server. How can I change the email address that the faxes come from? Right now it shows "root@localhost" as the email.

Second, I setup the "print faxes when received" that is on page ~6 or so of this thread and that is not working either. CUPS is started, and the printer and server are on the same subnet, same router, etc. The hostname is set correctly, and so is the IP address.

Third, outbound faxes are not working. My fax machine answers the call and says on the screen "Receiving p.1 from IAXmodem". According to the error message printout, "Error 244 - A communication error occurred during the fax transmission". And then it tries to send the fax again, fails again, tries again, fails again. It tries for a total of 3 attempts, but all fail. I am using a Sangoma U100 fxo device on a Verizon land line and I have a HP Officejet 7410 on the receiving end.

I am running PIAF 1.4, Asterisk 1.4.21.2, Zaptel 1.4.12.1, Avantfax 3.1.6. If you need logs, please let me know what is needed.
Thanks!

EDIT: I temporarily re-routed outgoing faxes to my VoipMS line, and it worked flawlessly. I think the problem was that the fax was being sent as soon as the call went out over Zaptel. I will leave outgoing faxes like this for now, however, this is still showing up as from IAXmodem. Inbound faxes still work fine on ZAP, though. No joy on the "print when received" or "email when received".
 
Avantfax and Mac

Thanks Joe, that appears to have worked. Great Help.

Anyway, I'm using a B410p, Asterisk 1.6 / Dahdi
Running OSX 10.5.8

Here's my guide on how I got avantfax working, and then configure it so I could send faxes from my Mac without going into the WEB GUI.

I've basically scoured this threat, and other threads and used my own knowledge and crammed it all together. Big thanks to Mr Roper.

For starters, I run the setup script supplied by Joe and Tshif

cd /root

wget http://www.fonicaprojects.com/downlo...iaf-hylafax.sh

chmod +x piaf-hylafax.sh

./piaf-hylafax.sh

update-fixes
Next, download and install the webmin module.


Now the config...

Inside the file iax_custom.conf file, in each of the four [iax-faxX] contexts, change the context name "from-internal" to "from-fax"

Inside the file extensions_custom.conf, add this to the bottom of the file:-
[from-fax]
exten => _.,1,goto(from-internal,9${EXTEN},1)
exten => _x.,n,Hangup()


Edit iax_general_custom.conf add the following..
maxcallnumbers=100
calltokenoptional=0.0.0.0/0.0.0.0


Goto etc\iaxmodem
Edit each of the iaxmodem-cfg.ttyIAX files and make sure the CID number is added and looks like the below, obviously changing the number to match the actual FAX CID number.
cidnumber +32163218



Lastly... Running in Mac OSX

Finally we need to make some changes so that Computers on the same network can talk with Haylafax server.
Replace the X with your Gateway.
In shell:
iptables -A INPUT -p tcp -m tcp -s 192.168.X.0/255.255.255.0 -j ACCEPT
service iptables save
service iptables restart

Now, on the client desktop install the FAX90 Client (http://www.gigasys.it/site/hylafax-mac-free-client.html) There are others available but I find this on the best.
Install to Applications folder. Open and select keep in dock.
-The first time you run an fax server message will appear, ignore this.


- Goto the FAX90 menu item, click setup
-Enter the following details
Fax Server IP: The PBX IP
Username: The avantfax username of that user
Password: Password of that user
E- mail: Their E-mail
Prefix: Leave blank


fax.jpg

The default username and password is (admin/password) I suggest not using this.

Now my Avantfax is working on OSX with Dahdi. :) thanks all

 
Hi

Good effort.

I'm not sure about this line -

Code:
iptables -A INPUT -p tcp -m tcp -s 192.168.X.0/255.255.255.0  -j  ACCEPT

I know that you are only allowing access from within your own network, but I would suggest that you see if you can identify the ports being used, and only open them individually

Joe
 
So after i follow all the steps i can seem to recieved any inbound fax.

Below is my asterisk console output

any help would be great.

== Manager 'admin' logged off from 127.0.0.1
-- Executing [2675195492@from-trunk:1] Set("SIP/IDVIN-b7606538", "__FROM_DID=2675195492") in new stack
-- Executing [2675195492@from-trunk:2] Gosub("SIP/IDVIN-b7606538", "app-blacklist-check|s|1") in new stack
-- Executing [s@app-blacklist-check:1] LookupBlacklist("SIP/IDVIN-b7606538", "") in new stack
-- Executing [s@app-blacklist-check:2] GotoIf("SIP/IDVIN-b7606538", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:3] Set("SIP/IDVIN-b7606538", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:4] Return("SIP/IDVIN-b7606538", "") in new stack
-- Executing [2675195492@from-trunk:3] ExecIf("SIP/IDVIN-b7606538", "0 |Set|CALLERID(name)=8662056655") in new stack
-- Executing [2675195492@from-trunk:4] Set("SIP/IDVIN-b7606538", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [2675195492@from-trunk:5] SetCallerPres("SIP/IDVIN-b7606538", "allowed_not_screened") in new stack
-- Executing [2675195492@from-trunk:6] Goto("SIP/IDVIN-b7606538", "custom-fax-iaxmodem|s|1") in new stack
-- Goto (custom-fax-iaxmodem,s,1)
-- Executing [s@custom-fax-iaxmodem:1] Dial("SIP/IDVIN-b7606538", "IAX2/iax-fax0/s") in new stack
-- Called iax-fax0/s
-- Call accepted by 127.0.0.1 (format ulaw)
-- Format for call is ulaw
-- IAX2/iax-fax0-12048 is ringing
-- IAX2/iax-fax0-12048 answered SIP/IDVIN-b7606538
-- Hungup 'IAX2/iax-fax0-12048'
== Spawn extension (custom-fax-iaxmodem, s, 1) exited non-zero on 'SIP/IDVIN-b7606538'
== Parsing '/etc/asterisk/manager.conf': Found
 
I have the fax addon installed liked described. However since that is installed, the system is constantly running:

Code:
[2010-07-14 01:38:55] DEBUG[3381] sched.c: Request to schedule in the past?!?!
[2010-07-14 01:38:55] DEBUG[3381] sched.c: Request to schedule in the past?!?!
[2010-07-14 01:38:55] WARNING[3381] chan_sip.c: Got 200 OK on REGISTER that isn't a register
[2010-07-14 01:39:26] NOTICE[3357] chan_iax2.c: Restricting registration for peer '203' to 60 seconds (requested 300)
[2010-07-14 01:39:26] NOTICE[3344] chan_iax2.c: Restricting registration for peer '204' to 60 seconds (requested 300)
[2010-07-14 01:40:21] NOTICE[3357] chan_iax2.c: Restricting registration for peer '203' to 60 seconds (requested 300)
[2010-07-14 01:40:21] NOTICE[3344] chan_iax2.c: Restricting registration for peer '204' to 60 seconds (requested 300)
[2010-07-14 01:41:16] NOTICE[3357] chan_iax2.c: Restricting registration for peer '203' to 60 seconds (requested 300)
[2010-07-14 01:41:16] NOTICE[3347] chan_iax2.c: Restricting registration for peer '204' to 60 seconds (requested 300)
[2010-07-14 01:42:11] NOTICE[3348] chan_iax2.c: Restricting registration for peer '203' to 60 seconds (requested 300)
[2010-07-14 01:42:11] NOTICE[3357] chan_iax2.c: Restricting registration for peer '204' to 60 seconds (requested 300)
[2010-07-14 01:42:21] NOTICE[3355] chan_iax2.c: Peer 'iax-fax1' is not dynamic (from 127.0.0.1)
[2010-07-14 01:42:21] NOTICE[3344] chan_iax2.c: Peer 'iax-fax2' is not dynamic (from 127.0.0.1)
[2010-07-14 01:42:21] NOTICE[3357] chan_iax2.c: Peer '200' is not dynamic (from 127.0.0.1)
[2010-07-14 01:42:21] NOTICE[3345] chan_iax2.c: Peer 'iax-fax0' is not dynamic (from 127.0.0.1)
[2010-07-14 01:42:21] NOTICE[3358] chan_iax2.c: Peer 'iax-fax3' is not dynamic (from 127.0.0.1)
Constantly. I have attached a longer log here:
http://pastebin.com/8VQtsG3c


Thank you
 
On one of the first pages:
Preparing the Firewall: Iptables
In order to allow the Winprint HylaFAX program to reach the PBX from any workstation on the local subnet, we need to execute a command similar to this (from putty or your favorite tool):
(This firewall rule was updated 3/6/09 10:30 AM)
iptables -A INPUT -p tcp -m tcp -s 192.168.1.0/255.255.255.0 -j ACCEPT
service iptables save
service iptables restart

Change the “ 192.168.1.0/255.255.255.0” to reflect your actual network subnet and subnet mask.

It should be possible to tighten this iptable rule further by specifying which ports to open, but we have as yet been unable to determine which ports are used by the Winprint driver.
and recently:
Hi

Good effort.

I'm not sure about this line -

Code:
iptables -A INPUT -p tcp -m tcp -s 192.168.X.0/255.255.255.0  -j  ACCEPT

I know that you are only allowing access from within your own network, but I would suggest that you see if you can identify the ports being used, and only open them individually

Joe

Answer:

Hylafax uses TCP 4557 and 4559.
 
Hi

I've sent the script and install files to the PiaF team at the weekend for hosting, so this will all work once they have hosted them, and I have adjusted the script to suit.

One file I am missing is the fax icon, so if someone could do the honours, I'd appreciate it.

Joe
 
Thanks for all the help that people have put in to putting together installs cripts for the pbxiaf boxes. Do we know if they're going to get hosted again?
 
Hi

I've sent the tarballs to Ward, who said that he would be glad to host them, and I await notification as to their location.

Yours

Joe
 

Members online

No members online now.

Forum statistics

Threads
26,696
Messages
174,454
Members
20,266
Latest member
ro-fi
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top