gets the information elements associated with the CRN cc_GetCallInfo( )
91
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1T1";
char dnis_buf[CC_ADDRSIZE];
char infbuf[MAXLEN_IEDATA]; /* buffer raw information in CCITT format */
int i; /* for loop counter to print out information buffer contents */
/* open the ISDN line device */
if ( cc_Open( &devhdl, devname,0)<0)
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
printf("Waiting for call\n");
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC)<0)
procdevfail(devhdl);
printf("Getting call information\n");
if ( cc_GetCallInfo(crn, U_IES, &infbuf) <0)
callfail(crn);
else
/* print out the raw buffer information */
printf(“Received call information buffer contents:\n”)
for (i=1; i<=MAXLEN_IEDATA; i++) {
printf(“%c”, infbuf[I]);
} /* end for */
}
/* answer the call */
if ( cc_AnswerCall(crn, 0, EV_SYNC)<0)
callfail(crn);
.
.
.
.
.
/* drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC)<0)
callfail(crn);
/* release the CRN */
if ( cc_ReleaseCall(crn)<0)
callfail(crn);
/* close the ISDN line device */
if ( cc_Close( devhdl)<0)
printf("Error closing device, errno = %d\n", errno);
} /* end main */
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;