More Fax, More Features: Asterisk Fax Detection

By Malcolm Davenport


In Digium’s continuing quest to deliver you, our users of Free Fax For Asterisk, and our customers of Fax For Asterisk, with the best possible solution, we are pleased to announce the availability of version 1.2 of…(drum roll without suspense) Fax For Asterisk.

How has this version improved?

Why, with new features, of course, hence the title of this blog post.

New features include:

  • DAHDI Buffer Policy Implementation – Currently requiring the trunk version of Asterisk, in addition to the 1.2 release of Fax For Asterisk, new dialplan functions to allow the setting of buffer policies to prevent fax failures on higher latency systems, e.g.:exten => 1234,Set(CHANNEL(buffers)=”12,half”)where “12” represents a number of buffers (each buffer is 20ms), configurable between 4 and 32, and where “half” represents the policy implementation, configurable as “immediate,” “full,” or “half.”

    To use, simply set your buffer policy in your dialplan before any send/receive fax operation across a DAHDI channel.

  • SIP Fax Detection Options -At present, also requiring the trunk version of Asterisk in addition to the 1.2 release of Fax For Asterisk, new options are available related to T.38 session initiation. Older releases of Fax For Asterisk only detect T.38 fax upon the receipt of CNG. In practice, we’ve discovered that a number of T.38 providers send T.38 invites immediately, and never send CNG to initiate a T.38 session. Thus, the faxdetect option in sip.conf can now be set to:no – To disable all fax detectioncng – To trigger fax detection based on the receipt of a CNG tonet38 – To trigger fax detection based on the receipt of a SIP T.38 invite, without CNG tone

    yes – To trigger fax detection based on the receipt of either a CNG tone or a SIP T.38 invite.

    These changes should improve our compatibility with the wild, wild west of T.38 implementations.

  • New CLI Commands -New Asterisk command line interface commands are available to display the settings configured in res_fax and res_fax_digium, simply run:fax show settingsto see your current settings.
  • Asterisk CLI Type Column -A “Type” column is now displayed when “fax show sessions” is run on the Asterisk CLI, informing the user whether the fax is of type “G.711” or of type “T.38.”
  • ECM Configuration per Provider / Peer & Configuration Moved -Error correction mode may now be configured on a per provider / peer basis. This proves useful in the case that a provider does not implemented T.38 ECM properly. Digium has observed that ECM must be disabled for T.38 faxing to work properly with Gafachi.Configuration of error correction mode has moved from into the res_fax.conf configuration file. Note that the default setting is still to enable ECM.
  • SendFax initiate T.38 re-invite -Digium observed that a number of providers or far-end systems did not send a T.38 re-invite and instead waited for the local system (Asterisk) to send it instead. The SendFax application now supports the “z” option to enable this feature. If the “z” option is set during a SendFax, then res_fax will initiate the T.38 re-invite if it is not received in 10 (ten) seconds from the far end. Digium observed that the “z” option must be used for T.38 faxing to work properly with Gafachi.
  • Send / ReceiveFax G.711 Fallback mode -A new fallback option “f” has been added to the SendFax and ReceiveFax applications. In the event that T.38 negotiation fails, enabling this option will cause Asterisk to revert to audio fax mode. Digium has observed this is required for some providers, like BroadVox, who provide T.38 for inbound faxing, but accept only audio faxing for outbound.Please note that audio faxing over the Internet is very unreliable, and Digium cannot provide support for fax failures due to poor Internet connections.
  • New Debugging utilities -In order to make debugging easier, we’ve added two new command line capture options, one for audio faxes and one for T.38 faxes.For audio capture, do “fax set g711cap on” in the Asterisk CLI and a stereo wav file will be created for each fax session. The resulting files will be saved in /var/log/asterisk/g711cap. To stop capture, do “fax set g711cap off.”For T.38 capture, do “fax set t38cap on” in the Asterisk CLI and a Wireshark compatible pcap file will be created for each fax session. The resulting files will be saved in /var/log/asterisk/t38cap. To stop capture, do “fax set t38cap off.”

Ready to upgrade?

Run right over to the Fax For Asterisk Download Selector and grab the new release.

As always, we thank you for your support.


Related Posts

