Move a fax between Captaris RigthFax servers using APIs

49 Views Asked by At

Is there a way to forward a fax from a RigthFax server to another RigthFax server using .NET?

2

There are 2 best solutions below

0
On BEST ANSWER

I found out there is no way to do this using the COM .NET API. This API only works inside one RightFax Server ...

0
On

If you wish to move a fax, what you will need to do is create a fax (with identical properties) on the second server, then delete the fax on the first server.

This is a manual process, step by step in code, but can be done.

You will need two separate faxserver objects (one for each server).

For faxserver1 (source of fax), create a fax object: fax1 which contains the fax (you can get this via the fax's handle). Also, you will need to get the Fax image downloaded as well (this will be a TIF file on your local drive).

For the targeted fax server (destination), you will need to create another fax object, fax2 (but you won't be searching faxserver2 for a fax).

Populate fax2 with all the property values from fax1 (e.g. ToName, ToFaxNumber, ToCompany, BillingInfo1, etc...). Also, set the property, hold for preview, to true. Don't forget to set the OwnerId accordingly! For simplicity, set HasCoversheet to FALSE (the actual coversheet will still be copied, just not recognized as a coversheet in FaxUtil). Add the TIF file (from the source fax, this will include the coversheet, if one was present and this was an outbound fax) to the AddDoc collection, then call Fax2.Send().

After the send call, call: RFHandle2 = Fax2.Handle()

This will have your new server create an outbound fax that should be identical to your original fax. [ Wait 30 seconds (inside a loop) and call

Fax2 = FaxServer2.Fax(RFHandle2)

Check Fax2.FaxStatus and see if it is HeldForPreview (you may also need to check error code as well, in the event there is any problem creating the fax).

Once it is set to HeldForPreview, you now can set the following (if applicable)

Fax2.IsRecievedEx = Fax1.IsRecieved (yes, you can change an outbound fax to an inbound fax!)

Fax2.FaxStatusEx = Fax1.FaxStatus

Fax2.FaxErrorCodeEx = Fax1.FaxErrorCode

Fax2.UniqueID = Fax1.UniqueID (you may or may not wish to do this - and this value actually DOES NOT HAVE TO BE UNIQUE on a server).

Fax2.Save(False) - the False value is so that the fax is not kicked!

If you don't get any exceptions, you can then delete the original fax

Fax1.Delete()

NOTE: The Fax History is NOT copied. You only have a copy of the fax record and its image.

There are tricks (assuming you have the necessary O/S permissions) that you could do to maintain the concept of a coversheet was used (if this was originally an outbound fax), but that's a bit much to explain here. We have software that automates this type of stuff in our workflow product.