cc_SetParm( ) sets the default channel parameters
248
/*
* using cc_ SetParm(devhdl, CALLED_NUM_TYPE,EN_NAT_NUMBER)
* to set the default value for “called party number type”to
*‘enbloc national’type
*/
if(cc_SetParm(devhdl, CALLED_NUM_TYPE, NAT_NUMBER) <0)
procdevfail(devhdl);
else
printf(“Parameter CALLED_NUM_TYPE has value: 0x%x\n”,value);
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC)<0)
procdevfail(devhdl);
if ( cc_AnswerCall(crn, 0, EV_SYNC)<0)
callfail(crn);
.
.
.
.
.
/* Drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC)<0)
callfail(crn);
if ( cc_ReleaseCall(crn)<0)
callfail(crn);
if ( cc_Close( devhdl)<0)
printf(“Error closing device, errno = %d\n”, errno);
}
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( ) functionto 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_SetParm( ) function include the following: