
Description | Caution | Example | Errors | See Also
Name: |
int cc_GetInfoElem(linedev, iep) | |
Reference: |
LINEDEV linedev |
|
Inputs: |
IE_BLK *iep |
|
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
BRI/SC; PRI (all protocols) | |
The cc_GetInfoElem( ) function gets information elements associated with a line device for an incoming message. The cc_GetInfoElem( ) function must be used immediately after the message is received if the application requires the call information. The library will not queue the call information; subsequent messages on the same line device will be discarded if the previous messages are not retrieved.
Parameter |
Description |
linedev: |
The B channel board line device handle. |
iep: |
The starting address of the information element block. The information elements are contained in the IE_BLK data structure. See Section 6.6. IE_BLK for a description of the data structure. See the example code for details. |
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <cclib.h>
long evt_handl;
void main(...)
{
char dev_name[20];
LINEDEV devhdl[MAXDEVS];
CRN crn[MAXDEVS];
int ch;
sprintf(dev_name, "dtiB1");
if(cc_Open(devhdl[0], dev_name, 0) != 0)
{
printf("cc_Open(%s) failed\n", dev_name);
exit(0);
}
for(ch = 1; ch < MAXDEVS; ch++)
{sprintf(dev_name, "dtiB1T%d", ch);
if(cc_Open(devhdl[ch], dev_name, 0) != 0)
{
printf("cc_Open(%s) failed\n", dev_name);
exit(0);
}
if(cc_WaitCall(devhdl[ch], &crn[ch], NULL, -1, EV_ASYNC) == -1)
{
printf("cc_WaitCall(%s) failed\n", dev_name);
exit(0);
}
}
while(FOREVER)
{
sr_waitevtEx(devhdl, MAXDEVS, -1, &evt_handl);
process_event(evt_handl);
}
}
int process_event(evthandl)
unsigned long evthandl;
{
LINEDEV event_dev = sr_getevtdev(evthandl);
switch (sr_getevttype(evthandl))
{
case CCEV_NOTIFY:
{
IE_BLK ie;
int i;
printf("%s: CCEV_NOTIFY cc_GetInfoElem =%d\n",
ATDV_NAMEP(event_dev), cc_GetInfoElem(event_dev, &ie) );
printf("IE %d)= ", ie.length);
for(i = 0; i < ie.length; i++)
printf("%02X, ", (unsigned char)ie.data[i]);
printf("\n");
.
.
}
break;
.
.
.
}
}
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_GetInfoElem( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADCRN |
Bad call reference number |
ERR_ISDN_LIB | E_ISBADPAR |
Bad input parameter |
ERR_ISDN_LIB | E_ISNOINFOBUF |
Information buffer not ready |
ERR_ISDN_LIB | E_ISNOFACILITYBUF |
Network Facility buffer not ready |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation