
Description | Cautions | Example | Errors | See also
Name: |
int ag_getctinfo(chdev, ct_devinfop) | |
Inputs: |
int chdev |
|
|
CT_DEVINFO *ct_devinfop |
|
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
dxxxlib.h |
|
Mode: |
Synchronous | |
The ag_getctinfo( ) function returns information about the analog device. This function provides information about an analog channel such as on a D/41ESC or D/160SC-LS board.
Parameter |
Description |
chdev: |
Specifies the valid analog channel handle obtained when the channel was opened using dx_open( ). |
ct_devinfop: |
Specifies a pointer to the data structure CT_DEVINFO. |
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 |
analog channel of a D/41ESC board |
|
CT_DFSPAN |
analog channel of a 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 available for call processing; analog channels are disabled. |
|
CT_NTANALOG |
analog and voice devices on board are handling call processing |
|
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 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 (ag_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 |
Cbus time slot is not supported at current clock rate |
EDX_SH_BADINDX |
Invalid Switch Handler library index number |
EDX_SH_BADTYPE |
Invalid 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