Skip to content
Phone Guides

Asterisk fax and T.38 paths

Start with the complete fax path: document or fax machine, Asterisk, any gateway, carrier and remote destination. Asterisk supporting a fax application does not establish that every device and carrier in that path supports the same mode.

Source-reviewed, 19 October 2026. Prepared from the cited documentation. No fax path has been independently tested by Phone Guides. Scope: Asterisk 22 application behaviour and design checks; exact gateway/carrier compatibility is unverified.

Identify what Asterisk is doing

Path What to establish
Asterisk receives a document Destination route, fax resource and protected output file
Asterisk sends a document Accepted input format, destination and result handling
External fax endpoints exchange media Negotiated mode and every intermediate device/service
Gateway conversion Exact gateway capability, firmware and mode on both legs

The branch-22 SendFAX reference and ReceiveFAX reference describe the applications supplied through res_fax and a fax technology resource. Check the modules actually supplied by your build before writing a route around them.

Read a controlled receive route

This original example assigns a single internal destination to document reception. It assumes an installed fax technology resource, an authorised sending fax endpoint and a protected writable destination directory. It is not a gateway or carrier configuration.


[pg-fax-demo]
exten => 6096,1,Answer()
 same => n,ReceiveFAX(/var/spool/asterisk/fax/pg-${UNIQUEID}.tif)
 same => n,NoOp(Fax result=${FAXSTATUS}; pages=${FAXPAGES}; mode=${FAXMODE})
 same => n,Hangup()

Check for a number/context collision and use the supported configuration owner before making this route reachable. Replace the illustrative directory with your actual restricted document destination. Confirm permissions and resource modules before accepting a live document; an existing directory name is not proof that the Asterisk service can write there.

Use non-sensitive test material on equipment you control. The source channel identifier supplies the filename component, avoiding raw caller text. The example logs summary result fields without document contents, but the file and surrounding call metadata still require private access and retention.

When the application returns through the normal path, inspect the documented result variables and open the received file through a controlled workflow. Caller hangup can prevent later priorities from running, so durable result handling must account for termination as well. Do not repeatedly resubmit a document solely because the summary line is missing.

The example chooses no forced fax mode or audio-fallback option. Negotiate only modes supported by the actual endpoints and service. A successful receive result on this internal path would not establish outbound fax, carrier transport or a different gateway firmware combination.

Choose negotiation and fallback deliberately

Use the PJSIP reference for the installed branch's T.38 options. Check the provider's exact supported service, packet/network requirements and fallback policy. Enabling an endpoint option alone is not an end-to-end compatibility result.

ReceiveFAX documents distinct options for allowing audio fallback and forcing audio mode. Choose deliberately from the version-specific reference. Do not describe either choice as a universal repair for failed T.38 negotiation.

If using an audio path, document its codec and network conditions. A normal voice conversation can tolerate impairments that a fax transmission cannot. Avoid claiming reliability from a single answered call or a short tone exchange.

Protect documents and filenames

Generate file paths from controlled application identifiers, not raw caller input. Keep inbound documents and outgoing originals outside public web directories, with restricted service permissions, retention and delivery rules. ReceiveFAX saves a TIFF/F document; arrange any later conversion through a defined, supported processing step.

Distinguish completion of the fax operation from completion of later email, storage or business workflow. A delivery failure should not silently cause unlimited repeat fax calls.

Record the result

After the application returns, inspect its documented result variables. The reference includes FAXSTATUS, FAXERROR, FAXPAGES and FAXMODE; keep their values with the operation identifier and time. Do not equate SIP answer or a created output file with a successful complete document.

Reader checks

On the exact service path, send and receive short and multi-page documents, inspect the resulting pages, and check a busy/unavailable destination and interrupted transmission. Record negotiated mode, page count, result and gateway/carrier versions. Recheck after a material firmware, provider or route change.

For analogue equipment, read gateways and DAHDI. Return to Asterisk documentation.