
Description | Cautions | Example | Errors | See Also
Name: |
int dx_getctinfo(chdev, ct_devinfop) | |
Inputs: |
int chdev |
|
|
CT_DEVINFO *ct_devinfop |
|
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
dxxxlib.h |
|
Mode: |
Synchronous | |
The dx_getctinfo( ) function returns information about voice device This function provides information about a voice channel.
Parameter |
Description |
chdev: |
Specifies the valid voice channel handle obtained when the channel was opened using dx_open( ). |
ct_devinfop: |
Specifies a pointer to the data structure CT_DEVINFO that will contain the voice channel device information. |
On return from the function, the CT_DEVINFO structure contains the relevant information and is declared as follows:
typedef struct {
unsigned long ct_prodid;
unsigned char ct_devfamily;
unsigned char ct_devmode;
unsigned char ct_nettype;
unsigned char ct_busmode;
unsigned char ct_busencoding;
unsigned char ct_rfu[7];
} CT_DEVINFO;
Valid values for each member of the CT_DEVINFO structure are defined in dxxxlib.h. Possible return values are:
CT_DFD41E |
voice channel of a D/41ESC board |
CT_DFSPAN |
voice channel of a D/240SC, D/320SC, D/240SC-T1, D/300SC-E1, or D/160SC-LS board |
CT_DMRESOURCE |
analog channel not in use |
CT_DMNETWORK |
analog channel available to process calls from the telephone network |
CT_NTNONE |
D/41ESC board configured as a resource device: voice channels are available for call processing; analog channels are disabled. |
CT_NTANALOG |
analog and voice devices on board are handling call processing |
CT_NTT1 |
D/240SC-T1 T-1 digital channel. |
CT_NTE1 |
D/300SC-E1 E-1 digital channel. |
CT_BMPEB |
PEB (PCM Expansion Bus) architecture |
CT_BMSCBUS |
SCbus architecture |
CT_BEULAW |
Mu-law encoding |
CT_BEALAW |
A-law encoding |
This function will fail if an invalid voice channel handle is specified.
#include <srllib.h>
#include <dxxxlib.h>
#include <errno.h>
main( )
{
int chdev; /* Channel device handle */
CT_DEVINFO ct_devinfo; /* Device information structure */
/* Open board 1 channel 1 devices */
if ((chdev = dx_open("dxxxB1C1", 0)) == -1) {
printf("Cannot open channel dxxxB1C1. errno = %d", errno);
exit(1);
}
/* Get Device Information */
if (dx_getctinfo(chdev, &ct_devinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev));
exit(1);
}
printf("%s Product Id = 0x%x, Family = %d, Mode = %d, Network = %d, Bus ...mode = %d, Encoding = %d", ATDV_NAMEP(chdev),
ct_devinfo.ct_prodid, ...ct_devinfo.ct_devfamily, ct_devinfo.ct_devmode, ct_devinfo.ct_nettype, ...ct_devinfo.ct_busmode,
ct_devinfo.ct_busencoding);
}
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 |
Linux System Error |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation