
Name: |
int grtProcessRecvDISEvent (GRT_EVENT *event, | |
Inputs: |
GRT_EVENT *event |
|
|
unsigned char *dis |
|
Outputs: |
unsigned char *dis |
|
Returns: |
GRT_SUCCESS |
|
|
GRT_UNKNOWN_EVENT |
|
Includes: |
genra.h |
|
The grtProcessRecvDISEvent( ) function processes a received DIS event.
This function is a high-level function that provides the data that is associated with a GRT_RECV_DIS event to the user. The data is an array of unsigned characters representing the received DIS. The function returns GRT_SUCCESS if the event is a GRT_RECV_DIS event and DIS_frame points to valid DIS data. If the event is not GRT_RECV_DIS, then the DIS_frame points to invalid data.
#include "genra.h" GRT_EVENT event; unsigned char dis[DIS_LENGTH] = "\0"; const int count = sizeof(dis)/sizeof(*(dis)); int status, i, chan = 1; /* block for any event */ while ((status = grtGetEvent(chan, chan, &event))
== GRT_NO_EVENT) Sleep(1000L); if (event.event_type == GRT_RECV_DIS) { if(status=grtProcessRecvDISEvent(&event, dis)) { fprintf(stderr, "[%2d] grtProcessRecvDISEvent failed:"
" %d\n", event.chan, status); return -1; } printf("[%2d] DIS received:", event.chan); for (i = 0; i < count; ++i) fprintf(stdout, "%02x ", dis[i]); fprintf(stdout, "\n"); }
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation