
Name: |
int grtRespond (GRT_EVENT *event, | |
Inputs: |
GRT_EVENT *event |
|
|
GRT_RESPONSE *response |
|
Outputs: |
None |
|
Returns: |
GRT_SUCCESS |
|
|
GRT_ANOTHER_THREAD |
|
|
GRT_INVALID_RESPONSE |
|
|
GRT_RESPONSE_FAIL |
|
|
GRT_INVALID_CHAN |
|
GRT_CONTROL_BUSY |
| |
GRT_UNLOCK_FAIL |
| |
GRT_LOCK_FAILED |
| |
GRT_NOT_INIT |
| |
GFD_BROKEN_PIPE |
| |
GFD_INVALID_HANDLE |
| |
Includes: |
genra.h |
|
The grtRespond( ) function responds to an event.
This function responds to the given event. The response structure must have the response_type (GRT_CONTINUE, GRT_END_CALL, etc.) initialized before this function is called.
#include "genra.h"
GRT_EVENT event;
GRT_RESPONSE response;
int status, chan = 1;
int grtAttributes = GRT_CALL_TERM_ENABLE |
GRT_CALL_TERM_RESPONSE_ENABLE;
/* initialize GRT pipes interface for fax channel 1 */
status = grtInit(chan, chan, grtAttributes);
if (status != GRT_SUCCESS)
{
fprintf(stderr, "[%2d] grtInit failed, %d\n", chan, status);
return -1;
}
/* submit queue record */
...
/* block for any event */
while ((status = grtGetEvent(chan, chan, &event))
== GRT_NO_EVENT)
Sleep(1000L);
if (event.event_type == GRT_CALL_TERM)
{
/* fill in response structure */
response.response_type = GRT_END_CALL;
/* respond to event (do not post queue record to file) */
if (status = grtRespond(&event, &response))
{
printf("[%2d] grtRespond error %d\n", event.chan, status);
return -1;
}
}
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation