
Name: |
int gfqInsertPlist (GFQCHAR *gfqFileName, GFQRECORD *qrec, int list, GFQCHAR *phonelist); | |
Inputs: |
GFQCHAR *gfqFileName |
|
|
GFQRECORD *qrec |
|
|
int list |
|
|
GFQCHAR *phonelist |
|
Outputs: |
None |
|
Returns: |
GFQSUCCESS |
|
|
GFQFILE_BUSY |
|
|
GFQFILE_CREATE_ERROR |
|
|
GFQFILE_INCOMPATIBLE |
|
|
GFQFILE_NOTFOUND |
|
|
GFQFILE_OPEN_ERROR |
|
|
RECORD_WRITE_ERROR |
|
|
GFQPHONE_FILE_ERROR |
|
Includes: |
gfq.h |
|
The gfqInsertPlist( ) function inserts one record into a list for every phone number in the phone list. It writes a queue record for each entry in the phone list into the specified list of the Queue File. The phone-list file is automatically opened, processed, and closed.
The structure of a record inside a phone list is shown below, and followed by the maximum length of each field:
Table 29. gfqInsertPlist Phone Number Record Structure
Field |
Maximum Length |
phone_number |
20 |
rate |
4 |
cd_timeout |
4 |
last_name |
20 |
first_name |
12 |
company |
20 |
category |
10 |
class |
10 |
voice |
20 |
Each field must be delimited by a space. Each line in the file is a record and must be separated by a control line feed (CR LF).
The minimum requirement for a valid phone-list record is the phone_no field. If the rate and cd_timeout are missing, the values from the queue record are taken. If the rate specified in the queue record is different from the phone-list record, the lower of the two values is used. If the phone list is not specified
(NULL or ""), gfqInsertPlist( ) calls gfqInsertOne( ).
Table 30 lists the names used with gfqInsertPlist( ).
The user is responsible for verifying the following:
Table 30. List Names Used with gfqInsertPlist( )
Mnemonic |
Meaning |
Pending List | |
GFQRECV_LIST |
Received List |
GFQSENT_LIST |
Sent List |
GFQCONV_LIST |
Conversion List |
GFQCTRL_LIST |
Control List |
GFQCPST_LIST |
Control Done List |
#include "gfq.h" #include "gfqpath.h" GFQRECORD qrec; char queuefile[128] = "\0"; char phonelist[128] =
"c:\\broadcst\\phonelst.txt"; int status; /* get fully qualified path to queue file */ if (gfqGetPath(GFQDIR_QUEUE, "gfax.$qu", queuefile) != GFQSUCCESS) { fprintf(stderr, "GFAX environment variable not defined\n"); exit(1); } /* initialize and fill in queue record */ ... status = gfqInsertPlist(queuefile, &qrec, GFQPEND_LIST, phonelist); if (status != GFQSUCCESS) { printf("gfqInsertPlist failed, %d\n", status); myErrorRoutine(status); } else printf("Fax broadcast successfully submitted to Pending List\n");
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation