
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetNonCallMsg(devhndl, msgblkptr) | |
Inputs: |
LINEDEV devHndl |
|
NONCRN_BLK *msgblkptr |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_GetNonCallMsg( ) function retrieves call data for a GLOBAL or NULL CRN event, at the time the event occurs. The cc_GetNonCallMsg( ) function must be used immediately after the event is received if the application needs the call information. The library will not queue the call information; subsequent messages on the same board device will overwrite this information if it is not retrieved immediately.
NULL events correspond to messages received with a dummy, or NULL, call reference value (CRV). These messages are of significance to all calls or channels on a particular trunk, that is, they do not correspond to a particular call. Therefore, the messages are delivered on the board level device (for example, briS1). The cc_GetNonCallMsg( ) function can be used to retrieve information for the following NULL events:
GLOBAL events correspond to messages received with a Zero call reference value. These messages are of significance to all calls or channels on a particular trunk, that is, they do not correspond to a particular call. Therefore, the messages are delivered on the board level device (for example, briS1). The cc_GetNonCallMsg( ) function can be used to retrieve the information for the following GLOBAL events:
Parameter |
Description |
devhndl: |
The board device on which the GLOBAL or NULL event occurred. |
msgblkptr: |
Pointer to the NONCRN_BLK data structure that contains the information related to the GLOBAL or NULL CRN event. For a description of the data structure, see Section 6.9. NONCRN_BLK. See the Example code below for details. |
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
int callinfoNullHdlr( )
{
int devhndl;
int i;
NONCRN_BLK nullDataBlk;
unsigned char tmpbuf[5], sbuf[256], *sptr;
devhdnl = sr_getevtdev();
if(cc_GetNonCallMsg(devhndl, &nullDataBlk) == 0)
{
int i;
printf("Sapi = 0x%x.\n",nullDataBlk.sapi);
printf("CES = 0x%x.\n",nullDataBlk.ces);
printf("Raw IE data length = %d.\n",nullDataBlk.length);
printf("IE data =:\n");
for(i = 0; i < nullDataBlk.Iength; i++)
{
printf("0x%02x ", (unsigned char)nullDataBIk.data[i]);
}
}
else
tx_message("GetNonCallMsg failure" ,brd,devindx+1);
return( 0 );
}
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char devname = "briS1"; /* Device name for BRI station one */
char dnis_buf[CC_ADDRSIZE];
char infbuf[MAXLEN_IEDATA]; /* buffer raw information in CCITT format */
iIt i; /* for loop counter to print out information buffer contents */
/* open the ISDN line device */
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( sr_enbhdlr( devhdl, CCEV_INFONULL, (HDLR)callinfoNullHdlr ) == -1 )
{
printw( "dtiEnable for CCEV_CALLINFO failed: %s\n",
ATDV_ERRMSGP( SRL_DEVICE ) );
return( 1 );
}
.
.
.
.
.
/* close the ISDN line device */
if ( cc_Close( devhdl ) < 0 )
printf("Error closing device, errno = %d\n", errno);
} /* end main */
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.
Possible error codes from the cc_GetNonCallMsg( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADCRN |
Bad call reference number |
ERR_ISDN_LIB | E_BADPAR |
Bad input parameter |
ERR_ISDN_ISNOINFOBUF |
Information buffer not ready |
ERR_ISDN_LIB | ISNOFACILITYBUF |
Network facility buffer not ready |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation