
Description | Cautions | Example | Errors | See Also
Name: |
||
Inputs: |
int devh |
|
int parmnum |
| |
void *parmvalp |
| |
Returns: |
0 |
|
Includes: |
D42LIB.H | |
Mode: |
synchronous | |
The d42_getparm( ) function retrieves the selected channel or board parameter and places it in the application buffer (parmvalp). Depending on the parameter retrieved, the data returned can be either a character string or an integer. The board and channel parameter that can be retrieved are listed in
Table 1.
Parameter |
Description |
devh: |
specifies the valid board device or channel device descriptor obtained by a call to dx_open( ) |
parmnum: |
contains the parameter name to retrieve |
parmvalp: |
pointer to the application variable that will receive the parameter value |
When retrieving a parameter, the application passes a pointer to a variable that will contain the actual parameter value. This variable should be treated as an unsigned integer for all parameters. The application should cast the parmvalp parameter to a (void *) to avoid compiler warnings.
Table 1. Board and Channel Parameters for d42_getparm( )
Board Parameters |
Description | |
Enable Caller ID Values: 0 - disable (default) 1 - enable | ||
Obtains the switch type Values: | ||
PBX_L4 PBX_L2 PBX_SH PBX_SR PBX_NS PBX_M1 PBX_SX PBX_SX2 |
- Lucent 75/85 - Lucent G3 - Siemens Hicom - Siemens ROLM - Norstar - Meridian 1 - MITEL SX-50 - MITEL SX-200ML | |
Enable report reset Values: 0 - disable (default) 1 - enable | ||
Channel Parameters |
Description | |
Receive asynchronous channel status messages Values: 0 - disable (default) 1 - enable | ||
D4CH_LC_LAMP |
Lamp to monitor for loop current | |
D4CH_CHANNELUPDATE |
Enable/Disable asynchronous LCD and indicator updates | |
D4CH_CALLERIDAVAILABLE |
Enables notification of Caller ID availability using the T_CALLERIDAVAILABLE event. Values: 0 - disable (default) 1 - enable | |
D4CH_CHANNELSTATUS |
Enables notification of a change in the status of the channel. Values: 0 - disable (default) 1 - enable | |
D4CH_SOFTKEYINPUT* |
Enables notification of SoftKey input using the T_SOFTKEYINPUT event. Values: 0 - disable (default) 1 - enable | |
D4CH_TERMINATEFEATURE* |
Enables notification when a feature session is terminated. Values: 0 - disable(default) 1 - enable | |
* When d42_openfeaturesession( ) is called for a channel, the value of this parameter is set automatically to 1 (enable) for that channel. When d42_closefeaturesession( ) is called, the value of this parameter is set automatically to 0 (disable) for that channel.
void main(void)
{
int devh;
int rc = 0;
int parmnum;
unsigned int parmvalp;
/* Open Board Device */
if ( (devh = dx_open("dxxxB1",NULL))==-1)
{
printf("Error dx_open()\n");
exit(-1);
} /* End dx_open */
if ( (ATD4_BDTYPE (devh)) == TYP_D/82M1)
{
/* Get the Board Parameter To See if Speakerphone Mode is Enabled */
if ( (rc = d42_getparm(devh, D4BD_SPMODE, (void *)&parmvalp)) == -1)
{
printf("Error d42_getparm(D4BD_SPMODE)\n");
dx_close(devh);
exit(-1);
} /* End d42_getparm */
/* Check if Speakerphone is enabled */
if (parmvalp == 1)
{
printf("Speakerphone Mode is ENABLED");
else if (parmvalp == 0)
printf("Speakerphone Mode is DISABLED");
} /* End Check if Speakerphone is enabled */
} /* end ATD4_BDTYPE */
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, one of the following (most common) codes will be contained in dx_errno. For a complete list of error codes and definitions, refer to Appendix C.
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_UNSUPPORTED |
Function not supported on this board |
ED42_SYSTEM |
System level error |
ED42_INVALARG |
Invalid argument passed to function |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation