返回列表 發帖

IAXmodem and Asterisk

先來一個帖子關於

來源: http://wiki.sangoma.com/wanpipe-linux-asterisk-faxing

Faxing using Asterisk-IAXmodem-HylaFax

Robust and reliable faxing can be achieved by using HylaFax. Iaxmodem is used to interface Asterisk with HylaFax.

PSTN <-> Sangoma Card <-> Zaptel <-> Asterisk <-> IAXmodem  

IAXmodem website: http://iaxmodem.sourceforge.net/
Softwitch (Spandsp) website: http://www.soft-switch.org/
HylaFax website: http://www.hylafax.org/

Please note that this is a quickstart guide, for more detailed configuration check the respective product websites and READMEs.

1. Package requirements

    libtiff
    libtiff-devel

2. Installing IAXmodem
    Untar your IAXmodem tarball (/usr/src/)
    #> cd /usr/src/
    #> tar xvfz iaxmodem-0.1.14.tar.gz
    Install libiax2:

    The libiax2 source is included with IAXmodem
    #> cd /usr/src/iaxmodem-0.1.14/lib/libiax2
    #> ./configure
    #> make; make  install

    Install spandsp:

    The spandsp source is included with IAXmodem
    #> cd /usr/src/iaxmodem-0.1.14/lib/spandsp
    #> ./configure
    #> make; make  install

    Install IAXmodem and create a symbolic link for IAXmodem in /usr/sbin

    #> cd /usr/src/iaxmodem-0.1.14/
    #> ./build
    #> ln -s /usr/sbin/iaxmodem iaxmodem

3. Running IAXmodem

    IAXmodem can be run in daemon and non-daemon mode, it is recommended to run IAXmodem in non-daemon mode during the installation/configuration for easier debugging and then run it in daemon mode once all configuration is working.

    Create the /etc/iaxmodem/ directory to store your  IAXmodem configuration files:
    #> mkdir /etc/iaxmodem

    You will need a separate configuration file for each fax line. Configuration for each fax line are  stored in /etc/iaxmodem/<name of fax device>.

    Create a configuration file for a fax device called ttyIAX1
    #> vi /etc/iaxmodem/ttyIAX1
    ---begin here---
    device          /dev/ttyIAX1
    uucp:uucp
    mode            660
    port            4571 ; you will need a different port for each device
    refresh         60
    server          127.0.0.1
    peername        iaxmodem1
    secret          password
    cidname         John Doe
    cidnumber       8005551212
    codec           ulaw
    ---end here---

    For more details about parameter options, see /usr/src/iaxmodem/README

    Add an IAX account for this modem in Asterisk:
    #> vi /etc/asterisk/iax.conf
    ---begin here---
    [iaxmodem1]
    type=friend
    secret=password
    host=dynamic
    port=4671
    context=outgoingfax
    allow=all
    ---end here---

    type "reload" in the Asterisk CLI to apply changes.

    Start IAXmodem for ttyIAX1
    #> iaxmodem ttyIAX1

    Start hylafax for ttyIAX1

一定可以,遲D有時間一定做功課。

還有小小,email有時唔work

TOP

回復 20# ckleea


   

Congratualtions!  Could you share this technique with us when you have time?

TOP

本帖最後由 bubblestar 於 2011-3-16 15:19 編輯

回復 19# ckleea


Some are logging data and some are error log.  Anyway, I found the resolution to make it and become quiet in my CLI console now.
   
In non-daemon mode IAXmodem does not detach itself from the controlling
tty, and it does send logging data both to standard output (informational
items) and to standard error (errors).  As this logging can be a bit
verbose, you may choose to ignore all of it by starting IAXmodem like
this:

/path/to/iaxmodem ttyIAX >/dev/null 2>&1

; the addition of latter part in the statement works.

http://iaxmodem.sourceforge.net/howto.php

TOP

回復 16# bubblestar

I can correctly get the callerID

TOP

Just ignore any error from IAXmodem in the console. Test if this works.

TOP

Thanks for the info.

TOP

All the scripts before this line is for callerID.

If you device is sip, add faxdetect=on in [general] of sip.conf

TOP

Thanks.  稍後試一試。

fax in,

exten => hkbn2b,n,Dial(IAX2/iax-fax2/${CALLERID(number)},20,d)

這個 n 應該是 1 吧! 還是前面還有一些 Answer() 之類的語法?

TOP

Callerid not working at the moment

TOP

in Extensions.conf

fax in,
I use 2b

exten => hkbn2b,n,Dial(IAX2/iax-fax2/${CALLERID(number)},20,d)


[fax-out]
exten => _X.,1,Dial(SIP/hkbn2b/${EXTEN})

TOP

回復 5# ckleea


除了早幾天安裝了的 iaxModem + HylaFAX,昨晚終於也裝好 frontend 的 AvantFax 了。
   
至於Asterisk 連接三者方面,可否POST 你的 fax extension.conf 是如何實現 fax-in 和 fax-out,看了一些寫法,但 IN、OUT 寫的都各有差異,似是一樣但卻又不同,愈看得多,愈覺得不太明白他們的寫法,最後混亂了,要暫停一下。

TOP

For general purpose outbound fax,
雯雯介紹的
www.outfax.com

唔錯。

TOP

If you use trixbox, follow this guide to setup

http://fonality.com/trixbox/foru ... ms/help/hylafax-how

TOP

Some more screenshot using Avantfax.

screenshot.11-03-2011 06.47.23.jpg

I use HKBN 2b account to fax in and out. 100% software based
Avantfax allows me to send / receive faxes via web gui. Then forward via email.

I have installed an OCR for fax but not tested.

TOP

返回列表