cc_ResultValue( ) gets an error/cause code

202

.
if ( sr_enbhdlr(devhdl, CCEV_DISCONNECTED, discCallHdlr)<0)
{printf( dtiEnable for DISCONNECT failed: %s\n,
ATDV_ERRMSGP( SRL_DEVICE ) );
return( 1 );
}
.
.
.
.
while (1)
{/* wait for network event */
sr_waitevt(-1);
}
}
/***************************************************/
/* discCallHdlr - disconnect the active call */
/***************************************************/
int discCallHdlr( )
{int devindx;
int dev;
int len;
void *datap;
CRN crn;
int reason;
dev = sr_getevtdev();
len = sr_getevtlen();
datap = sr_getevtdatap();
cc_GetCRN (&crn, datap);
reason = cc_ResultValue(datap);
printf(Call disconnected reason = 0x%x\n,reason);
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_ASYNC)<0)
{int lasterr = cc_CauseValue(dev);
char *errmsg;
if ( cc_ResultMsg(dev, lasterr, &errmsg) == 0 )
printf( \tcc_DropCall() Error: ( %x ) %s\n,lasterr,errmsg);
}
return( 0 );
}
!
! !
!
Errors
If the function returns < 0 to indicate failure, use the cc_ResultMsg( ) function tointerpret the returned value. Error codes are defined in Section 7.2. ErrorHandling and in the files ccerr.h, isdnerr.h, and isdncmd.h. Typically, a < 0 return code for the cc_ResultValue( ) function indicates that thefunction reference (the event block pointer) is not valid for the function call.