There Are 14 Comments

  • NPereira says:

    P.S.: I installed Free Fax for Asterisk, and let me tell you that the intergration was a snap ! But, may I offer 1 comment? Please add in the installition instruction that in order to setup the Detection in IVR, the inbound trunk configurations must be enabled for fax detection, and extension must also be setup to accept faxes.

    Thanks, Greate Product for home use !

  • Howdy,

    Negative. But, you could add:
    asterisk -rx “fax set t38cap on”
    to your startup scripts, run after Asterisk has loaded, to turn on the feature.


  • Is it possible to put “fax set t38cap on” in the asterisk configuration files so that it carries on doing captures after a reboot?

  • Thanks Malcolm, for the fast reply

  • Howdy,

    Any time.


  • mi says:

    This installation did not work at all for me. I followed the instructions, can see the modules settings/status, but not possible to receive faxes.

  • Howdy,

    If you’re a customer of the paid Fax For Asterisk product (not Free Fax For Asterisk), please contact our Support department via the methods here:


  • Serge says:

    Executing [[email protected]:4] Set(“IAX2/2124-2420”, “CHANNEL(buffers)=”12,half””) in new stack
    [Jul 31 19:41:31] WARNING[2996]: func_channel.c:339 func_channel_write: Unknown or unavailable item requested: ‘buffers’

  • Serge,

    Sounds like you’re using a version of Asterisk that doesn’t implement the buffer policy.


  • Alistair says:

    I’ve installed the latest version of this on Asterisk A fax session starts, then 15 or so seconds later fails with (cut down for brevity):
    FAXSTATUS=”FAILED FAXOPT: error: status: statusstr:
    FAX FAILED LICENSE EXCEEDED for: [email protected]

    I’ve ran registration multiple times – Asterisk is picking this license up OK so it’s definitely valid, and I know I’m not exceeding the licensed channels. I’m also getting the following completion line at the very end of the log output:

    FAX session ’10’ is complete, result: ‘FAILED’ (FAX_NO_FAX), error: ‘T1_TIMEOUT’, pages: 0, resolution: ‘unknown’, transfer rate: ‘2400’, remoteSID: ”

    I’d very much appreciate any guidance on this.

  • Howdy,

    We’ve identified a session leaking bug that can manifest itself when faxes fail. We’ll have this addressed in the 1.2.1 release, which is currently in beta. Send me an e-mail with your processor type and system (32 or 64-bit) to malcolmd at (the name of the company on whose blog we’re posting) dot com and I’ll provide

    Additionally, you might want to modify the t38pt_udptl parameter in sip.conf from its default to:


    as not all providers support the default, FEC.


  • kumar says:

    Hello sir.
    I downloaded and tried fax for asterisk. i spend huge time to run this utility and result is that
    fax is not coming properly. means some time comes single line or sometimes come little bit of full page.
    Please help to resolv.

  • Tommy Myo Min Aung says:

    Hello Sir,
    I am struggling to setup FoIP using T38 protocol.
    I configured Vritual FAX with the reference of Elastix without tears but not success yet.
    And i wouldn’t know how to start troubleshooting step by step. Could you please provide some suggestion such as-

    -Firewall port to be open for FoIP (TCP/UDP)
    -How to check our VSP support T38
    -How to collect logs?

    It would be very nice if i can have the proper documentation to setup FAX using SIP gateway.

    Many thanks.
    FAX For Asterisk Settings:
    ECM: Enabled
    Status Events: Off
    Minimum Bit Rate: 14400
    Maximum Bit Rate: 14400
    Modem Modulations Allowed: V17,V27,V29

    FAX Technology Modules:

    DIGIUM (Digium FAX Driver) Settings:
    Maximum T.38 Packet Delay: 800
    T.38 Session Packet Capture: Off
    G.711 Session Audio Capture: Off

    Fax Licensing Information
    Free fax licenses: 1
    Total licensed ports: 1

    Licenses Found:
    File: FFA-SPB3AC3BZDML.lic — Key: FFA-SPB3AC3BZDML — Product: RESFFA — Host-ID: 68:29:d4:47:c5:43:30:cc:c9:15:d4:fe:3d:16:55:36:d6:59:44:9d — Ports: 1 (OK)
    FAX For Asterisk Components:
    Digium FAX Driver: 1.8.4_1.3.1 (optimized for barcelona_64)


    with regards,

  • youjy says:

    asterisk 1.4 only support pass-through on fax?

Add to the Discussion

Your email address will not be published. Required fields are marked *

About the Author

Malcolm Davenport

Digium lifer, celebrator of 17 Digium birthdays, and Digium employee #4."I like telephony and I cannot lie. You other vendors can't deny; When a call comes in with MOS so you can't hear and some echo in your ear you get angry!" - Sir Mix-a-Malcolm

See All of Malcolm's Articles