gets the last channel information cc_GetChanId( )
99
cc_GetChanId(crn, &chanId);
if( cc_AcceptCall(callwaiting_crn, num_rings, EV_ASYNC)<0)
callfail(crn);
}
break;
case CCEV_RELEASE:
if(active_crn == crn)
active_crn = 0;
else if(waitingcall_crn == crn)
waitingcall_crn = 0;
break;
.
.
.
}
}
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.
Error codes from the cc_GetChanId( ) function include the following:
Error Code Description
ERR_ISDN_LIB | E_ISBADIF Bad interface number
ERR_ISDN_LIB | E_ISBADCALLID Bad call identifier
ERR_ISDN_LIB | E_ISBADTS Bad time slot