(Page 1 of 1 in this chapter)


Chapter 6

Line Interface Operations


6.1 Introduction
6.2 Identifying the Line Interface Type for a Timeslot
6.3 Setting Line Interface Gain
6.4 Retrieving the Line Interface Gain

6.1 Introduction

This chapter documents operations specific to the AG Connect's line interfaces which you can perform in software. These operations include:

These operations can be performed programmatically using CT Access Switching service function calls, or with swish utility commands. For more information about the Switching service, see the Switching Service Developer's Reference Manual.

Code samples in subsequent sections refer to the following macros:
Macro

Hex Value

MVIP95_ANALOG_LINE_DEVICE

0x0002

MVIP95_CONFERENCE_DEVICE

0x0003

NMS_ANALOG_INTERFACE_TYPE

0x80000004

MVIP95_INPUT_GAIN

0x80000008

MVIP95_OUTPUT_GAIN

0x80000009

NMS_CONF_GET_SEAT_PARAMETER

0x80000010

NMS_CONF_SET_SEAT_PARAMETER

0x80000011

NMS_CONF_GET_CONF_DEFAULT

0x80000012

NMS_CONF_SET__CONF_DEFAULT

0x80000013

NMS_CONF_GET_SWITCH_DEFAULT

0x80000014

NMS_CONF_SET_SWITCH_DEFAULT

0x80000015

NMS_CONF_RELEASE_SEAT

0x80000016

NMS_CONF_RELEASE_CONF

0x80000017

NMS_CONF_GET_SWITCH_STATUS

0x80000018

NMS_CONF_GET_CONF_STATUS

0x80000019

Note: The macros shown above are defined in the mvip95.h and nmshw.h header files, and are subject to change.

6.2 Identifying the Line Interface Type for a Timeslot

To determine the type of line interface associated with a specific timeslot, an application can call the CT Access Switching service function swiGetLocalTimeslotInfo. In the SWI_LOCALTIMESLOT_ARGS structure referenced in this call, the fields are set as follows:
Field

Setting to Get Line Interface Type

localstream

MVIP-95: 0

MVIP-90: 16

localtimeslot

A value corresponding to the timeslot to query (0 - 23).

deviceid

MVIP95_ANALOG_LINE_DEVICE (0x0000002)

parameterid

NMS_ANALOG_INTERFACE_TYPE

The stream and timeslot specification method (MVIP-95 or MVIP-90) is determined when the AG Connect is opened as a switching device using swiOpenSwitch.

swiGetLocalTimeslotInfo also points to a buffer specific to the parameterid. When identifying the line interface type, this structure is defined as:

    typedef struct
    {
        DWORD type; 
    
    } NMS_ANALOG_INTERFACE_TYPE_PARMS ;

The type component of the NMS_ANALOG_INTERFACE_TYPE_PARMS structure is formatted in the following way:

Figure 13. NMS_ANALOG_INTERFACE_TYPE_PARMS Type Component

The class is NMS_INTERFACE_AG_HYBRID, and the type is identified with one of the numbers included in the table below:
Value

Line Interface Type

0x10

Operator Work Station

0x1F

Operator Work Station with Ringing

0x78

Enhanced Loop Start (ELS)

0xFF

No interface

The following example code shows how to retrieve the type of each line interface on a board:

/*
 *   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 ;
}

6.3 Setting Line Interface Gain

Input gain is the gain applied to the input from the network. You can set the input gain for individual line interfaces.

To set the input for a line interface, call the CT Access Switching service function swiConfigLocalTimeslot. In the SWI_LOCALTIMESLOT_ARGS structure referenced in this call, set the fields as follows:
Field

Setting to Configure Gain

localstream

MVIP-95: 0

MVIP-90: 16

localtimeslot

The timeslot corresponding to the line interface (0 - 23).

deviceid

MVIP95_ANALOG_LINE_DEVICE (0x0000002)

parameterid

For the input gain: MVIP95_INPUT_GAIN (0x0000008)

The stream and timeslot specification method (MVIP-95 or MVIP-90) is determined when the AG Connect is opened as a switching device using swiOpenSwitch.

The buffer pointer set in the swiConfigLocalTimeslot call points to the structure containing the gain value. Gain values are expressed in thousandths of a decibel. For example, 6dB is specified as 6000. Valid gain values are:
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

The following sample code shows how to configure gain applied to a signal received from the network:

#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));
}

Gain can also be configured for conference seats. (See the Conferencing Developer's Reference Manual to learn how to do this.) When a line interface is connected to a conference, the actual gain value is the sum of the gain settings of the line interface and the conference seat.

If an attempt is made to connect a line interface to a conference seat, and the resulting gain value is too large, the connection is rejected and SWIERR_NO_PATH is returned.

If a connection already exists between a line interface and a conference seat, if an attempt is made to change either the interface or seat gain to a value which would make the sum of the values too large, the request is rejected and SWIERR_INVALID_PARAMETER is returned.

6.4 Retrieving the Line Interface Gain

You can query for the current the input setting of an individual line interface.

To determine the input for a line interface, call the CT Access Switching service function swiGetLocalTimeslotInfo. In the SWI_LOCALTIMESLOT_ ARGS structure referenced in this call, set the fields as follows:
Field

Setting to Determine Gain

localstream

MVIP-95: 0

MVIP-90: 16

localtimeslot

The timeslot corresponding to the line interface (0 - 23).

deviceid

MVIP95_ANALOG_LINE_DEVICE (0x0000002)

parameterid

For the input gain: MVIP95_INPUT_GAIN (0x0000008)

The stream and timeslot specification method (MVIP-95 or MVIP-90) is determined when the AG Connect is opened as a switching device using swiOpenSwitch.

The buffer pointer set in swiConfigLocalTimeslot refers to a NMS_LINE_GAIN_PARMS structure that contains the gain value. Gain values are expressed in thousandths of a decibel. For example, 6dB is specified as 6000. Valid gain values are. For example, 6dB is specified as 6000.

Possible gain values are:
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

The following sample code shows retrieve line gain applied to signal received from network:

#include "swidef.h"  /*  CT Access Switching Service         */
#include "mvip95.h"  /*  MVIP-95 definitions                 */
#include "nmshw.h"   /*  NMS hardware-specific ddefinitions  */

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 ;
}

Gain can also be configured for conference seats. When a line interface is connected to a conference, the actual gain value is the sum of the gain settings of the line interface and the conference seat. The following code sample shows how to calculate thie value (hex values associated with character strings are shown in Section 6.1):

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;
}
For more information about determining the gain of a conference seat, see the Conferencing Developer's Reference Manual.



(Page 1 of 1 in this chapter)


tech_support@nmss.com
Copyright © 1999, Natural MicroSystems, Inc. All rights reserved.