
Description | Cautions | Example 1: | Example 2: | Errors | See Also
Name: |
int dcb_DeleteAllConferences(devh, mode, rfu) | |
Inputs: |
int devh |
|
unsigned short mode |
| |
void* rfu |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Conference Management | |
Mode: |
synchronous/asynchronous | |
The dcb_DeleteAllConferences( ) function deletes all established conferences. This function is provided for recovery purposes. A typical use would be if an application had to be restarted due to an abnormal termination: rather than downloading firmware to re-initialize the boards, this function could be called to delete all conferences that might be left active in firmware.
Parameter |
Description | |
devh: |
The valid DCB DSP device handle returned by a call to dcb_open( ). | |
mode: |
The operation mode specifies whether the function should run asynchronously or synchronously. | |
EV_ASYNC |
| |
EV_SYNC |
| |
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
int dspdevh;
long EventHandler (unsigned long temp)
{
int dev=sr_getevtdev( );
long event=sr_getevttype( );
int nSize = sr_getevtlen( );
int *pData = (int*) sr_getevtdatap( );
switch(event) {
case DCBEV_DELALLCONF :
printf("EventHandler->DCBEV_DELALLCONF DeviceHandle = %d Device = %s Size = %d Data = 0x%x\n",
dev,ATDV_NAMEP(dev),nSize,*pData);
break;
case DCBEV_ERREVT :
printf("EventHandler->DCBEV_ERREVT DeviceHandle = %d Device = %s Size = %d Data = 0x%x\n",
dev,ATDV_NAMEP(dev),nSize,*pData);
break;
default :
printf("EventHandler->Unknown event received...Event = 0x%x DeviceHandle = %d Device = %s Size = %d\n",
event,dev,ATDV_NAMEP(dev),nSize);
break;
} //switch event ends
return 0;
} // EventHandler ends
void main(void)
{
char DeviceName[16];
void *RFU=0;
int srlmodel = SR_STASYNC;
// Set SR_MODELTYPE to SR_STASYNC to disable creation of internal thread to
// monitor events for callback handler. Instead, the application will
// use sr_waitevt( ) to poll for events.
if (sr_setparm(SRL_DEVICE, SR_MODELTYPE, (void *)&srlmodel) == -1) {
/* process error */
}
sprintf(DeviceName,"dcbB1D1");
printf("Trying to open device = %s\n",DeviceName);
if ( (dspdevh = dcb_open(DeviceName, 0)) == -1) {
printf("Cannot open device %s. errno = %d\n", DeviceName,errno);
exit(1);
}
else {
printf("Open successfull for device %s... dspdevh=0x%x\n",DeviceName,dspdevh);
}
/* Set up handler function to handle DeleteAllConferences completion */
if (sr_enbhdlr(EV_ANYDEV, EV_ANYEVT, &EventHandler) < 0) {
/* process error */
}
/* Establish Conferences and Continue Processing */
/* Delete all Active Conferences */
if (dcb_DeleteAllConferences(dspdevh, EV_ASYNC, 0) == -1)
{
printf("dcb_DeleteAllConferences failed for %s. Error message = %s",
ATDV_NAMEP(dspdevh), ATDV_ERRMSGP(dspdevh));
/* process error */
}
else
{
printf("dcb_DeleteAllConferences issued for %s... \n",
ATDV_NAMEP(dspdevh));
}
/* Use sr_waitevt to wait for the completion of dcb_DeleteAllConferences.
On receiving the completion event, control is transferred to the handler
function previously established using sr_enbhdlr
*/
/* Done processing - Close device */
if ( dcb_close(dspdevh) == -1) {
printf("Cannot close device %s. errno = %d\n", DeviceName,errno);
exit(1);
}
else
printf("dcb_close successfull for device %s... dspdevh=0x%x\n",DeviceName,dspdevh);
} // main( ) ends
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
int dspdevh=0;
int DeleteAllConferences(void);
void main(void)
{
char DeviceName[16];
sprintf(DeviceName,"dcbB1D1");
printf("Trying to open device = %s\n",DeviceName);
if ( (dspdevh = dcb_open(DeviceName, 0)) == -1) {
printf("Cannot open device %s. errno = %d\n", DeviceName,errno);
exit(1);
}
else {
printf("Open successfull for %s... dspdevh=0x%x\n",DeviceName,dspdevh);
}
/* Establish Conferences and Continue Processing */
/* Delete all Active Conferences */
DeleteAllConferences( );
/* Done processing - Close device */
if ( dcb_close(dspdevh) == -1) {
printf("Cannot close device %s. errno = %d\n", DeviceName,errno);
exit(1);
}
else {
printf("dcb_close successfull ... dspdevh=0x%x\n",dspdevh);
}
} // main( ) ends
int DeleteAllConferences( )
{
void *RFU=0;
if (dcb_DeleteAllConferences(dspdevh, EV_SYNC, RFU) == -1)
{
printf("dcb_DeleteAllConferences failed for %s. Error message = %s",
ATDV_NAMEP(dspdevh), ATDV_ERRMSGP(dspdevh));
return(-1);
}
else
{
printf("dcb_DeleteAllConferences successfull for %s... \n",
ATDV_NAMEP(dspdevh));
}
return(0);
} //DeleteAllConferences ends
If the function does not complete successfully, it will return -1 to indicate an error. Use the Standard Attribute functions ATDV_LASTERR( ) to obtain the applicable error value, or ATDV_ERRMSGP( ) to obtain a more descriptive error message.
Refer to the error type tables found in Chapter 2 of the Dialogic Audio Conferencing Software Reference. Error defines can be found in dtilib.h, msilib.h or dcblib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation