Press stop while fax receiving

I use spandsp and app_rxfax.c (with some changes) to receive faxes.
if press “stop” button on fax machine fax does not be received completly (tif file has STOPPED on page). Does anybody know how to get this information (about pressing STOP button) in app_rxfax. I need to make some special actions in this case.