(Page 1 of 1 in this chapter)
|
localstream
|
MVIP-95: 0MVIP-90: 16
|
|
localtimeslot
|
A value corresponding to the timeslot to query (0 - 23).
|
|
deviceid
|
MVIP95_ANALOG_LINE_DEVICE
|
|
parameterid
|
NMS_ANALOG_INTERFACE_TYPE
|
typedef struct
{
DWORD type ;
} NMS_ANALOG_INTERFACE_TYPE_PARMS ;

Figure 17. NMS_ANALOG_INTERFACE_TYPE_PARMS Type Component
|
Value
|
Line Interface Type
|
|---|---|
0x10
|
Operator Work Station
|
0x1F
|
Operator Work Station with Ringing
|
0x78
|
Enhanced Loop Start (ELS)
|
0xFF
|
No interface
|
/*
* Identify the type of signaling module on a given terminus
* ---------------------------------------------------------
*/
#include "ctadef.h" /* For CT Access */
#include "swidef.h" /* For CT Access Switching Service */
#include "mvip95.h" /* For MVIP95_ANALOG_LINE_DEVICE */
#include "nmshw.h" /* For NMS_LINE_INTERFACE_TYPE */
#include <stdlib.h>
#include <stdio.h>
DWORD myGetInterfaceType (
SWIHD swihd, /* From swiOpenSwitch() */
SWI_TERMINUS terminus, /* Target port */
DWORD *generation, /* Hardware generation */
DWORD *type /* Physical interface type */
)
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_ANALOG_INTERFACE_TYPE_PARMS parms ;
DWORD rc ;
if ( terminus.bus != MVIP95_LOCAL_BUS )
return -1 ; /* Error - only applies to local bus */
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = NMS_ANALOG_INTERFACE_TYPE ;
rc = swiGetLocalTimeslotInfo (
/* CT Access switch handle */ swihd,
/* Target device and config item */ & args,
/* Buffer (defined by parameterid) */ (void*) & parms,
/* Buffer size in bytes */ sizeof(parms));
if ( rc == SUCCESS )
{
*generation = GET_ANALOG_INTERFACE_CLASS(parms.type);
*type = GET_ANALOG_INTERFACE_TYPE(parms.type);
switch (*generation)
{
case NMS_INTERFACE_AG_HYBRID:
printf("Class: NMS_INTERFACE_AG_HYBRID\n");
break;
case NMS_INTERFACE_AG_SIGNALING_MODULE:
printf("Class: NMS_INTERFACE_AG_SIGNALING_MODULE\n");
break;
default:
printf("Class: Unknown\n");
}
printf ("Type : %02X\n", *type ) ;
}
else
{
printf ("swiGetLocalTimeslotInfo returns %d\n", rc ) ;
}
return rc ;
}
|
localstream
|
MVIP-95: 0MVIP-90: 16
|
|
localtimeslot
|
The timeslot corresponding to the line interface (0 - 23).
|
|
deviceid
|
NMS_ANALOG_LINE_DEVICE
|
|
parameterid
|
For the input gain: MVIP95_INPUT_GAIN
|
|
Device Type
|
Input Gain
|
Output Gain
|
|---|---|---|
|
Analog
|
· Enhanced Loop Start (ELS): 6000, 0, -3000, -6000, - 9000· All others: 0, -3000, -6000, -9000
|
NA
|
|
Conference
|
0, -3000, -6000, -9000
|
0, -3000
|
#include "swidef.h" /* CT Access Switching Service */
#include "mvip95.h" /* MVIP-95 definitions */
#include "nmshw.h" /* NMS hardware-specific ddefinitions */
DWORD mySetReceiveGain ( SWIHD swihd, SWI_TERMINUS terminus, INT32 gain_dB )
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_LINE_GAIN_PARMS device ;
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = MVIP95_INPUT_GAIN ;
device.gain = gain_dB * 1000 ;
return swiConfigLocalTimeslot (
/* CT Access switch handle */ swihd,
/* Target device and config item */ & args,
/* Buffer (defined by parameterid) */ (void*) & device,
/* Buffer size in bytes */ sizeof(device));
}
|
Device Type
|
Input Gain
|
Output Gain
|
|---|---|---|
|
Analog
|
· Enhanced Loop Start (ELS): 6000, 0, -3000, -6000, - 9000· All others: 0, -3000, -6000, -9000
|
NA
|
|
Conference
|
0, -3000, -6000, -9000
|
0, -3000
|
#include "swidef.h" /* CT Access Switching Service */
#include "mvip95.h" /* MVIP-95 definitions */
#include "nmshw.h" /* NMS hardware-specific definitions */
DWORD myGetReceiveGain ( SWIHD swihd, SWI_TERMINUS terminus, INT32* gain_dB )
{
SWI_LOCALTIMESLOT_ARGS args;
NMS_LINE_GAIN_PARMS device ;
DWORD rc ;
args.localstream = terminus.stream ;
args.localtimeslot = terminus.timeslot ;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE ;
args.parameterid = MVIP95_INPUT_GAIN ;
rc = swiGetLocalTimeslotInfo (
/* CT Access switch handle */ swihd,
/* Target device and config item */ & args,
/* Buffer (defined by parameterid) */ (void*) & device,
/* Buffer size in bytes */ sizeof(device));
*gain_dB = device.gain / 1000 ;
return rc ;
}
void myGetGain(SWIHD agcxhd, DWORD *gain)
{
SWI_LOCALTIMESLOT_ARGS args;
DWORD tmp;
/*
** Assume that there exists a connection between
** 16:6 and 20:6
*/
/* First, get line interface gain */
args.localstream = 0;
args.deviceid = MVIP95_ANALOG_LINE_DEVICE;
args.parameterid = MVIP95_INPUT_GAIN;
args.localtimeslot = 6;
swiGetLocalTimeslotInfo(agcxhd, &args, gain, sizeof(*gain));
/* Now get conference chip gain */
args.localstream = 20;
args.deviceid = MVIP95_CONFERENCE_DEVICE;
args.parameterid = MVIP95_INPUT_GAIN;
args.localtimeslot = 6;
swiGetLocalTimeslotInfo(agcxhd, &args, &tmp, sizeof(tmp));
/* Now add the two together, and return value */
*gain += tmp;
}
(Page 1 of 1 in this chapter)