
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetParmEx(linedev, parm_id, valuep) | |
Inputs: |
LINEDEV linedev |
|
int parm_id |
| |
PARM_INFO *valuep |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_GetParmEx( ) function is an extension of the cc_GetParm( ) function that allows the application to retrieve parameters containing variable data passed from the firmware.
Parameter |
Description |
linedev: |
The line device handle. |
parm_id: |
The specified parameter ID. The cc_GetParmEx( ) function can be used to retrieve all the parameters listed in Table 21 in the cc_GetParm( ) function description. In addition, for BRI/SC only, the cc_GetParmEx( ) function can be used to retrieve the parameter values listed in Table 22. |
valuep: |
The address of the buffer in which the requested information will be stored. The PARM_INFO data structure contains he retrieved information. See Section 6.10. PARM_INFO for a description of the data structure. |
The following table lists the cc_GetParmEx( ) function parameter ID definitions.
Table 22. cc_GetParmEx( ) Parameter ID Definitions
Define |
Description |
Return values |
DIRECTORY_NUMBER |
Directory Number |
String of length parmdatalen |
SPID_NUMBER |
Service Provider Identifier |
String of length parmdatalen |
SUBADDR_NUMBER |
Subaddress Number |
String of length parmdatalen |
None
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1T1";
PARM_INFO parminfo, parm_ret_value;
char databuffer[256];
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
/* initialize PARM_INFO structure */
parminfo.parmdatalen = strlen(DN);
strcpy (parminfo.parmdata, DN); /* directory number */
/* Specify the Directory Number */
if cc_SetParmEx(ldev, DIRECTORY_NUMBER, &parminfo) < 0)
{
printf("Error in cc_SetParmEx(): %d\n", cc_CauseValue(ldev);
}
/* Get the Directory Number */
if ( cc_GetParmEx(devhdl, DIRECTORY_NUMBER, &parm_ret_value) < 0 )
procdevfail(devhdl);
else {
strcpy(databuffer, parm_ret_value.parmdata);
printf("Parameter DIRECTORY_NUMBER has value: %s\n", databuffer);
}
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC) < 0 )
procdevfail(devhdl);
if ( cc_AnswerCall(crn, 0, EV_SYNC) < 0 )
callfail(crn);
.
.
.
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC) < 0 )
callfail(crn);
if ( cc_ReleaseCall(crn) < 0 )
procdevfail(devhdl);
if ( cc_Close( devhdl ) < 0 )
printf("Error closing device, errno = %d\n", errno);
}
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf("reason = %x - %s\n",reason,msg);
}
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_GetParmEx( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
ERR_ISDN_LIB | E_ISBADPAR |
Bad input parameter |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation