
Description | Cautions | Example | Errors | See Also
Name: |
int cc_ResultValue(evtdatap) | |
Inputs: |
void *evtdatap |
|
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_ResultValue( ) function gets an error/cause code of an event. The code identifies the return value of a function or the cause of an event. Result values are located in isdnerr.h and isdncmd.h. Use cc_ResultMsg( ) to return the text definition for the code.
Parameter |
Description |
evtdatap: |
Points to the event data block. This pointer may be acquired via sr_getevtdatap( ), an element of the Dialogic Standard Runtime Library (SRL). |
None
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
main()
{
.
.
.
.
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 );
}
If the function returns < 0 to indicate failure, use the cc_ResultMsg( ) function to interpret the returned value. Error codes are defined in Section 7.2. Error Handling and in the files ccerr.h, isdnerr.h, and isdncmd.h.
Typically, a < 0 return code for the cc_ResultValue( ) function indicates that the function reference (the event block pointer) is not valid for the function call.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation