0

We are trying to send fax using RFCOMAPILIb.dll using below code (we got sample from stack overflow itself)

RFCOMAPILib.FaxServerClass faxserver = new RFCOMAPILib.FaxServerClass();
faxserver.ServerName = "ServerName";
faxserver.Protocol = RFCOMAPILib.CommunicationProtocolType.cpNamedPipes;
faxserver.UseNTAuthentication = RFCOMAPILib.BoolType.True;
faxserver.OpenServer();

RFCOMAPILib.Fax fax = (RFCOMAPILib.Fax) faxserver.get_CreateObject(RFCOMAPILib.CreateObjectType.coFax);

// set up your 'fax' object the way you want it, below is just some sample options
fax.ToName = "dummy";
fax.ToFaxNumber = "dummy";
fax.ToVoiceNumber = "dummy";
fax.ToCompany = "dummy";
fax.FromName = "My Company";
fax.FromVoiceNumber = "dummy";

fax.Send();

string status=fax.faxstatus.tostring();

we are getting faxstatus as 110. User is not able to receive fax.

Any idea what can be the issue. Do we need to install any software specific to right fax on client machine. INterestingly from same machine we can send fax using UI provided after installing the Right Fax client hence we don't think so there is any issue with Port,firewall etc. Any help would be greatly appreciated.

1 Answers1

0

After you call,

fax.Send()

you should then do the following:

RFHandle = fax.Handle()

The RFHandle will then give you access to the CREATED FAX on the server itself (the fax object you originally created, does not get updated when you call fax.Send, except for you to retrieve the handle assigned by RightFax).

You can then periodically use this RFHandle to get a current version of the fax object from the RightFax server, which will include the fax's current status. For example, after sending the fax, wait a few seconds (RightFax needs a little time to generate the fax image) and call...

fax = faxserver.fax(RFHandle)

This will populate your fax object with the current values for this fax. You can then check its status via....

Status = fax.FaxStatus

(The various FaxStatus values are defined under, RFCOMAPILIB.FaxStatusType)

Your status will initiall be Incomplete, then NeedsFCS (Coversheet conversion), and there's scheduled to be sent, sending, and ultimately DoneOK and DoneFailure based on the actual sending. There is also a property,

fax.FaxErrorCode

which if you had FaxStatus = DoneFailure, the FaxErrorCode will give you more specific info as to why the fax failed to send.

One final thing to point out in your example, you did not set fax.OwnerId. This would indicate under what account the fax will be sent. From above, it will be sent through the account associated with your NT account. This may be what you wish, but the OwnerID property can allow you to use other accounts (permissions/rights will be required).

NOTE: If you wish to wait until the fax is sent (so as to know whether it was successful or not), you should include a delay between each call to, fax = faxserver.fax(RFHandle) You must make this call each time to get an update for the fax. If you are sending the fax (it's not set for hold for preview, and the account is not set for hold for approval), a sleep interval of 30 seconds to 1 minute is advisable (unless you are using FoIP, fax over IP). It takes time to send page(s) of fax over phone lines, roughly 1 minute per page is a general estimate, remember, there's not just your fax server but the receiving fax machine too. Your actual mileage may vary.

Lee McKenna
  • 61
  • 1
  • 2