Dialogic 6.2 Manuale Utente

Pagina di 441
Developing a Fax Application
November 2009
78
Receiving and Storing a Fax in MMR or 
MR Format
Receiving an Infopkt-Formatted Fax and Storing it in MMR Format  
A typical way to receive a fax that is made up of infopkts and store it 
in MMR format is demonstrated below. Each function is presented in 
sequential order, and the action it performs is described beneath it.
When MR or MMR facsimiles are received in infopkt format, the 
data format type specification is automatically included through the 
g3strppkt
 infopkt structure. Retransmission of these infopkt files 
is done the same way transmission of MH files is done (see Sending a 
instructions).
The application controls the format of images received from the 
channel; this format is independent of the format of data received by 
the channel.
BT_ZERO(args_admin);
 
args_admin.unit = unit;
 
lp = BfvLineAttach(&args_admin);
Attaches to a free channel and gets a line pointer.
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 = "w";
 
ips = BfvInfopktOpen(&args_infopkt);
Opens the infopkt-formatted file called name to store the received 
fax.
BT_ZERO(args_tel);
 
args_tel.timeout = 0L;
 
BfvLineWaitForCall (lp, &args_tel);
Waits without a timeout for an incoming call.
BfvLineAnswer (lp, &args_tel);
Takes the line off-hook and sets the line state to CONNECTED.