
Description | Cautions | Example | Errors | See Also
Name: |
int cc_SetParmEx(linedev, parm_id, *parminfoptr) | |
Inputs: |
LINEDEV linedev |
|
int parm_id |
| |
PARM_INFO *parminfoptr |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_SetParmEx( ) function is an extension of the cc_SetParm( ) function that allows the application to set parameters requiring variable data to be passed down to the firmware, without reconfiguration. These parameters include the Service Protocol Identifier (SPID) number, the directory number, and the subaddress of a User-side line. The SPID must first be specified using the cc_SetDChanCfg( ) function and then can be changed using the cc_SetParmEx( ) function. The directory number and subaddress, which are used to restrict incoming calls to those whose parameters match the specified values, can be set and/or changed at any time using the cc_SetParmEx( ) function.
Parameter |
Description |
linedev: |
The line device handle. |
parm_id: |
The parameter identification. This function supports all of the parameters listed in Table 26 in the cc_SetParm( ) function description. In addition, for BRI/SC only, the following parameters are also supported:
The values for parm_id are defined in cclib.h. |
parminfoptr: |
A pointer to the PARM_INFO structure, which contains variable data to set in the firmware on a call-by-call basis. For a description of the PARM_INFO data structure, see 6.10. PARM_INFO. |
#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 ldev = 0;
CRN crn = 0;
char *devname = "briS1T1"; /* device name for BRI station 1 timeslot 1 */
PARM_INFO *parminfo; /* variable data to be set */
char *DN = "99330008080";
.
.
.
/* open the ISDN board device */
if ( cc_Open( &ldev, 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);
}
/* initialize D channel with cc_SetDChanCfg */
.
.
.
/* continue with call processing */
.
.
.
.
} /* end main */
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_SetParmEx( ) 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