
Description | Cautions | Example | Errors | See Also
Name: |
int dx_getfeaturelist(chdev, feature_tablep) | |
Inputs: |
int chdev |
|
FEATURE_TABLE *feature_tablep |
| |
Returns: |
0 on success |
|
-1 on error |
||
Includes: |
dxxxlib.h |
|
Mode: |
Synchronous | |
The dx_getfeaturelist( ) function returns a list of features supported on the device. This function is available for use on all Dialogic voice devices..
Parameter |
Description |
chdev |
Specifies the valid voice channel handle obtained when the channel was opened using dx_open( ). |
feature_tablep |
Specifies a pointer to the data structure FEATURE_TABLE that contains the bitmasks of various features. |
On return from the function, the FEATURE_TABLE structure contains the relevant information and is declared as follows:
typedef struct feature_table {
unsigned short ft_play;
unsigned short ft_record;
unsigned short ft_tone;
unsigned short ft_e2p_brd_cfg;
unsigned short ft_fax;
unsigned short ft_front_end;
unsigned short ft_misc;
unsigned short ft_rfu[8];
} FEATURE_TABLE;
Features reported by each member of the FEATURE_TABLE structure are defined in dxxxlib.h. To determine what features are enabled on the voice device, "bitwise AND" the returned bitmask with the following defines (see the example code).
FT_ADPCM
FT_PCM
FT_ALAW
FT_ULAW
FT_LINEAR
FT_ADSI
FT_DRT6KHZ
FT_DRT8KHZ
FT_DRT11KHZ
FT_ADPCM
FT_PCM
FT_ALAW
FT_ULAW
FT_LINEAR
FT_ADSI
FT_DRT6KHZ
FT_DRT8KHZ
FT_DRT11KHZ
FT_GTDENABLED
FT_GTGENABLED
FT_CADENCE_TONE
FT_CSP
FT_DPD
FT_SYNTELLECT
FT_FAX
FT_VFX40
FT_VFX40E
FT_VFX40E_PLUS
FT_FAX_EXT_TBL
FT_SENDFAX_TXFILE_ASCII
FT_ANALOG
FT_EARTH_RECALL
FT_CALLERID
This function will fail if an invalid voice channel handle is specified.
#include <stdio.h>
#include <windows.h>
#include "srllib.h"
#include "dxxxlib.h"
void main(int argc, char ** argv)
{
char chname[32] = "dxxxB1C1";
int dev;
FEATURE_TABLE feature_table;
if ((dev = dx_open(chname, 0)) == -1) {
printf("Error opening \"%s\"\n", chname);
exit(1);
}
if (dx_getfeaturelist(dev, &feature_table) == -1) {
printf("%s: Error %d getting featurelist\n", chname, ATDV_LASTERR(dev));
exit(2);
}
printf("\n%s: Play Features:-\n", chname);
if (feature_table.ft_play & FT_ADPCM) {
printf("ADPCM ");
}
if (feature_table.ft_play & FT_PCM) {
printf("PCM ");
}
if (feature_table.ft_play & FT_ALAW) {
printf("ALAW ");
}
if (feature_table.ft_play & FT_ULAW) {
printf("ULAW ");
}
if (feature_table.ft_play & FT_LINEAR) {
printf("LINEAR ");
}
if (feature_table.ft_play & FT_ADSI) {
printf("ADSI ");
}
if (feature_table.ft_play & FT_DRT6KHZ) {
printf("DRT6KHZ ");
}
if (feature_table.ft_play & FT_DRT8KHZ) {
printf("DRT8KHZ ");
}
if (feature_table.ft_play & FT_DRT11KHZ) {
printf("DRT11KHZ");
}
printf("\n\n%s: Record Features:-\n", chname);
if (feature_table.ft_record & FT_ADPCM) {
printf("ADPCM ");
}
if (feature_table.ft_record & FT_PCM) {
printf("PCM ");
}
if (feature_table.ft_record & FT_ALAW) {
printf("ALAW ");
}
if (feature_table.ft_record & FT_ULAW) {
printf("ULAW ");
}
if (feature_table.ft_record & FT_LINEAR) {
printf("LINEAR ");
}
if (feature_table.ft_record & FT_ADSI) {
printf("ADSI ");
}
if (feature_table.ft_record & FT_DRT6KHZ) {
printf("DRT6KHZ ");
}
if (feature_table.ft_record & FT_DRT8KHZ) {
printf("DRT8KHZ ");
}
if (feature_table.ft_record & FT_DRT11KHZ) {
printf("DRT11KHZ");
}
printf("\n\n%s: Tone Features:-\n", chname);
if (feature_table.ft_tone & FT_GTDENABLED) {
printf("GTDENABLED ");
}
if (feature_table.ft_tone & FT_GTGENABLED) {
printf("GTGENABLED ");
}
if (feature_table.ft_tone & FT_CADENCE_TONE) {
printf("CADENCE_TONE");
}
printf("\n\n%s: E2P Board Configuration Features:-\n", chname);
if (feature_table.ft_e2p_brd_cfg & FT_DPD) {
printf("DPD ");
}
if (feature_table.ft_e2p_brd_cfg & FT_SYNTELLECT) {
printf("SYNTELLECT");
}
printf("\n\n%s: FAX Features:-\n", chname);
if (feature_table.ft_fax & FT_FAX) {
printf("FAX ");
}
if (feature_table.ft_fax & FT_VFX40) {
printf("VFX40 ");
}
if (feature_table.ft_fax & FT_VFX40E) {
printf("VFX40E ");
}
if (feature_table.ft_fax & FT_VFX40E_PLUS) {
printf("VFX40E_PLUS");
}
if( (feature_table.ft_fax & FT_FAX_EXT_TBL)
&& !(feature_table.ft_send & FT_SENDFAX_TXFILE_ASCII) )
printf("SOFTFAX !\n");
}
printf("\n\n%s: FrontEnd Features:-\n", chname);
if (feature_table.ft_front_end & FT_ANALOG) {
printf("ANALOG ");
}
if (feature_table.ft_front_end & FT_EARTH_RECALL) {
printf("EARTH_RECALL");
}
printf("\n\n%s: Miscellaneous Features:-\n", chname);
if (feature_table.ft_misc & FT_CALLERID) {
printf("CALLERID");
}
printf("\n");
dx_close(dev);
}
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_BADEXTTS |
SCbus time slot is not supported at current clock rate |
EDX_SH_BADINDX |
Invalid Switch Handler index number |
EDX_SH_BADTYPE |
Invalid local time slot channel type (voice, analog, etc.) |
EDX_SH_CMDBLOCK |
Blocking command is in progress |
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