Справочник Пользователя для Dialogic 05-0867-005

Скачать
Страница из 476
cc_SetParmEx( )
set parameters requiring variable data to be passed
252
{
LINEDEV
ldev = 0;
CRN
crn = 0;
char
*devname = “briS1T1”;
/* device name for BRI station 1 timeslot 1 */
PARM_INFO *parminfo;
/* variable data to be set */
char *DN = “99330008080”;
.
.
.
/* open the ISDN board device */
if ( cc_Open( &ldev, devname, 0 ) < 0 )
{
printf(“Error opening device: errno = %d\n”, errno);
exit(1);
}
/* initialize PARM_INFO structure */
parminfo.parmdatalen = strlen(DN);
strcpy (parminfo.parmdata, DN); /* directory number */
/* Specify the Directory Number */
if cc_SetParmEx(ldev, DIRECTORY_NUMBER, parminfo) < 0)
{
printf(“Error in cc_SetParmEx(): %d\n”, cc_CauseValue(ldev);
}
/* initialize D channel with cc_SetDChanCfg */
.
.
.
/* continue with call processing */
.
.
.
.
} /* end main */
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf(“reason = %x - %s\n”,reason,msg);
}
Errors
 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.