
Description | Cautions | Example | Errors | See Also
Name: |
int cc_SetDChanCfg(boarddev, dchan_cfgptr) | |
Inputs: |
LINEDEV boarddev |
|
DCHAN_CFG dchan_cfgptr |
| |
Returns: |
0 on success | |
Includes: |
isdncmd.h | |
Category: |
System tools | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_SetDChanCfg( ) function sets the configuration of the Digital Subscriber Loop (DSL) for the D channel and causes the activation of links if the switch type specified is valid. This function specifies the DSL-specific and logical Data Link-specific parameters. These parameters include switch type, switch side (Network or User) and terminal assignment (fixed Terminal Endpoint Identifier or auto-initializing Terminal Endpoint Identifier). Each station interface is configured separately, which allows different protocols to be run on different stations simultaneously.
When the switch is operating as the User side in North American protocols, the cc_SetDChanCfg( ) function is used to program the Service Profile Identifier (SPID). The SPID must be transmitted and acknowledged by the switch (see the cc_TermRegisterResponse( ) function for more information).
The cc_SetDChanCfg( ) function is also used to define Layer 3 timer values, specify Layer 2 Access and set firmware features such as firmware-applied call progress tones. For a complete listing of the values that can be specified using the cc_SetDChanCfg( ) function, see Section 6.3. DCHAN_CFG.
Parameter |
Description |
boarddev: |
The line device handle of the D channel board. |
dchan_cfgptr: |
The pointer to the D channel configuration (DCHAN_CFG) block. See Section 6.3. DCHAN_CFG for a description of the DCHAN_CFG data structure and for possible field values. |
#include <windows.h> /* for Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
#include "isdncmd.h"
#include "isdnlib.h"
/* Global variables */
LINEDEV boarddev;
DCHAN_CFG dchan_cfg;
main ()
{
dchan_cfg.layer2_access = FULL_ISDN_STACK; /* full protocol */
dchan_cfg.switch_type = ISDN_BRI_NTT; /* NTT switch */
dchan_cfg.switch_side = USER_SIDE; /* User Terminal */
dchan_cfg.number_of_endpoints = 1; /* one terminal */
dchan_cfg.user.tei_assignment = FIXED_TEI_TERMINAL; /* Fixed TEI terminal */
dchan_cfg.user.fixed_tei_value = 23; /* TEI assigned to terminal */
dchan_cfg.tmr.te.T303 = TMR_DEFAULT; /* NOTE: the values chosen are arbitrary. */
dchan_cfg.tmr.te.T304 = TMR_DEFAULT;
dchan_cfg.tmr.te.T305 = TMR_DEFAULT;
dchan_cfg.tmr.te.T308 = TMR_DEFAULT;
dchan_cfg.tmr.te.T310 = TMR_DEFAULT;
dchan_cfg.tmr.te.T313 = TMR_DEFAULT;
dchan_cfg.tmr.te.T318 = TMR_DEFAULT;
dchan_cfg.tmr.te.T319 = TMR_DEFAULT;
.
.
.
if (cc_Open(&boarddev, "briS1", 0) != 0)
{
printf("cc_open: error\n");
}
if (cc_SetDChanCfg(boarddev, &dchan_cfg) == 0)
{
printf("Configuration is set\n");
}
else
printf("Configuration could not be set\n");
/*
* Wait for Link Activation confirmation
* After which call processing can be started.
*/
.
.
.
}
If the function returns a value < 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_SetDChanCfg( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_ISNOMEM |
Cannot map or allocate memory |
ISDN_INVALID_SWITCH_TYPE |
Switch type requested is not supported |
ISDN_MISSING_FIXED_TEI |
Fixed Terminal Endpoint Identifier (TEI) value not provided for non-initializing terminal |
ISDN_MISSING_DN |
Directory number not specified for terminal |
ISDN_MISSING_SPID |
Service Profile Identifier (SPID) not provided for North American Terminal |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation