Menu

Asterisk + Hylafax + Iaxmodem; unable to send fax.

2018-11-26
2018-11-27
  • Miguel Sanchez Cuarental

    Hi everyone.

    We are trying to configure a system to send faxes using iaxmodem, hylafax and asterisk but we are not able to send faxes. We have the following configuration.

    IaxModem service configuration:
    CountryCode: 34
    AreaCode: 91
    FAXNumber: +34.91.987.56908
    LongDistancePrefix: 1
    InternationalPrefix: 011
    DialStringRules: etc/dialrules
    ServerTracing: 1
    SessionTracing: 11
    RecvFileMode: 0600
    LogFileMode: 0600
    DeviceMode: 0600
    RingsBeforeAnswer: 1
    SpeakerVolume: off
    GettyArgs: "-h %l dx_%s"
    LocalIdentifier: "NothingSetup"
    TagLineFont: etc/lutRS18.pcf
    TagLineFormat: "From %%l|%c|Page %%P of %%T"
    MaxRecvPages: 25
    ModemType: Class1 # use this to supply a hint
    ModemResetCmds: "ATH1\nAT+VCID=1" # enables CallID display
    ModemReadyCmds: ATH0

    Class1AdaptRecvCmd: AT+FAR=1
    Class1TMConnectDelay: 400 # counteract quick CONNECT response
    CallIDPattern: "NMBR="
    CallIDPattern: "NAME="
    CallIDPattern: "ANID="
    CallIDPattern: "NDID="

    The modem has this configuration:
    device /dev/ttyIAX0
    owner uucp:uucp
    mode 660
    port 4570
    refresh 60
    server 127.0.0.1
    peername iaxmodem
    secret password
    codec alaw

    In /etc/asterisk/iax.conf
    [general]
    bindport=4569
    bindaddr=0.0.0.0
    srvlookup=yes
    language=es
    bandwidth=low
    disallow=all
    allow=alaw
    allow=ulaw

    [iaxmodem]
    type=friend
    secret=password
    port=4570
    host=dynamic
    context=fax-out
    disallow=all
    allow=alaw
    qualify=yes
    requirecalltoken=no
    jitterbuffer=no

    In chan_dahd.conf, we have:
    [general]
    group=0,11
    context=from-isdn
    overlapdial = yes
    switchtype = euroisdn
    signalling = bri_cpe_ptmp
    channel => 1-2
    context = default
    group = 63

    [channels]
    language=es
    context=public
    switchtype=euroisdn
    pridialplan=national
    prilocaldialplan=national
    usecallerid=yes
    callwaiting=yes
    usecallingpres=yes
    callwaitingcallerid=yes
    threewaycalling=yes
    transfer=yes
    canpark=yes
    cancallforward=yes
    callreturn=yes
    echocancel=yes
    echocancelwhenbridged=yes
    group=1
    callgroup=1
    pickupgroup=1
    busydetect=yes
    busycount=10
    faxdetect=both

    In extensions.conf file we have the following rules for fax-out

    [fax-out]
    exten => _X.,1,Dial(dahdi/1/${EXTEN},,r)
    exten => _X.,n,Hangup()

    The services are running without any problem.
    asterisk
    hylafax
    iaxmodem
    faxgetty

    When we try to send a fax with this sentence "sendfax -n -d 91XXXXXXX /var/spool/fax/test.pdf" we get the following error.

    • In CLI console:

    communication-server-velleCLI>
    -- Accepting AUTHENTICATED call from 127.0.0.1:4570:
    -- > requested format = alaw,
    -- > requested prefs = (),
    -- > actual format = alaw,
    -- > host prefs = (alaw),
    -- > priority = mine
    -- Executing [XXXXXXX@fax-out:1] Dial("IAX2/iaxmodem-4216", "dahdi/1/91XXXXXXX,,r") in new stack
    -- Requested transfer capability: 0x00 - SPEECH
    -- Called dahdi/1/91XXXXXXX
    -- DAHDI/i1/91XXXXXXX-2 is proceeding passing it to IAX2/iaxmodem-4216
    -- DAHDI/i1/91XXXXXXX-2 is ringing
    -- DAHDI/i1/91XXXXXXX-2 is making progress passing it to IAX2/iaxmodem-4216
    -- DAHDI/i1/91XXXXXXX-2 answered IAX2/iaxmodem-4216
    -- Channel DAHDI/i1/91XXXXXXX-2 joined 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Channel IAX2/iaxmodem-4216 joined 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Span 1: Channel 0/1 got hangup request, cause 102
    -- Channel DAHDI/i1/91XXXXXXX-2 left 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Channel IAX2/iaxmodem-4216 left 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Hungup 'DAHDI/i1/91XXXXXXX-2'
    == Spawn extension (fax-out, 91XXXXXXX, 1) exited non-zero on 'IAX2/iaxmodem-4216'
    -- Hungup 'IAX2/iaxmodem-4216'
    communication-server-velle
    CLI>

    In the log file of hylafax

    nov 26 14:15:40.49: [ 2108]: HylaFAX (tm) Version 6.0.7
    nov 26 14:15:40.49: [ 2108]: SEND FAX: JOB 11 DEST 91XXXXXXX COMMID 000000001 DEVICE '/dev/ttyIAX0' FROM 'root root@communication-server-velle' USER root
    nov 26 14:15:40.49: [ 2108]: <-- [12:AT+FCLASS=1\r]
    nov 26 14:15:40.49: [ 2108]: --> [2:OK]
    nov 26 14:15:40.49: [ 2108]: DIAL 91XXXXXXX
    nov 26 14:15:40.49: [ 2108]: <-- [14:ATDT91XXXXXXX\r]
    nov 26 14:17:32.49: [ 2108]: --> [10:NO CARRIER]
    nov 26 14:17:32.49: [ 2108]: SEND FAILED: JOB 11 DEST 91XXXXXXX ERR [2] No carrier detected
    nov 26 14:17:33.49: [ 2108]: <-- [5:ATH0\r]
    nov 26 14:17:33.49: [ 2108]: --> [2:OK]
    nov 26 14:17:33.49: [ 2108]: SESSION END

    If we try the previous sentence with +34 (prefix of Spain), the error change and these are the files:
    In the CLI console:
    -- Accepting AUTHENTICATED call from 127.0.0.1:4570:
    -- > requested format = alaw,
    -- > requested prefs = (),
    -- > actual format = alaw,
    -- > host prefs = (alaw),
    -- > priority = mine
    -- Executing [1918041547@fax-out:1] Dial("IAX2/iaxmodem-4388", "dahdi/1/191XXXXXXX,,r") in new stack
    -- Requested transfer capability: 0x00 - SPEECH
    -- Called dahdi/1/191XXXXXXX
    -- DAHDI/i1/191XXXXXXX-10 is proceeding passing it to IAX2/iaxmodem-4388
    -- Span 1: Channel 0/1 got hangup request, cause 1
    -- Hungup 'DAHDI/i1/191XXXXXXX-10'
    == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [1918041547@fax-out:2] Hangup("IAX2/iaxmodem-4388", "") in new stack
    == Spawn extension (fax-out, 1918041547, 2) exited non-zero on 'IAX2/iaxmodem-4388'
    -- Hungup 'IAX2/iaxmodem-4388'

    In the log file of hylafax:

    nov 26 14:44:36.44: [ 2679]: SESSION BEGIN 000000003 3491XXXXXXX
    nov 26 14:44:36.44: [ 2679]: HylaFAX (tm) Version 6.0.7
    nov 26 14:44:36.44: [ 2679]: SEND FAX: JOB 12 DEST +3491XXXXXXX COMMID 000000003 DEVICE '/dev/ttyIAX0' FROM 'root root@communication-server-velle' USER root
    nov 26 14:44:36.44: [ 2679]: <-- [12:AT+FCLASS=1\r]
    nov 26 14:44:36.44: [ 2679]: --> [2:OK]
    nov 26 14:44:36.44: [ 2679]: DIAL 191XXXXXXX
    nov 26 14:44:36.44: [ 2679]: <-- [15:ATDT191XXXXXXX\r]
    nov 26 14:44:37.42: [ 2679]: --> [4:BUSY]
    nov 26 14:44:37.42: [ 2679]: SEND FAILED: JOB 12 DEST +3491XXXXXXX ERR [1] Busy signal detected
    nov 26 14:44:38.42: [ 2679]: <-- [5:ATH0\r]
    nov 26 14:44:38.42: [ 2679]: --> [2:OK]
    nov 26 14:44:38.42: [ 2679]: SESSION END

    We don´t know if we are missing or mistaking something in any configuration file or any other issue.

    Please, send help!!!

    Thank you very much in advance.

     
  • Lee Howard

    Lee Howard - 2018-11-27

    -- DAHDI/i1/91XXXXXXX-2 is making progress passing it to IAX2/iaxmodem-4216
    -- DAHDI/i1/91XXXXXXX-2 answered IAX2/iaxmodem-4216
    -- Channel DAHDI/i1/91XXXXXXX-2 joined 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Channel IAX2/iaxmodem-4216 joined 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Span 1: Channel 0/1 got hangup request, cause 102
    -- Channel DAHDI/i1/91XXXXXXX-2 left 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Channel IAX2/iaxmodem-4216 left 'simple_bridge' basic-bridge <4968a289-00f1-408f-a0e4-83d89cfc5edb>
    -- Hungup 'DAHDI/i1/91XXXXXXX-2'

    nov 26 14:15:40.49: [ 2108]: <-- [14:ATDT91XXXXXXX\r]
    nov 26 14:17:32.49: [ 2108]: --> [10:NO CARRIER]

    This (NO CARRIER) means that the modem was unable to detect any fax receiver on the channel after the call was placed even though the call was answered. In other words, either you're not calling to a fax receiver or the call is not getting through for some reason. Bottom line: the issue is either with the number dialed or with your Asterisk configuration.

    The "hangup request, cause 102" is a clue. That means "RECOVERY_ON_TIMER_EXPIRE". So something is, indeed, wrong with your Asterisk dialplan or configuration or with your telco service provider.

    Probably the best course of action would be to work with your telco for assistance.

     

Log in to post a comment.