Dialogic 05-0867-005 Table Top Game User Manual


 
sets additional information elements cc_SetInfoElem( )
239
!
! !
!
Example
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include srllib.h
#include dtilib.h
#include cclib.h
typedef struct uui_type {
unsigned char uui_id;
unsigned char length;
char data[128];
} USR_USR_INFO; /* This structure complies with CCITT Q.931
USER-USER information element standard */
int build_struui(USR_USR_INFO *uuip,char *str)
{
uuip->uui_id = 0x7E; /* CCITT UUI */
strcpy(uuip->data, str);
uuip->length = strlen(uuip->data);
return(uuip->length+2);
}
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = dtiB1T1;
IE_BLK icp;
USR_USR_INFO uui;
if ( cc_Open( &devhdl, devname,0)<0)
{
printf(Error opening device: errno = %d\n, errno);
exit(1);
}
/*
* Using cc_SetInfoElem()to include additional
* information elements in the next ISDN message.
*/
icp.length = build_struui(&uui, Dialogic ISDN);
memcpy(icp.info_elem_str, &uui, icp.length);
if ( cc_SetInfoElem(devhdl, &icp))
procdevfail(devhdl);
if ( cc_MakeCall(devhdl, &crn, 9933000, NULL, 30, EV_SYNC)<0)
procdevfail(devhdl);
.
.
.
.
.
/* Drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC)<0)
callfail(crn);
if ( cc_ReleaseCall(crn)<0)
callfail(crn);
if ( cc_Close( devhdl)<0)
printf(Error closing device, errno = %d\n, errno);