how to get fax status from RightFax using RFCOMAPILIB c#?

1.4k views Asked by At

i'm trying to wrap a service around the type-lib RFCOMAPILIB to expose tow services the first is to allow sending a fax and the other is to query the RightFax server for the status of the sent Fax by its Unique ID, the sending part went well, as for the status retrieval i got lost, any help will be appreciated.

1

There are 1 answers

0
Lee McKenna On

After you send the fax, you will have the fax handle populated in your fax object AFTER you call the method, Send.

fax.Send() RFHandle = fax.Handle

You should then periodically poll (update) your fax object to get the current fax status. You cannot use your current fax object, fax, but instead must repeatedly request it from the fax server (until you see the desired status, ok, failure, held for preview, etc, or some error)

fax = FaxServer.Fax(RFHandle)

you can now check fax.FaxStatus. I would suggest you sleep initially (2 to 5 seconds) after you initially send the fax (it will take a few seconds for RightFax to create the fax image and coversheet). Get the fax object via its handle, see if it's in a "final state" (e.g. Held For Preview, Approval, DoneOK, DoneFailure, etc) and if not, go to sleep and try again. How long you sleep, number of time you may loop back, etc, all depends on what it is you are trying to accomplish by checking on the fax status.

In most apps, you don't bother with the fax status immediately after the Send. Therefore, save the RFHandle somewhere (database table), which can then be checked by another application/service for the fax's current/final status.