Dialogic 05-0867-005 Table Top Game User Manual


 
sends a response for CCEV_TERM_REGISTER cc_TermRegisterResponse( )
281
/***********************************************/
/* termRegisterHdlr - Term Register Handler */
/***********************************************/
int termRegisterHdlr( )
{
int devindx;
int dev = sr_getevtdev();
int len = sr_getevtlen();
void *datap = sr_getevtdatap();
char *message;
int dchstate;
int x, y;
TERM_BLK termBlk;
SPID_BLK *spidBlk;
/* Extract the event data associated with the CCEV_TERM_RSTER
* Event. Note that the data in the event data pointer is directlast
* to type SPID_BLK in order to extract the SPID number,PI,
* and CES values.
*/
spidBlk = (SPID_BLK *) datap;
printf("SPID: %s", spidBlk->SPID);
termBlk.data_link.sapi = spidBlk->data_link.sapi;
termBlk.data_link.ces = spidBlk->data_link.ces;
/* ......
* at this point, the application reads the SPID value and detnes
* whether or not the value of the SPID is valid for a designated sce.
* If the SPID is valid, then the application will send a PIVE
* acknowledgement (ISDN_OK). Otherwise a negative acknowledgement
* (ISDN_ERROR) is sent. This example shows POSITIVE acknowledgement.
*
*/
/* if sending a positive acknowledgement, the set ack_type = ISDN_OK */
termBlk.ack_type = ISDN_OK;
termBlk.ack_info.uspid.usid = 0xA;
termBlk.ack_info.uspid.tid = 0x0;
termBlk.ack_info.uspid.interpreter = 1;
/* send out the TERMINAL REGISTRATION acknowledgement */
if (cc_TermRegisterResponse(dtidev, &termBlk) != 0)
printf("Term Reg Ack Error\n");
else printf("TermRegisterResponse successful\n");
!
! !
!
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.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_TermRegisterResponse( ) function include the
following: