I’m not sure I can rely on FAXPAGES as it seems to be set to zero for most errors, e.g. I have a message logged where the last fax status event reports 4 pages transmitted but the FAXPAGES variable is set to zero after “remote channel hungup”.
Even if I can rely on FAXPAGES, I could use it for an outgoing fax, but for an incoming fax I don’t know how many pages I should have received, so the FAXPAGES variable can’t tell me whether I got a complete FAX or not.
According to Fax, Modem, and Text for IP Telephony “The disconnect, or DCN message, is the last message seen in a fax transaction and indicates the initiation of Phase E, call disconnect. A response or acknowledgment is not needed for this message. This message signifies a graceful disconnect to the fax call, and both sides prepare for a new fax transaction by returning to an on-hook state.”
My interpretation is that once a DCN is sent or received the call is over and any errors after that point should be ignored. I have a fax logged with a fax status event showing state FAX_FINISHED, DCN count: 1, after which variable FAXERROR is set to 3RD_FRM_CHECK_ERROR and FAXSTATUSSTRING is set to FAX_FAILURE_PARTIAL. I’m guessing that a hangup has caused the lower level protocol handling to report an error after the disconnect. Asterisk fax is reporting it as an error, but I think it should be ignored at that point as a hangup is expected?