
Name: |
int grtInit (int start_chan, int end_chan, int attributes) | |
Inputs: |
int start_chan |
|
|
int end_chan |
|
|
int attribute |
|
Outputs: |
None |
|
Returns: |
GRT_SUCCESS |
|
|
GRT_INVALID_START_CHANNEL |
|
|
GRT_INVALID_END_CHANNEL |
|
|
GRT_NO_DISPATCHER |
|
|
GRT_ALREADY_CONTROLLED |
|
GRT_CONTROL_BUSY |
| |
GRT_UNLOCK_FAIL |
| |
GRT_LOCK_FAILED |
| |
GRT_PROCESS_ATTRIBUTE_FAIL |
| |
GRT_OPEN_FAIL |
| |
Includes: |
genra.h | |
The grtInit( ) function initializes the GRT interface. To initialize internal data structure with the proper value to control the given range of channels.
This function can be called multiple times in a thread as long as different ranges of channels are used.
These are the attributes that are currently supported.
Behavior
grtInit( ) has been enhanced to prevent automatic posting of the completed queue record to the queue file. This action is usually not necessary as most applications also receive a copy of the same queue record when the GRT_CALL_TERM_ENABLE attribute is specified in grtInit( ).
However, you can restore the ability of the GDK to automatically post the completed queue record to the queue file with the following gfdRemoteRequest( ) command as demonstrated in the code fragment:
#include <genra.h>
...
int grtAttributes = GRT_CALL_TERM_ENABLE;
int chan = 1, status, rresult;
...
status = grtInit( chan, chan, grtAttributes );
if ( GRT_SUCCESS == status )
{
// allow posting of results to queue file
status = gfdRemoteRequest(
1,
chan,
GFXRTACTION,
GFXRTBP_CALLTERM,
GFXRT_CONTINUE,
NULL,
0,
&rresult
);
if ( 0 == status ) {
printf( "Success: Posting enabled!\n" );
}
}
...
The gfdRemoteRequest command must be issued on a per-channel basis.
#include "genra.h" int status, chan = 1; /* initialize GRT pipes interface for fax
channel 1 */ status = grtInit(chan,chan,GRT_CALL_TERM_ENABLE); if (status != GRT_SUCCESS) { fprintf(stderr, "[%2d] grtInit failed\n", chan); myErrorRoutine(status); }
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation