
Developing a Fax Application
args_admin.config_file_name = "usrcnfig.cfg"; BfvLineReset(lp,&args_admin);
Resets the channel and sets the
BT_ZERO(args_infopkt); args_infopkt.fname = name; args_infopkt.fmode = "w";
ips = BfvInfopktOpen(&args_infopkt);
Opens the infopkt-formatted file called name for writing.
BT_ZERO(args_tel); args_tel.timeout = 0L; BfvLineWaitForCall (lp, &args_tel);
Waits without a timeout for an incoming call and performs call screening when the call occurs.
BfvLineAnswer (lp, &args_tel);
Takes the line
BT_ZERO(args_fax); args_fax.r_ips = ips; args_fax.local_id = local_id; BfvFaxReceive (lp, &args_fax);
Receives fax pages and puts them into the infopkt stream ips.
BT_ZERO(args_infopkt); args_infopkt.ips = ips; BfvInfopktClose (&args_infopkt);
Closes the infopkt stream file after the file is received.
BT_ZERO(args_admin);
BfvLineDetach (lp, &args_admin);
Frees all memory for the attached line and closes the device.
Sending a Fax Using
BT_ZERO(args_admin); args_admin.unit = unit;
lp = BfvLineAttach(&args_admin);
Attaches to a free channel and gets a line pointer.
November 2009 | 66 |