
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetCES(cesp, evtdatap) | |
Inputs: |
char *cesp |
|
void *evtdatap |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/SC | |
The cc_GetCES( ) function retrieves the connection endpoint suffix (CES) associated with the CCEV_D_CHAN_STATUS event received from the event queue. The connection endpoint suffix specifies the telephone equipment associated with the station. Eight IDs (1 - 8) are supported when used as a network-side terminal. When used as a station-side terminal, only one ID (1) is supported.
Parameter |
Description |
cesp: |
Pointer to the space containing the connection endpoint suffix. |
evtdatap: |
Pointer to the structure containing the event data. The pointer value is acquired through the Dialogic Standard Runtime Library (SRL) function sr_getevtdatap( ). |
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
long EventHandler(event)
{
int rc;
L2_BLK frame;
unsigned int resultValue;
unsigned char sapi, ces;
int device;
void *datap;
device = sr_getevtdev();
datap = sr_getevtdatap();
...
switch(event)
{
case CCEV_D_CHAN_STATUS:
cc_GetSapi(&sapi, datap);
cc_GetCes(&ces, datap);
resultValue = cc_ResultValue(datap);
switch(resultValue & ~(ERR_ISDN_FW))
{
case E_LINKUP:
DataLinkState[SAPI_ID][CES_ID] = DATA_LINK_UP;
break;
case E_LINKDOWN:
DataLinkState[SAPI_ID][CES_ID] = DATA_LINK_DOWN;
break;
case E_LINKDISABLED:
DataLinkState[SAPI_ID][CES_ID] = DATA_LINK_DISABLED;
break;
default:
printf("Got a bad result value (0x%X)\n", resultValue);
}
break;
case CCEV_L2FRAME:
if(rc = cc_GetFrame (dev, &frame) == 0)
{
sapi = frame.sapi;
ces = frame.ces;
printf("Got a frame of length=%d for Sapi=%d Ces=%d\n", frame.length, sapi, ces);
}
else
printf("cc_GetFrame failed!\n");
break;
...
}
return 0;
}
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_GetCES( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation