
Name: |
int grtSubmitFax (int chan, GFQRECORD *qrec) | |
Inputs: |
int chan |
|
|
GFQRECORD *qrec |
|
Outputs |
none |
|
Returns: |
GRT_SUCCESS |
|
|
GRT_FAX_SUBMIT_FAIL |
|
Includes: |
genra.h |
|
The grtSubmitFax( ) function submits a queue record to a channel. This function sends a queue record to a given channel without using the queue file, to the dispatcher using the control pipe. If the submission is successful, GRT_SUCCESS is returned; otherwise, GRT_FAX_SUBMIT_FAIL is returned.
#include "gfq.h"
#include "genra.h"
GFQRECORD qr;
int status, chan = 1;
int application_type = RECV_FAX_ONLY;
gfqClearRec(&qr);
switch (application_type)
{
case SEND_CALL_PROGRESS:
/* fax channel does dialing and handles call progress */
qr.operation = GFQDIAL_SEND;
strcpy(qr.fn_send, "c:\\fax\\test001.tif");
strcpy(qr.phone_no, "1-408-555-1212");
break;
case SEND_NO_CALL_PROGRESS:
/* fax channel goes off-hook and begins T.30 action at
Phase B */
qr.operation = GFQDIAL_SEND;
strcpy(qr.fn_send, "c:\\fax\\test001.tif");
strcpy(qr.phone_no, "\0");
break;
case RECV_FAX_ONLY:
/* fax channel detects incoming ring prior to going
off-hook */
qr.operation = GFQANSWER_RECEIVE;
strcpy(qr.fn_received, "c:\\faxr\\f001p001.tif");
break;
case RECV_VOICE_FAX:
/* fax channel goes off-hook and transmits CED */
qr.operation = GFQANSWER_IMMEDIATELY;
strcpy(qr.fn_received, "c:\\faxr\\f001p001.tif");
break;
}
status = grtSubmitFax(chan, &qr);
if (status == GRT_SUCCESS)
printf("fax submitted successfully\n");
else
printf("grtSubmitFax error %d\n", status);
GFD API FunctionsThe following section alphabetically lists the GFD API functions. These function calls handle event notification, remote status and control functions.
Figure 5. Event Breakpoints

Each event breakpoint may be associated to the sending side or the receiving side of a fax transmission. In the information associated with the event there may be data. The application attempts to read the gfx_rt_message, which is the largest possible message from the pipe (2048 bytes of data). There will be more or less data depending on the event. Events that are not able to respond should not be setup for response. Doing so can cause unpredictable behavior. Of the available responses, the verb response is not supported in GRT. Aborting at the Call Term break point does not abort the fax transmission at all; rather it aborts writing the queue record in the event data to the queue file on the hard disk.
Table 34. Event Breakpoints
Event |
Sending/Receiving |
Information with event |
Able to Respond? |
Available responses |
Dial |
Sending |
Dial string |
No |
None |
Call Pending |
Receiving |
Collected digits |
Yes |
Abort, continue, or verb |
Answer |
Receiving |
Collected digits |
Yes |
Abort, continue, queue record or verb |
Info Exchange |
Receiving |
gfx_rt_info_s or GRT_INFO_DATA |
Yes |
Abort or continue |
DIS Received |
Sending |
gfx_rt_info_s or DIS string |
No |
None |
DCS Received |
Receiving |
gfx_rt_info_s or DCS string |
No |
None |
Page Break |
Sending /Receiving |
None |
No |
None |
|
Idle |
Sending /Receiving |
None |
No |
None |
|
Call Term |
Sending /Receiving |
GFQRECORD |
Yes |
Abort or continue |
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation