ms_addtoconf( )
Cautions | Errors | Example | See Also
Name: int ms_addtoconf (devh, confID, cdt) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ms_addtoconf( ) function adds one party to an existing conference. The conference identifier specifies the conference to which the party will be added. When this function completes successfully, a party is added to a conference which causes a conferencing resource to be used. Only one party at a time can be added using this function.
devh the MSI board device handle confID the conference identifier number cdt pointer to the conference descriptor table. See the MS_CDT data structure page for details. In SCbus mode, this function returns the listen TDM bus time slot number for the MSPN_TS party. The number is placed in the MS_CDT structure for the MSPN_TS party. For an MSPN_STATION party, such information is not returned because the conferenced signal is not placed on the TDM bus. In SCbus mode, the chan_attr field in the MS_CDT structure is redefined as follows:
#define chan_lts chan_attr
- Note: In SCbus mode, the MS_CDT structure is reused to return the listen TDM bus time slot information. The application is responsible for maintaining the integrity of the data in the structure.
Cautions
- The device handle specified is invalid
- Too many parties are specified for a single conference
- The party is part of another conference
- The conference ID is invalid
- The board is out of DSP conferencing resources
Errors
If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR( ) or ATDV_ERRMSGP( ) to retrieve either the error code or a pointer to the error description, respectively.
Refer to the error type tables found in Chapter 5, "Error Codes". Error defines can be found in dtilib.h or msilib.h.
Example
#include <windows.h> /* For Windows applications only */ #include <errno.h> #include "srllib.h" #include "dtilib.h" #include "msilib.h" #define NUM_PARTIES 2 int dev1; /* Board dev descriptor variables */ int chdev2; /* Channel dev descriptor */ int tsdev1, tsdev2; /* Time slot dev desc */ MS_CDT cdt[NUM_PARTIES]; /* Conf. desc. table */ int confID; /* Conf. ID */ SC_TSINFO tsinfo; /* Time slot info */ int ts1, ts2; /* SCbus time slots */ int station; /* Station number */ /* Open board 1 device */ if ((dev1 = ms_open("msiB1",0)) == -1) { printf( "Cannot open MSI B1: errno=%d", errno); exit(1); } /* Open board 1, channel 2 device */ if ((chdev2 = ms_open("msiB1C2",0) == -1) { printf("Cannot open MSIB1C2. errno = %d", errno); exit(1); } /* Assume MSI/SC is connected to a DTI via SCbus. */ /* Need to do a dt_open() for DTI time slots */ /* followed by dt_getxmitslot() to get SCbus time slots */ /* These SCbus time slots are passed on to the CDT */ /* ts1 & ts2 are used as the time slots */ /* Set up CDT structure */ cdt[0].chan_num = station ; /* station is a valid station number */ cdt[0].chan_sel = MSPN_STATION; cdt[0].chan_attr = MSPA_NULL; /* SCbus time slot to be conferenced */ cdt[1].chan_num = ts1 ; /* ts1 should be a valid time slot */ cdt[1].chan_sel = MSPN_TS; cdt[1].chan_attr = MSPA_NULL; /* Establish conference */ if (ms_estconf(dev1, cdt, NUM_PARTIES, MSCA_ND, &confID) == -1) { printf("Error Message = %s",ATDV_ERRMSGP(dev1)); exit(1); } /* Do a listen for the TS */ tsinfo.sc_numts = 1; tsinfo.sc_tsarray = &cdt[1].chan_lts; if (dt_listen(tsdev1, &tsinfo) == -1){ printf("Error Message = %s",ATDV_ERRMSGP(tsdev1)); exit(1); } /* Continue processing */ /* Add another party to conference */ cdt[0].chan_num = ts2; /* ts2 should be a valid time slot */ cdt[0].chan_sel = MSPN_TS; cdt[0].chan_attr = MSPA_RO|MSPA_TARIFF; if (ms_addtoconf(dev1, confID,&cdt[0]) == -1) { printf("Error Message = %s",ATDV_ERRMSGP(dev1)); exit(1); } /* Do a listen for the TS */ tsinfo.sc_numts = 1; tsinfo.sc_tsarray = &cdt[0].chan_lts; if (dt_listen(tsdev2, &tsinfo) == -1){ printf("Error Message = %s",ATDV_ERRMSGP(tsdev2)); exit(1); } /* Continue processing */See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation