
Description | Cautions | Example | Errors | See Also
Name: |
int dcb_estconf(devh,cdt,numpty,confattr,confid) | |
Inputs: |
int devh |
|
MS_CDT *cdt |
| |
int numpty |
| |
int confattr |
| |
int *confid |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Conference Management | |
Mode: |
synchronous | |
The dcb_estconf( ) function establishes a conference of up to four parties. A conference is associated with a DSP and all DSP resources used by the conference are on that DSP. When dcb_estconf( ) returns successfully, confid will contain the conference identification number for use in all further modifications to that conference.
Parameter |
Description |
devh: |
The DCB/SC DSP device handle. |
cdt: |
Pointer to the conference descriptor table. |
numpty: |
Number of parties in the conference. |
confattr: |
The conference attributes. |
confid: |
Pointer to the conference ID number. |
The conference descriptor table is an array of the MS_CDT structure. The MS_CDT structure has the following format:
typedef struct {
int chan_num; /* SCbus time slot number */
int chan_sel; /* meaning of time slot number */
int chan_attr; /* attribute description */
} MS_CDT;
The chan_num field denotes the SCbus transmit time slot number of the device to be included in the conference. The chan_sel defines the meaning of the chan_num. At present, chan_sel must be set to the following value:
chan_attr is a bitmask describing the conferee's properties within the conference. Valid choices are:
Table 4. Valid Attribute Combinations
Coach |
Periodic Tone |
Receive-only mode | |
X | |||
X |
|||
X |
X | ||
X |
|||
X |
|||
X |
X |
The The conference attribute parameter, conf_attr, is a bitmask describing the properties of the conference. The properties are in effect for all parties in the conference.
For MSCA_NN to have an effect, it should be ORed together with MSCA_ND.
The default MSCA_NULL must be used if the conference attribute is not specified.
For each member of a conference, the number of the SCbus time slot to listen to is returned in the chan_lts field of MS_CDT. The chan_attr field in the CDT structure is redefined as follows:
#define chan_lts chan_attr
This function fails when:
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
#define NUM_PARTIES 2
main()
{
int dspdevh; /* DCB/SC DSP Device handle variable */
int tsdevh1, tsdevh2; /* Time slot device handles */
MS_CDT cdt[NUM_PARTIES]; /* Conference descriptor table */
SC_TSINFO tsinfo; /* Time slot information structure */
int confid; /* Conference ID */
long scts; /* SCbus time slot */
/* Open DCB/SC board 1, DSP 2 device */
if ((dspdevh = dcb_open("dcbB1D2", 0) == -1) {
printf("Cannot open dcbB1D2. errno = %d", errno);
exit(1);
}
/* Open network board 1, time slot 1 */
if ((tsdevh1 = dt_open("dtiB1T1", 0)) == -1) {
printf( "Cannot open dtiB1T1: errno=%d", errno);
exit(1);
}
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &scts;
if (dt_getxmitslot(tsdevh1, &tsinfo) == -1){
printf("Error Message = %s", ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Set up CDT structure */
cdt[0].chan_num = (int)scts ; /* scts is the time slot... */
cdt[0].chan_sel = MSPN_TS ; /* ...returned from getxmitslot() */
cdt[0].chan_attr = MSPA_TARIFF;
/* Open board 1, time slot 2 */
if ((tsdevh2 = dt_open("dtiB1T2", 0)) == -1) {
printf( "Cannot open dtiB1T2: errno=%d", errno);
exit(1);
}
if (dt_getxmitslot(tsdevh2, &tsinfo) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/* SCbus time slot to be conferenced */
cdt[1].chan_num = (int)scts ; /* scts is the time slot... */
cdt[1].chan_sel = MSPN_TS ; /* ...returned from getxmitslot() */
cdt[1].chan_attr = MSPA_PUPIL; /* Conferee may be coached later */
/* Establish conference */
if (dcb_estconf(dspdevh, cdt, NUM_PARTIES, MSCA_ND, &confid) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Do a listen() for the tsdevh1 to its conference signal */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &cdt[0].chan_lts;
if (dt_listen(tsdevh1,&tsinfo) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh1));
exit(1);
}
/* Do a listen() for the tsdevh2 to its conference signal */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarrayp = &cdt[1].chan_lts;
if (dt_listen(tsdevh2,&tsinfo) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh2));
exit(1);
}
/*
* Continue processing
*/
/* Unlisten the time slots */
if (dt_unlisten(tsdevh1) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh1));
exit(1);
}
if (dt_unlisten(tsdevh2) == -1){
printf("Error Message = %s",ATDV_ERRMSGP(tsdevh2));
exit(1);
}
if (dt_close(tsdevh1) == -1){
printf("Error closing tsdevh1\n");
exit(1);
}
if (dt_close(tsdevh2) == -1){
printf("Error closing tsdevh2\n");
exit(1);
}
/* Delete the conference */
if(dcb_delconf(dspdevh, confid) == -1) {
printf("Cannot delete conference %d. Error Message = %s", confid,
ATDV_ERRMSGP(dspdevh));
exit(1);
}
/* Done Processing - Close device */
if(dcb_close(dspdevh) == -1) {
printf("Cannot close DSP dcbB1D2. errno = %d", errno);
exit(1);
}
}
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 this guide. Error defines can be found in dtilib.h, msilib.h or dcblib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation