Author Topic: FAX  (Read 25946 times)

binary_dreamer

  • Full Member
  • ***
  • Posts: 55
  • Karma: 1
    • View Profile
FAX
« on: April 26, 2010, 01:51:16 PM »
It would be nice to have a fax to email and email to fax application in Askozia.
it is a nice and helpful app.

Michael

  • Askozia Staff
  • Hero Member
  • *
  • Posts: 1020
  • Karma: 49
    • View Profile
Re: FAX
« Reply #1 on: April 26, 2010, 04:47:42 PM »
Agreed, that would be great...


First step in fax support: fax pass-through on analog/isdn hardware

Second step: t.38 gateway <-> analog/isdn

Third step: fax to e-mail

Fourth step: e-mail to fax


Version 2.1 will have at least the first step included.

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #2 on: May 11, 2010, 05:41:28 PM »
Hi Michael

maybe the following Package's could be packaged/used in future for this feature.

http://www.voip-info.org/wiki/view/spandsp
http://www.voip-info.org/wiki/view/app_rxfax+and+app_txfax

Regards

Andy

Michael

  • Askozia Staff
  • Hero Member
  • *
  • Posts: 1020
  • Karma: 49
    • View Profile
Re: FAX
« Reply #3 on: May 11, 2010, 05:57:56 PM »
Those are already included in the image. Someone just needs to setup an example scenario which I can template.

(app_fax is the new name for those two apps)

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #4 on: May 11, 2010, 10:17:13 PM »
Does the following example help?

exten => s,1,ringing
exten => s,2,wait(6)
exten => s,3,rxfax(/tmp/fax/${UNIQUEID})
exten => s,4,Hangup
exten => h,1,system(tiff2pdf /tmp/fax/${UNIQUEID} -o /tmp/fax/${UNIQUEID}.pdf)
exten => h,2,system(php /root/mailer.php /tmp/fax/${UNIQUEID}.pdf)
exten => h,3,system(rm /tmp/fax/${UNIQUEID})
exten => h,4,system(mv /tmp/fax/${UNIQUEID}.pdf /peristent/storage/)

So.. maybe the /root/mailer.php could be the same script as you use for voicemails?


Andy

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #5 on: May 12, 2010, 06:56:38 AM »
Hi Michael

As I tried to test the app_fax, I found that the application is not beeing recognized. Do I need to load the app anyhow?

Thanks

Andy

...

/ # asterisk -r
Asterisk 1.6.1.18, Copyright (C) 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Set to realtime thread
Connected to Asterisk 1.6.1.18 currently running on AskoziaPBX (pid = 1414)
Verbosity is at least 3
AskoziaPBX*CLI> core show applications like fax
    -= Matching Asterisk Applications =-
    -= 0 Applications Matching =-
AskoziaPBX*CLI>

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #6 on: May 12, 2010, 07:01:59 AM »
Ok... I think I found the Problem...

I will to modify the modules.conf to load he app_fax.so, right?

Will test this evening/weekend.. :)

Andy

Michael

  • Askozia Staff
  • Hero Member
  • *
  • Posts: 1020
  • Karma: 49
    • View Profile
Re: FAX
« Reply #7 on: May 12, 2010, 09:10:33 AM »
Correct. Use the Integrator Panel (press 'ESC' in the webgui) and click on the Files tab. Override the contents of modules.conf with:

[modules]
autoload=yes



Restart the machine and you'll have access to all of the modules.

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #8 on: May 12, 2010, 07:21:52 PM »
Hi Michael

Now I receive the following error:

May 12 19:39:10 asterisk[1325]: WARNING[3570]: app_fax.c:178 in phase_e_handler: Error transmitting fax. result=49: The call dropped prematurely.
May 12 19:39:10 asterisk[1325]: WARNING[3570]: app_fax.c:769 in transmit: Transmission error

Do you have any idea? I'm testing in a mostly pure-voip-enviroment

FAX --> PSTN --> VoIP-Provider --> Askozia --> rxfax


fax-app
-------

1,ringing()
2,wait(6)
3,ReceiveFAX(/tmp/${UNIQUEID})
4,Hangup()
5,system(tiff2pdf /tmp/${UNIQUEID} -o /tmp/${UNIQUEID}.pdf)
6,system(uuencode /tmp/${UNIQUEID}.pdf | sendmail -s "FAX-Nachricht" adress@domain.com)
« Last Edit: May 12, 2010, 08:08:30 PM by andy »

giovanni.v

  • Hero Member
  • *****
  • Posts: 694
  • Karma: 53
    • View Profile
    • BoneOS SDK &  TeeBX VoIP communication platform
Re: FAX
« Reply #9 on: May 12, 2010, 09:00:02 PM »
I'm testing in a mostly pure-voip-enviroment

FAX --> PSTN --> VoIP-Provider --> Askozia --> rxfax

Try forcing to use only G.711 on the provider settings but mind that fax over VoIP is a challenge really hard to win.

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #10 on: May 12, 2010, 09:39:26 PM »
thanks giovanni for the hint. I tested allready with only "G.711 A-law" with no success. :(

also I tried to add "t38pt_udptl=yes" in [general] sip.conf.

Do you have any labor with a ISDN/PSTN-line?

Maybe you could test my application as below? :-)

PS: Don't forget to load the module app_fax.so in modules.conf

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #11 on: May 13, 2010, 09:22:53 PM »
I'm still testing.

At the moment with an old ATA-Brige from Zyxel.

Now I have the problem, that the Fax on the bridge can't call any Application. (BUSY).

But I can call from the FAX to an other internal phone. Also I can call from an internal Phone to every Application.

I don't know why.. (no error in logfile)  must it be a specific codec? is there an easy way to have more detailed log?

Thanks

Andy


andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #12 on: May 13, 2010, 10:25:31 PM »
OK... found the problem. After changing the Application form 00009999 to 1099 i can fax to my fax application.  ;D

Now.. I've the next problem..  :( or say challenge.

My Application looks currently: (from extensions.conf)

[APPLICATION-MAPPING-14316824284be9c53a261fc]
exten => _[0-9a-zA-Z*#]!,1,ringing()
exten => _[0-9a-zA-Z*#]!,2,wait(6)
exten => _[0-9a-zA-Z*#]!,3,ReceiveFAX(/tmp/${UNIQUEID})
exten => _[0-9a-zA-Z*#]!,4,Hangup()
exten => _[0-9a-zA-Z*#]!,5,system(tiff2pdf /tmp/${UNIQUEID} -o /tmp/${UNIQUEID}.pdf)
exten => s,1,ringing()
exten => s,2,wait(6)
exten => s,3,ReceiveFAX(/tmp/${UNIQUEID})
exten => s,4,Hangup()
exten => s,5,system(tiff2pdf /tmp/${UNIQUEID} -o /tmp/${UNIQUEID}.pdf)

But the lines shold look like:
[APPLICATION-MAPPING-14316824284be9c53a261fc]
exten => _[0-9a-zA-Z*#]!,1,ringing()
exten => _[0-9a-zA-Z*#]!,2,wait(6)
exten => _[0-9a-zA-Z*#]!,3,ReceiveFAX(/tmp/${UNIQUEID})
exten => _[0-9a-zA-Z*#]!,4,Hangup()
exten => _[0-9a-zA-Z*#]!,1,system(tiff2pdf /tmp/${UNIQUEID} -o /tmp/${UNIQUEID}.pdf)
exten => s,1,ringing()
exten => s,2,wait(6)
exten => s,3,ReceiveFAX(/tmp/${UNIQUEID})
exten => s,4,Hangup()
exten => h,1,system(tiff2pdf /tmp/${UNIQUEID} -o /tmp/${UNIQUEID}.pdf)



So it will get executed after the hungup.
I can't set this parameter in the GUI (syntax error). But It work when I set it directly in extensions.conf and reload the config file.

I will also need to extend the application to send the fax via mail, i've got it working.. but will post the complete script tomorow..

Andy

Michael

  • Askozia Staff
  • Hero Member
  • *
  • Posts: 1020
  • Karma: 49
    • View Profile
Re: FAX
« Reply #13 on: May 14, 2010, 07:00:42 AM »
Looking good so far. Thanks for working on it.

andy

  • Sr. Member
  • ****
  • Posts: 163
  • Karma: 8
    • View Profile
Re: FAX
« Reply #14 on: May 14, 2010, 07:06:31 AM »
Hi Michael

Is there a Plan to change the Application-Editor, for supporting "after-hungup"-tasks?