Dialogic 05-0867-005 Table Top Game User Manual


 
cc_SndMsg( ) sends a non-Call State related ISDN message to the network
262
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC)<0)
procdevfail(devhdl);
/* answer the call */
if ( cc_AnswerCall(crn, 0, EV_SYNC) < 0)
callfail(crn);
/*initialize the SndMsg Block to send */
InitSndMsgBlk(&ie_blk);
/* send INFORMATION IE data */
if ( cc_SndMsg(crn, SndMsg_Information, &ie_blk) ==-1>{<0)
callfail(crn);
}
/* drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC)<0)
callfail(crn);
/* release the CRN */
if ( cc_ReleaseCall(crn)<0)
callfail(crn);
/* close the line device */
if ( cc_Close(devhdl)<0)
printf(Error closing device, errno = %d\n, errno);
} /* end of main */
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf(reason = %x - %s\n,reason,msg);
}
void InitSndMsgBlk (IE_BLK * IE_BLK_PTR)
{
IE_BLK_PTR-> length = 10; /* 10 bytes of data */
IE_BLK_PTR-> data[0] = 0x28; /* DISPLAY IE (0x28) */
IE_BLK_PTR-> data[1] = 0x08; /* IE length: 8 bytes */
IE_BLK_PTR-> data[2] = 0x46;
IE_BLK_PTR-> data[3] = 0x52;
IE_BLK_PTR-> data[4] = 0x2E;
IE_BLK_PTR-> data[5] = 0x20;
IE_BLK_PTR-> data[6] = 0x30;
IE_BLK_PTR-> data[7] = 0x2E;
IE_BLK_PTR-> data[8] = 0x32;
IE_BLK_PTR-> data[9] = 0x30;
}