The Dialogic ISDN API library is an extension of the DTI library. Therefore, events, errors, and alarms are handled by the application in the same way as Dialogic DTI applications. Refer to the Digital Network Interface Software Reference and the Voice Software Reference - Standard Runtime Library for the appropriate operating system for more information.
Each Dialogic ISDN API library function returns a value < 0 on failure. Be sure to check any call to a Dialogic ISDN API library function for a return value that indicates an error. The following code samples demonstrate how to handle errors done in asynchronous and synchronous modes.
Asynchronous Modesr_waitevt(-1);
code = sr_getevttype( );
if (code&DT_CC) == DT_CC) { /* comments */
switch(code) {
case CCEV_DISCONNECTED:
cc_ResultValue( );
break;
}
}
Synchronous Modechar *msg;
if (cc_XXX(ldev) == CC_ERROR) {
error = cc_CauseValue(ldev);
error = cc_ResultMsg(ldev, &msg);
printf("error msg = %s\n", msg);
}
8.2.2. Handling EventsWhen an event occurs, the application may use sr_getevttype( ) to retrieve the event type. For example:
switch (sr_getevttype()) {
case CCEV_OFFERED:
.
.
.
case CCEV_CONNECTED:
.
.
The application may also use the Dialogic function calls to retrieve additional event or error information. For example:
8.2.3. Handling AlarmsAll ISDN trunk alarms are reported to and handled by the application in the same way as DTI trunk alarms. Additionally, when the trunk is lost, all active calls will be disconnected automatically and a CCEV_DISCONNECTED event will be reported for each line device.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation