
Description | Cautions | Example | Errors | See Also
Name: |
int dx_getxmitslotecr(chdev, sc_tsinfop) | |
Inputs: |
int chdev |
|
|
SC_TSINFO *sc_tsinfop |
|
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
dxxxlib.h |
|
Category: |
Echo Cancellation Resource | |
Mode: |
Synchronous | |
The dx_getxmitslotecr( ) function provides the ECR transmit time-slot number assigned to the echo cancellation resource of the specified voice channel device.
The SCbus time slot information is contained in an SC_TSINFO structure.
Parameter |
Description |
chdev |
Specifies the voice channel device handle obtained when the channel was opened using dx_open( ). |
sc_tsinfop |
Specifies a pointer to the data structure SC_TSINFO. |
The SC_TSINFO structure is defined as follows:
typedef struct {
unsigned long sc_numts;
long *sc_tsarrayp;
} SC_TSINFO;
The sc_numts member of the SC_TSINFO structure must be initialized with the number of SCbus time slots requested, which in this case should always be one. The sc_tsarrayp field of the SC_TSINFO structure must be initialized with a pointer to a valid array of long integers, the length of which in this case should always be one. Upon return from the function, the first element of the array contains the number (between 0 and 1023) of the SCbus time slot used for transmission of the echo-cancelled signal of the specified voice channel.
This function fails when:
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
main()
{
int chdev; /* Channel device handle */
SC_TSINFO sc_tsinfo; /* Time slot information structure */
long scts; /* SCbus time slot */
/* Open board 1 channel 1 devices */
if ((chdev = dx_open("dxxxB1C1", 0)) == -1) {
/* Perform system error processing */
exit(1);
}
/* Fill in the SCbus time slot information */
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarrayp = &scts;
/* Get SCbus time slot on which the echo-cancelled signal will be transmitted */
if (dx_getxmitslotecr(chdev, &sc_tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev));
exit(1);
}
printf("%s transmits the echo cancelled signal on %d", ATDV_NAMEP(chdev),scts);
return(0);
}
If the function returns -1, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. The error codes returned by ATDV_LASTERR( ) are:
Equate |
Returned When |
EDX_BADPARM |
Parameter error |
EDX_SH_BADCMD |
Function is not supported in current bus configuration |
EDX_SH_BADINDX |
Invalid Switch Handler index number |
EDX_SH_BADLCLTS |
Invalid channel number |
EDX_SH_BADMODE |
Function not supported in current bus configuration |
EDX_SH_BADTYPE |
Invalid channel type (voice, analog, etc.) |
EDX_SH_CMDBLOCK |
Blocking function is in progress |
EDX_SH_LCLDSCNCT |
Channel is already disconnected from SCbus |
EDX_SH_LIBBSY |
Switch Handler library busy |
EDX_SH_LIBNOTINIT |
Switch Handler library not initialized |
EDX_SH_MISSING |
Switch Handler is not present |
EDX_SH_NOCLK |
Switch Handler clock fallback failed |
EDX_SYSTEM |
Error from operating system; use dx_fileerrno( ) to obtain error value |
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation