(Page 1 of 1 in this chapter)


Chapter 5

Migration from SwitchPath


5.10 Error Handling
5.11 Utility Functions
5.12 Table of Function Equivalents

5.1 Introduction

If you are migrating from an existing SwitchPath application, you may be able to directly substitute CT Access functions for SwitchPath functions, subject to these considerations:

This chapter also lists the SwitchPath functions and their equivalents in CT Access.

Note: It is important that you read Chapters 2, 3, and 4 of the CT Access Developer's Reference Manual prior to reading this chapter. The developer's manual contains concepts and terms that are essential to understanding the CT Access terminology in this chapter.

5.1.1 SwitchPath and the CT Access Switching Service

SwitchPath:

The CT Access Switching service:

5.2 Initializing SwitchPath

The equivalent of CxInitialize is ctaOpenServices. Instead of attaching the current application to SwitchPath, ctaOpenServices allows you to open a service, in this case, the CT Access Switching service. Refer to the CT Access Developer's Refeence Manual for more information about CT Access services.

5.3 Comparing Group Names and Terminuses

This section compares group names in SwitchPath to terminuses in the CT Access Switching service.

5.3.1 SwitchPath

For ease in specifying trunks, processing boards, switches, and desired connections, SwitchPath includes a naming capability. A series of definition and configuration functions let you specify the hardware configuration and give names to logical groups. Groups are named groupings of streams and timeslots that can be used to make switching connections.

5.3.2 CT Access Switching Service

There are no groups in the CT Access Switching service. Therefore, all applications that use SwitchPath groups will need to change and use the underlying streams and timeslots when calling switching functions. The CT Access Switching service allows the use of multiple terminuses in one switching function call. This gives you similar functionality as groups in SwithPath.

A terminus is a single access point to a switch block input or switch block output. Many of the Switching service functions take one or more terminus elements as an argument.

A terminus consists of a bus, a stream, and a timeslot.

Element

Description

Bus

Specifies the interface point of the switch block. Devices can reside directly on the MVIP bus. Devices can also reside on a board's local bus and may require a switch block to access the MVIP bus.

Stream

Specifies a grouping of timeslots that usually corresponds to a particular bit-stream of time-division multiplexed (TDM) serial data on an individual track or wire of a bus.

Timeslot

Specifies a particular 64kbit/second sub-division of a TDM bus stream. Timeslots number from zero (0) to n where n is stream dependent.

5.3.3 Example of Translating Group Names to Terminuses

Assume that a group named PSTN has been created (using CxDefineGroup) containing the T1 board's stream:timeslots 16:0, 16:1...16:23, and a group named Voice has been created containing MVIP bus stream:timeslots 6:0, 6:1...6:23 which are the MVIP bus addresses of one AG-24. The T1 board contains a switch (for example, referenced by handle SWI). To make a full-duplex connection of the 4th channel of a T1 trunk from the PSTN to the 15th port in an AG-24 voice board, you might say:

CxConnect (SW1, PSTN, 3, Voice, 14, DUPLEX)
You may make a full duplex connection between the same streams and timeslots using the CT Access Switching service. Suppose you opened a switch handle called SW1 to the T1 board using swiOpenSwitch. The SwitchPath group PSTN translates to streams:timeslots local:0:0..23 on the input side of the switch block, and local:1:0..23 on the output side of the switch block in MVIP-95. The SwitchPath group Voice translates to stream:timeslots mvip:12:0..23 on the input side of the switch block, and mvip:13:0..23 on the output side of the switch block.

The following example codes presents how you can make a full duplex connection between the two sets of timeslots.

SWI_TERMINUS PSTNInput[24], PSTNOutput[24], MvipInput[24], MvipOutput[24];

for (i=0;i<23;i++)
{
PSTNInput[i].bus = MVIP95_LOCAL_BUS;
PSTNInput[i].stream = 0;
PSTNInput[i].timeslot = i;

PSTNOutput[i].bus = MVIP95_LOCAL_BUS;
PSTNOutput[i].stream = 1;
PSTNOutput[i].timeslot = i;

MvipInput[i].bus = MVIP95_MVIP_BUS;
MvipInput[i].stream = 12;
MvipInput[i].timeslot = i;

MvipOutput[i].bus = MVIP95_MVIP_BUS;
MvipOutput[i].stream = 13;
MvipOutput[i].timeslot = i;
}

swiMakeConnection(SWI, PSTNInput, MvipOutput, 24);
swiMakeConnection(SWI, MvipInput, PSTNOutput, 24);

5.4 Making Connections

In SwitchPath, CxConnect and CxConnectGroup are used to make connections. In CT Access, swiMakeConnection makes connections between the corresponding elements of the output terminus array and the input terminus array.

When migrating from SwitchPath to the Switching service, you will need to translate the groups and channels that you pass to CxConnect and to CxConnectGroup to the underlying streams and timeslots. You pass these streams and timeslots to swiMakeConnection.

5.5 Sending a Pattern

In SwitchPath, CxSendPattern transmits a pattern to an output channel of a given switch. In the CT Access Switching service, swiSendPattern asserts the eight bit pattern on the corresponding output terminus of the switch block for each of the specified output-pattern pairs.

When migrating from SwitchPath to the Switching service, you will need to translate the groups and channels that you pass to CxSendPattern to the underlying streams and timeslots. You pass these streams and timeslots to swiSendPattern.

5.6 Disabling Output

In SwitchPath, CxDisableOutp turns off the output from a switch block to the specific channel. In the CT Access Switching service, swiDisableOutput resets specified switch block outputs to their idle state.

When migrating from SwitchPath to the Switching service, you will need to translate the groups and channels that you pass to CxDisableOutp to the underlying streams and timeslots. You pass these streams and timeslots to swiDisableOutput.

5.7 Sampling Data

In SwitchPath, CxSampleInput returns sample of the data on an input channel. In the CT Access Switching service, the equivalent function is swiSampleInput which reads the data available on one or more inputs of a switch block.

5.8 Supervision Monitoring Functions

SwitchPath provides CxStartSupv, CxStopSupv, and CxWaitSupv functions for supervision monitoring. There are no equivalent functions in the CT Access Switching service. However, you may call the underlying device driver directly using swiCallDriver to do supervision monitoring. Refer to the drpinsrt demonstration program in the CT Access Developer's Reference Manual.

5.9 Tracing

In SwitchPath, CxSetTrace enables and disables tracing. In CT Access, ctaLogTrace can be used by the application to log errors, warnings, or informational messages to the CT Access trace buffer maintained by the CT Access daemon. Tracing is enabled by setting traceflags to CTA_TRACE_ENABLE in ctaInitialize. ctaSetTraceLevel sets the trace mask for a service.

5.10 Error Handling

In SwitchPath, CxSetErrorHandler sets an error handler function. In CT Access, ctaSetErrorHandler defines the action taken when an error is returned from any CT Access functions including API functions of services provided by CT Access.

5.11 Utility Functions

In SwitchPath, CxDriverCommand allows you to access the underlying device driver. The CT Access Switching service provides swiCallDriver which provides you with the same functionality.

Note: If the underlying device driver is MVIP-90, specify arguments to swiCallDriver with MVIP-90 conventions even if the switch handle was opened in MVIP-95 mode. The CT Access Switching service does not translate this. Refer to the CT Access Developer's Reference Manual for more information.

5.12 Table of Function Equivalents

This table lists SwitchPath functions and equivalent CT Access functions.

SwitchPath Function

CT Access Switching Service Function

CxConnect

swiMakeConnection

CxConnectGroup

swiMakeConnection

CxDefineGroup

None.

CxDefineSwitch

swiOpenSwitch

CxDisableOutp

swiDisableOutput

CxDriverCommand

swiCallDriver

CxGetGroupHd

None.

CxGetState

None.

CxGetSwitchHd

None.

CxInitialize

ctaOpenServices

CxLoadConfig

None.

CxPutState

None.

CxResetSwitch

swiResetSwitch

CxSampleInput

swiSampleInput

CxSendPattern

swiSendPattern

CxSetErrorHd

ctaSetErrorHandler

CxSetTrace

ctaLogTrace and ctaSetTraceLevel

CxShowStruct

None.

CxStartSupv

swiCallDriver

CxStopSupv

swiCallDriver

CxTerminate

swiCloseSwitch

CxWaitSupv

swiCallDriver



(Page 1 of 1 in this chapter)


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