
Description | Cautions | Example | Errors | See Also
Name: |
int cc_SndNonCallMsg(boarddev, crn_type, msg_type, sndmsgptr) | |
Inputs: |
LINEDEV boarddev |
|
int crn_type |
| |
int msg_type |
| |
NONCRN_BLK *sndmsgptr |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_SndNonCallMsg( ) function sends a non-call related ISDN message to the network over the D channel. The cc_SndNonCallMsg( ) function specifies the ISDN CRN type as either:
Unlike the cc_SndMsg( ) function, the cc_SndNonCallMsg( ) function does not require a call reference number (CRN) to transmit the outgoing message.
Parameter |
Description | |
boarddev: |
The board device handle. | |
crn_type: |
Specifies one of the following ISDN CRN types:
| |
msg_type: |
||
|
| |
The values for msg_type are defined in cclib.h. | ||
sndmsgptr: |
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. | |
Some IEs may require a Call Reference Value (CRV) to be part of the contents. The Call Reference, in this case, must be the Call Reference value assigned by the network, not the Call Reference Number (CRN) that is assigned by Dialogic and retrieved using the cc_GetCRN( ) function. It is up to the application to correctly format and order the IEs. Refer to the ISDN Recommendation Q.931 or the switch specification of the application's ISDN protocol for the relevant CCITT format. See the Example code for details.
/* This Example uses data specific to a 5ESS (non-Euro ISDN) switch */
#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;
char *devname = "briS1"; /* device name for BRI board 1 station 1 */
NONCRN_BLK ie_blk; /* IE block to transmit custom data */
.
.
.
/* open the ISDN board device */
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
/* Initialize the values to transmit. For this example, the ISDN INFORMATION message
will be transmitted with a Keypad IE.
*/
ie_blk->sapi = 0; /* Call Control SAPI */
ie_blk->ces = 1; /* Always one for User side */
ie_blk->length = 3; /* 3 bytes of data */
ie_blk->data[0] = 0x2c; /* IE ID = Keypad */
ie_blk->data[1] = 0x01; /* Length = 1 */
ie_blk->data[2] = 0x35; /* Keypad value = 0x35 (digit 5) */
/* send the specified NULL/Dummy CRN ISDN INFORMATION message */
if ( cc_SndNonCallMsg(devhdl, NULL_CRN, SndMsg_Information,(NONCRN_BLK *)&ie_blk) < 0 )
procdevfail(devhdl);
/* continue with call processing */
.
.
.
} /* end main */
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf("reason = %x - %s\n",reason,msg);
}
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_SndNonCallMsg( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_BADSTATE |
Bad state |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation