Developing a Fax Application

args_admin.config_file_name = "usrcnfig.cfg"; BfvLineReset(lp,&args_admin);

Resets the channel and sets the user-configured options selected in the user-defined configuration file named usrcnfig.cfg.

BT_ZERO(args_infopkt); args_infopkt.fname = name; args_infopkt.fmode = "r";

ips = BfvInfopktOpen(&args_infopkt);

Opens the infopkt-formatted file called name for reading and transmission.

BT_ZERO(args_tel);

args_tel.phonenum = "w7814499009"; BfvLineDialString(lp,&args_tel);

Dials a telephone number.

args_tel.call_protocol_code = CALL_PROTOCOL_FAX; args_tel.call_mode = BT_ORIGINATE; BfvLineCallProgressEnable(lp,&args_tel);

Enables the call progress function.

BT_ZERO(args_tel);

BfvDataCP(lp,&args_tel);

Gets the next two bytes from the call progress FIFO (used to determine when to disable call progress) for processing.

BfvLineCallProgressDisable(lp,&args_tel);

Disables call progress detection.

BT_ZERO(args_fax);

args_fax.local_id = "Id_string"; BfvFaxSetLocalID(lp,&args_fax);

Sets the local id.

BT_ZERO(args_fax); args_fax.s_ips = ips; BfvFaxBeginSend(lp, &args_fax);

Begins the handshaking procedure between the two machines.

BfvFaxGetRemoteInfo(lp, &args_fax);

Waits for the called machine to send its ID and capabilities.

BfvFaxWaitForTraining(lp, &args_fax);

Waits for the completion of the Phase B handshaking procedure.

November 2009

67

Page 67
Image 67
Dialogic 6.2 manual Enables the call progress function