
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetLineDev(linedevp, evtdatap) | |
Inputs: |
LINEDEV *linedevp |
|
void *evtdatap |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_GetLineDev( ) function retrieves the line device handle for an event from the event queue.
Parameter |
Description |
linedevp: |
Pointer to the space containing the line device handle. |
evtdatap: |
Pointer to the structure containing the event data. The pointer value is acquired through the Dialogic SRL function sr_getevtdatap( ). |
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_waitcvt(-1);
}
}
/***************************************************/
/* discCallHdlr - disconnect the active call */
/***************************************************/
int discCallHdlr( )
{
int dev;
int len;
void *datap;
CRN crn;
len = sr_getevtlen();
datap = sr_getevtdatap();
cc_GetLineDev(&dev,datap);
cc_GetCRN (&crn, datap);
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 a value < 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.
Typically, a < 0 return code for the cc_GetLineDev( ) function indicates that the function reference (the CRN) is not valid for the function call.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation