Over the years, CopiaFacts has acquired nine variables which count fax pages for various purposes.  The following list summarizes the exact purpose and content of each variable.

TPAGESFor outbound calls, contains the total number of pages (including cover sheet) counted as the fax is prepared.
For one-call fax-on-demand, contains the number of requested pages (including one-call cover, if specified)
Use this variable on a cover sheet as for example: @COUNT_1... of @TPAGES
Note that if the transmission includes ASCII pages rendered on the board, only one page is counted for each such file, even if several pages result.
APAGESFor outbound retried calls, contains the number of pages already sent in the previous incomplete attempt.
SPAGESFor outbound calls, contains the number of pages scheduled to be sent in the current attempt.
PAGESFor fax-on-demand requests, contains the number of pages already requested.
OC_APAGESAt the end of an attempt, contains the aggregate number pages already sent in all attempts.
OC_SCHEDPAGESAt the end of an outbound attempt, contains the number of pages scheduled for the attempt.  If the value assigned to OC_INDEX is non-zero, the variable instead contains the number of pages scheduled for the designated attempt number.
OC_SENTPAGESAt the end of an outbound attempt, contains the number of pages sent in the attempt.  If the value assigned to OC_INDEX is non-zero, the variable instead contains the number of pages sent in the designated attempt number.
FS_INPAGESIn a pre-process, contains the number of pages in the $fax_filename file designated by the index number assigned to FS_INDEX.
PR_FAXPAGESIn a post-receive process or RESULT variable, contains the number of pages received in the incoming fax.
ONECALL_FAXPAGESIn a post-process or RESULT variable for one-call fax-on-demand, contains the number of pages sent.

Fax Header Lines

Use TPAGES for the total pages,  APAGES and SPAGES if you create a $retry_cover sheet for retries.

RESULT_...  and NQ... Variables

Use OC_SENTPAGES for FAXOUT,  PR_FAXPAGES for FAXIN,  ONECALL_FAXPAGES for One-call fax on demand.