
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetNetCRV(crn, netcrvp) | |
Inputs: |
CRN crn |
|
int *netcrvp |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/SC; PRI (all protocols) | |
The cc_GetNetCRV( ) function retrieves the network call reference value (CRV) for a specified call reference number (CRN). The CRN is assigned during either the cc_MakeCall( ) function for outbound calls or the cc_WaitCall( ) function for incoming calls. If an invalid host CRN value is passed, for example, the CRN of an inactive call, cc_GetNetCRV( ) will return a value < 0 indicating failure.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
netcrvp: |
The pointer to the buffer where the network call reference value (CRV) will be stored. |
This function is not supported for the BRI/2 board.
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1T1";
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( sr_enbhdlr(devhdl, CCEV_OFFERED, (HDLR)OfferedHdlr) == < 0 )
{
printf ( 'sr_enbhdlr for OFFERED failed: %s\n', ATDV_ERRMSGP(devhdl));
return (1);
}
}
/*
* OfferedHdlr - Accept the incoming call
*/
OfferedHdlr()
{
LINEDEV dev;
int len;
void *datap;
CRN crn;
int netcrv;
dev = sr_getevtdev();
len = sr_getevtlen();
datap = sr_getevtdatap();
/* Obtain the call reference number */
if (cc_GetCRN(&crn, datap) != 0
{
printf ( 'cc_GetCRN: error\n" );
return < 0;
}
/* Use the CRN obtained above to get the Network CRV (Call Reference Value) */
if (cc_GetNetCRV(crn, &netcrv) == 0)
{
printf ( "cc_GetNetCRV(%X, %d) success\n" , crn, netcrv);
return 0;
}
else
{
printf ( "cc_GetNetCRV(%X) failure !!!\n", crn);
return -1;
}
}
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.
Error codes from the cc_GetNetCRV( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_BADCALLID |
An invalid CRN was entered for which no call exists |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
ERR_ISDN_LIB | E_BADDSL |
Bad DSL value |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation