Koozali.org: home of the SME Server

Sail Fax detection

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« on: May 30, 2007, 12:40:21 AM »
I'm trying to configire FAX detection using SAIL, a TDM400B, a fax machine and a capable SIP adapter.
Are there any tricks I need to know for the detection to work and send it to the right extension? (Set in globals, which has the fax machine connected to it)
I tried Late Termination ON/OFF
Fax Detect 2
Ring Delay 10

Thanks,

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Sail Fax detection
« Reply #1 on: May 31, 2007, 06:06:51 PM »
Have you set FAX detection on in the trunk?  it's a checkbox at the top of the page.

2 seconds might be a little quick.  Try 3 if you aren't getting detection.

Have you set the FAX extension in Globals?

Have you made sure that the Codec is G711 (ulaw or alaw) between asterisk and the ATA?

If your FAX is a decent one, it may be running ECM (error correction mode).  If it is, then try turning it off.


Watch on the console; you will see the FAX detection happen.  Routing via SIP thru an ATA may work.  The ATA has to be able to sense the FAX and immediately turn Echo cancellation off.  Sipura/Linksys units can do this but I don't know about others.  

Even then, it may still not work.  FAX over IP is a bit of a black art and really should only be done using T38 (which Asterisk currently doesn't support - coming soon), however on a lightly loaded LAN you can often get reasonable results over SIP.  You almost certainly won't get reasonable results with SIP over a WAN.

Best

S

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #2 on: June 01, 2007, 05:51:17 AM »
Quote from: "selintra"
Have you set FAX detection on in the trunk?  it's a checkbox at the top of the page.


That was it :)

Quote
Watch on the console; you will see the FAX detection happen.  Routing via SIP thru an ATA may work.  The ATA has to be able to sense the FAX and immediately turn Echo cancellation off.  Sipura/Linksys units can do this but I don't know about others.  


If I set it to go straight to the extension where the fax machine is, it works. But if I let it detect, it does not send it to the fax extension delegated in globals. It tells me there's no fax extension:

Jun  1 00:39:56 NOTICE[2097]: chan_zap.c:4661 zt_read: Fax detected, but no fax extension

Shouldn't it just go to the extension set in globals? I'm using 2.1.14-438 if that matters.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Sail Fax detection
« Reply #3 on: June 01, 2007, 08:40:44 AM »
Hi SS

Not sure but you may have found a little bug.  I've had a quick look at the code and it looks to be doing what it should but I'll need to run some tests.

I'll get back to you on this.

Best

S

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #4 on: June 02, 2007, 03:49:23 AM »
Ok, let me know how can I help.
I just ordered a linksys ATA, I have a signalC and a Artdio device that I was testing. Both say they support the T.38 (and like I said they receive just fine if I tell the call to go them).

Thanks,

Offline del

  • *
  • 765
  • +0/-0
Sail Fax detection
« Reply #5 on: June 02, 2007, 05:08:46 AM »
I have a Sipuira 2000 with a external modem connected for hylafax and I have the same problem, I can receive if I send the trunk to the extension but it doesn't auto detect. I am also using a SIP line to send and receive. :D  
Quote
The ATA has to be able to sense the FAX and immediately turn Echo cancellation off. Sipura/Linksys units can do this
Can you point me in right direction to set this up.  :D Thanks.

Del
If at first you don't succeed, then sky-diving is not for you!
"Life is like a coin. You can spend it anyway you wish, but you can only spend it once." --Author Unknown

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Sail Fax detection
« Reply #6 on: June 02, 2007, 06:23:44 PM »
Hi

I set up a couple of Fax machines in the office this afternoon.  The autosense does work but its a little slow.  However I can regularly get FAX diversion to occur with a fax detect delay of 4 seconds on a TDM400 board.  My guess is that an X100P will take about 1 second longer.  This was on SAIL-457, which I'm pretty sure is available for download from the pre-release folder on the download site.

Kind Regards

S

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #7 on: June 02, 2007, 07:41:11 PM »
I upgraded to 455 (latest available on the download site), it detects right away even at 2sec.. But my problem is not directing to the right extension :(

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Sail Fax detection
« Reply #8 on: June 02, 2007, 08:48:36 PM »
Hmmm,

Yes, but have you set a longer FAX detect value?  If you are getting the message "Fax detected, but no fax extension", it's because the AGI has resumed processing in another context before fax detection occurred.  For FAX detect to work, you have to be in the same context as the "fax" extension when detection occurs.  The way SAIL handles this is to issue an n second background silence, where n is the fax detect value in Globals.  This ensures that the AGI is still in the fax context when detection occurs.  If it isn't then you wil get the   "Fax detected, but no fax extension" message.  As long as the "fax" extension is driven then the AGI will dial the fax number you specify in globals and you should then have redirection.  

 Hope that made sense. :-)

Best

S

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #9 on: June 05, 2007, 01:56:52 AM »
Quote from: "selintra"
The way SAIL handles this is to issue an n second background silence, where n is the fax detect value in Globals.  This ensures that the AGI is still in the fax context when detection occurs.  If it isn't then you wil get the   "Fax detected, but no fax extension" message.


Ok, then maybe this message is the reason of my problems?
Code: [Select]
AGI Rx << EXEC Background silence/4
Jun  4 20:04:41 WARNING[20534]: file.c:512 ast_openstream_full: File silence/4 does not exist in any format
Jun  4 20:04:41 WARNING[20534]: file.c:824 ast_streamfile: Unable to open silence/4 (format unknown): No such file or directory
Jun  4 20:04:41 WARNING[20534]: pbx.c:5798 pbx_builtin_background: ast_streamfile failed on Zap/3-1 for silence/4
[/quote]

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #10 on: June 05, 2007, 02:39:53 AM »
Thank you, Thank you!!!
That was it!

 :pint:

I downloaded the silence files from loligo.com

Offline Franco

  • *
  • 1,171
  • +0/-0
    • http://contribs.org
Sail Fax detection
« Reply #11 on: June 05, 2007, 02:45:48 AM »
...  :D now I'm excited! Lol.
For those of you with hylafax, this works fine too and I have set the fax detect to 2 (TDM in my case).