Справочник Пользователя для Dialogic 05-0867-005

Скачать
Страница из 476
cc_SndNonCallMsg( )
sends a non-call related ISDN message
266
{
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);
}
Errors
 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.hisdnerr.h, and isdncmd.h.
 Possible error codes from the cc_SndNonCallMsg( ) function include the
following: