The sndflag parameter of the fx_sendfax( ) function is a logical OR bit mask that can be set to indicate one or more conditions. For more information, see the following:
4.7.1. Mode of OperationTwo modes of operation are available for the send fax functions:
In synchronous mode, the function does not return control to the application until fx_sendfax( ) completes (zero returned) or an error has occurred (-1 returned); see Section 8.3. Error Handling on page 128.
In asynchronous mode, the function returns control to the application immediately after invocation. fx_sendfax( ) returns a zero to indicate successful invocation and a -1 to indicate an invocation error. Once control is returned to the application, the application may continue to send fax data on the specified device or issue voice/fax calls on other devices. The completion (or error termination) of fx_sendfax( ) is indicated to the application via events generated by the Dialogic Standard Runtime Library.
The following events are valid for fx_sendfax( ):
Event |
Indicates... |
Error in processing | |
Successful completion of fx_sendfax( ) |
See the Voice Software Reference - Standard Runtime Library for event information.
4.7.2. Enable Phase B Event GenerationTo enable Phase B event generation, specify DF_PHASEB in sndflag of the fx_sendfax( ) function.
When this bit is set, a TFX_PHASEB event is generated each time Phase B of the T.30 protocol is completed while fx_sendfax( ) is transmitting fax data.
If you issue fx_sendfax( ) in synchronous mode (EV_SYNC), you must install an event handler to handle Phase B events using the sr_enbhdlr( ) function of the Standard Runtime Library. For event handler details, see the Voice Software Reference - Standard Runtime Library.
When a TFX_PHASEB event occurs, you can call these fax extended attributes for the following information:
Fax Extended Attribute |
Returns... |
ATFX_BSTAT( ) |
|
ATFX_CODING( ) |
Negotiated line encoding scheme for the data transfer |
ATFX_SPEED( ) |
Baud rate of the data transfer |
ATFX_STATE( ) |
State of the fax channel device |
4.7.3. Enable Phase D Event GenerationTo enable Phase D event generation, specify DF_PHASED in sndflag of the fx_sendfax( ) function.
When this bit is set, a TFX_PHASED event is generated each time Phase D of the T.30 protocol is completed during the send fax operation. A Phase D event is generated for every page except for the last page. After the last page, if your application is running in synchronous mode fx_sendfax( ) completes or in asynchronous mode a TFX_FAXSEND event occurs.
Phase D events allow the application to monitor the progress of the fax transmission on a page-by-page basis.
If you issue fx_sendfax( ) in synchronous mode (EV_SYNC), you must install an event handler to handle Phase D events using the sr_enbhdlr( ) function of the Standard Runtime Library. See the Voice Software Reference - Standard Runtime Library for event handler details.
When a TFX_PHASED or TFX_FAXSEND event occurs, you can call these fax extended attributes for the following information:
Fax Extended Attribute |
Returns... |
ATFX_PHDCMD( ) |
|
ATFX_PHDRPY( ) |
Phase D reply |
ATFX_WIDTH( ) |
Width of the page |
ATFX_RESLN( ) |
Resolution of the page |
ATFX_SCANLINES( ) |
Total number of scan lines transferred |
ATFX_BADSCANLINES( ) |
Number of bad scan lines transferred per page |
ATFX_SPEED( ) |
Baud rate of the data transfer |
ATFX_STATE( ) |
State of the fax channel device |
ATFX_TRCOUNT( ) |
Number of bytes transferred |
4.7.4. Enable Operator Intervention (Voice Request)You can enable your application to send or receive an operator intervention (voice request) from a remote station.
DF_ACCEPT_VRQ in the sndflag argument enables the application to accept an operator intervention request from the remote station.
DF_ISSUE_VRQ in the sndflag argument enables the application to send an operator intervention request (DFS_PRI_EOP) to the remote station after the last fax page of the fx_sendfax( ) fax session is transmitted.
If fx_sendfax( ) completes successfully, the function returns a 0 in synchronous mode or a TFX_FAXSEND event occurs in asynchronous mode. The fax session is completed, but the connection between the two stations is still active for voice communication.
To determine the reason for termination of fx_sendfax( ), call ATFX_TERMMSK( ). This function returns a TM_FXTERM bitmap value indicating normal completion of the function or TM_VOICEREQ indicating completion due to a voice request issued or received.
4.7.5. Select Resolution for Fax TransmissionWhen the sndflag argument specifies a resolution (DF_TXRESLO or DF_TXRESHI), all fax data associated with the fx_sendfax( ) call is transmitted at this resolution regardless of any resolutions previously specified.
The DF_IOTT entries for the fax may contain an arbitrary combination of raw, TIFF/F and ASCII files at different resolutions, specified in the io_resln field for raw and ASCII files. By setting the DF_TXRESHI or DF_TXRESLO bit in sndflag, the entire chain of DF_IOTT entries is sent at the specified resolution.
For example, if the DF_IOTT array specifies a TIFF/F file at high resolution followed by a raw file at low resolution, after the transmission of the TIFF/F file, Phase B would be entered to negotiate the change in resolution for the raw file. By setting sndflag to DF_TXRESLO, the entire fax session takes place at low resolution. In this case, the high resolution data in the TIFF/F file is internally converted to low resolution at the time of transmission.
By default, the resolution in the TIFF/F file or in the DF_IOTT entry is used in the fax transmission. The sndflag argument overrides this resolution.
4.7.6. Enable Subaddress Fax RoutingAs described in Section 3.10. Subaddress Fax Routing on page 40, a subaddress is a T.30 message protocol that allows a fax to be routed to one or more telephone numbers (or extensions) after it is received by the fax machine or server.
The T.30 subaddress message is a 20-character string containing a combination of one or more phone numbers and/or extensions sent during Phase B negotiation.
To enable subaddress fax routing during fax transmission:
When subaddress fax routing is enabled, the fax library issues an MPS (DFC_MPS) message between each page of a multiple page TIFF/F file. The width and resolution of the fax transmission is set by the first TIFF/F page and remains the same for the entire fax transmission regardless of changes in width or resolution.
To return Phase B status after a TFX_PHASEB event, use the ATFX_BSTAT( ) extended attribute function. To return the setting of the fax channel for subaddress fax routing, use the FC_REMOTESUBADDR parameter in fx_getparm( ).
Sending Fax to a Single SubaddressTo send subaddress fax routing information with a fax transmission to a single subaddress, use the following procedure:
For the last entry in a table of DF_IOTT entries, set io_phdcont to DFC_EOP (End of Procedure) and io_type to IO_EOT.
DFC_AUTO automatically sets the FC_SENDCONT parameter value to DFC_MPS, allowing all pages of the multi-page fax to be transmitted to the specified subaddress in the least amount of time.
Sending Fax to Multiple SubaddressesTo send subaddress fax routing information with a fax transmission to multiple subaddresses, use the following procedure:
To route more than two DF_IOTT tables of fax data to different subaddresses, set io_phdcont for each entry in the table to DFC_EOM (End of Message) as in Step 1 above except for the final entry in the last DF_IOTT table. Set io_phdcont for the final entry to DFC_EOP and io_type to IO_EOT to end the fax session.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation