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