
Description | Cautions | Example | Errors | See Also
Name: |
int dx_listenecrex(chdev, sc_tsinfop, ecrctp) | |
Inputs: |
int chdev |
|
SC_TSINFO |
| |
DX_ECRCT |
| |
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
dxxxlib.h |
|
Category: |
Echo Cancellation Resource | |
Mode: |
Synchronous | |
The dx_listenecrex( ) function performs identically to dx_listenecr( ) and also modifies the characteristics of the echo canceller. The characteristics of the echo canceller can be set using the echo cancellation resource characteristic table DX_ECRCT.
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. |
ecrctp |
Pointer to DX_ECRCT structure cast to a (void *). |
One characteristic of the echo canceller that can be set using dx_listenecrex( ) is the non-linear processor (NLP). When the NLP is activated, the output of the echo canceller is replaced with an estimate of the background noise. The NLP provides full echo suppression as long as the echo-reference signal contains speech signals and the echo-carrying signal does not. In this case, the echo canceller cancels the echo and maintains the full duplex connection.
The DX_ECRCT structure is declared as follows:
typedef struct dx_ecrct {
int ct_length; /*size of this structure*/
unsigned char ct_NLPflag /*ECR with NLP requested ECR_CT_ENABLE:ECR_CT_DISABLE */
} DX_ECRCT;
#define SIZE_OF_ECR_CT sizeof (DX_ECRCT) /*size of DX_ECRCT*/
#define ECR_CT_ENABLE 0
#define ECR_CT_DISABLE 1
Setting ct_NLP flag to ECR_CT_ENABLE activates NLP and setting ct_NLP flag to ECR_CT_DISABLE disables NLP.
ecrct.ct_length=size_of_ecr_ct;
This function fails when:
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <msilib.h>
main()
{
int msdev1, chdev2; /* MSI/SC Station, and Voice Channel device handles */
SC_TSINFO sc_tsinfo; /* Time slot information structure */
DX_ECRCT dx_ecrct; /* ECR Characteristic Table */
long scts; /* SCbus time slot */
/* Open MSI/SC board 1 station 1 device */
if ((msdev1 = ms_open("msiB1C1", 0)) == -1) {
/* Perform system error processing */
exit(1);
}
/* Open board 1 channel 2 device */
if ((chdev2 = dx_open("dxxxB1C2", 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;
/* Fill in the ECR Characteristic Table : with NLP turned off */
dx_ecrct.ct_length = size_of_ecr_ct;
dx_ecrct.ct_NLPflag = ECR_CT_DISABLE;
/* Get SCbus time slot connected to transmit of MSI/SC station 1 on board 1 */
if (ms_getxmitslot(msdev1, &sc_tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(msdev1));
exit(1);
}
/* Connect the echo-reference receive of voice channel 2 on board 1 to
the transmit signal of msdev1 */
if (dx_listenecrex(chdev2, &sc_tsinfo, (void *)&dx_ecrct) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev2));
exit(1);
}
/* Continue
.
.
.
/* Then perform xx_unlisten()s and dx_unlistenecr(), plus all xx_close()s */
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. One of the following error codes may be returned:
Equate |
Returned When |
EDX_BADPARM |
Parameter error |
EDX_SH_BADCMD |
Function is not supported in current bus configuration |
EDX_SH_BADEXTTS |
SCbus time slot is not supported at current clock rate |
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 already disconnected from SCbus |
EDX_SH_LIBBSY |
Switch Handler library busy |
EDX_SH_LIBNOTINIT |
Switch Handler library uninitialized |
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