Table of Contents Index NMS Glossary Previous Page Next Page Version


Chapter 5

Establishing MVIP Switching


5.1 Introduction
5.2 Making Connections
5.3 Sending a Pattern
5.4 Disabling Output
5.5 Sampling Data
5.6 Querying Switch Capabilities

5.1 IntroductionTop of Page

The CT Access Switching service provides functions to allow you to control the underlying MVIP switching device. It provides functions for:

Use the switching functions available in the CT Access Switching service as described in the following table:
If you want to...

Then use...

Reset specified switch block outputs to their idle state

swiDisableOutput

Retrieve the state of specified switch block outputs

swiGetOutputState

Query the device driver and return information about the capabilities of the device driver and the switch controlled by it

swiGetSwitchCaps

Connect inputs to outputs

swiMakeConnection

Connect inputs to outputs with identical throughput delay for all connections

swiMakeFramedConnection

Reset the entire switch block to the idle state

swiResetSwitch

Retrieve the current datum values present on specified switch block inputs

swiSampleInput

Assert fixed patterns on specified switch block outputs

swiSendPattern

Refer to Appendix B for an example that uses the switching functions to develop a Call Center application.

5.2 Making ConnectionsTop of Page

The Switching service makes a connection between an input terminus and an output terminus with swiMakeConnection or swiMakeFramedConnection.

swiMakeConnection connects inputs to the switch block to outputs from the switch block. For example, it can be used to connect the voice paths of an incoming digital line and an operator station so that the caller and the operator can carry on a conversation.

swiMakeFramedConnection is identical to swiMakeConnection except that all connections ever made on the same switch device with this function have the same constant throughput delay. swiMakeFramedConnection can be used to make a single high bandwidth connection using multiple timeslots where the data is synchronized across the timeslots.

The operator station voice signals are on local bus streams 0 and 1. It is connected to the MVIP bus on MVIP streams 0 and 1. To connect the voice streams on the incoming digital line to the operator station's voice streams, connect the incoming digital line's voice streams to MVIP bus streams 1 and 0.
chap5a.gif

Figure 5. Switches Making Connections


The following example code connects the incoming digital line's voice streams to the operator station's voice streams over the MVIP bus:

/* Connect voice paths of the station interface and incoming call on the T1 interface */
void myConnectVoice(SWIHD t1hd, DWORD timeslot)
{
SWI_TERMINUS output, input;

/* Connect T1 local:0:timeslot to mvip:0:timeslot */
output.bus = MVIP95_MVIP_BUS;
output.stream = 0;
output.timeslot = timeslot;

input.bus = MVIP95_LOCAL_BUS;
input.stream = 0;
input.timeslot = timeslot;

swiMakeConnection(t1hd, &input, &output, 1);

/*
* Make a DUPLEX connection by also connecting
* mvip:1:timeslot to local:1:timeslot
*/
output.bus = MVIP95_LOCAL_BUS;
output.stream = 1;
output.timeslot = timeslot;

input.bus = MVIP95_MVIP_BUS;
input.stream = 1;
input.timeslot = timeslot;

swiMakeConnection(t1hd, &input, &output, 1);
}

5.3 Sending a PatternTop of Page

swiSendPattern allows you to send a fixed eight-bit pattern to an output terminus of the switch block. It is primarily used for testing and debugging. It also allows access to low-level signaling on boards that do not support protocols.

The following code issues a known pattern to MVIP:3:0..31:

/* Send a test pattern to 32 timeslots on the CT Bus */
void MySendPattern (SWIHD cxhd)
{
SWI_TERMINUS outputs[32];
BYTE patterns[32];
unsigned count;

/* SendPattern out to operator interfaces via local:3:timeslot */
for (count = 0; count < 32; count++)
{
outputs[count].bus = MVIP95_MVIP_BUS;
outputs[count].stream = 3;
outputs[count].timeslot = (DWORD)count;
patterns[count] = SWI_A_BIT_ON;
}
swiSendPattern(cxhd, patterns, outputs, count);
}

5.4 Disabling OutputTop of Page

If an input terminus is connected to an output terminus, or if there is a pattern being sent out of the output terminus, swiDisableOutput breaks the connection or stops sending the pattern.

For example, to break the connection from the incoming digital line's voice streams to the operator station's voice streams through the MVIP bus, you would disable the outputs from the incoming digital line's switch block.

Caution:

It is important to disable an output when the connection or pattern is no longer required. Leftover connections or patterns can cause unpredictable behavior in the application.

The following code shows how to break the connection:

void myReconfigureT1Line(SWIHD t1hd, DWORD timeslot)
{
SWI_TERMINUS output;

/* Disable outputs of switch to mvip:0:timeslot */
output.bus = MVIP95_MVIP_BUS;
output.stream = 0;
output.timeslot = timeslot;

swiDisableOutput(t1hd, &output, 1);

/* Disable outputs of switch to local:1:timeslot */
output.bus = MVIP95_LOCAL_BUS;
output.stream = 1;
output.timeslot = timeslot;

swiDisableOutput(t1hd, &output, 1);
}

5.5 Sampling DataTop of Page

To determine what data is present on a switch block input terminus, use swiSampleInput.

For example, to read the bits on an incoming analog line, you would sample the data on the incoming line's timeslot.

The following example code reads the bits on a specified timeslot:

void myPrintInput(SWIHD hd, DWORD bus, DWORD stream, DWORD timeslot)
{
BYTE data;
SWI_TERMINUS input;

input.bus = bus;
input.stream = stream;
input.timeslot = timeslot;

swiSampleInput(hd, &input, &data, 1);

switch (input.bus)
{
case MVIP95_MVIP_BUS:
printf(" %s", " mvip");
break;
case MVIP95_LOCAL_BUS:
printf(" %s", "local");
break;

printf(":%2d:%02d=%02X\n", input.stream, input.timeslot, data);
}

5.6 Querying Switch CapabilitiesTop of Page

To query the device driver and return information about the capabilities of the device driver and the switch block, use swiGetSwitchCaps. The following example code queries the capabilities of the device driver and the switch controlled by it:

void myPrintSwitchCaps(SWIHD hd)
{
SWI_SWITCHCAPS_ARGS cp;
SWI_LOCALDEV_DESC *localdevs;
swiGetSwitchCaps(hd, &cp, NULL, 0);
localdevs = (SWI_LOCALDEV_DESC *)malloc(
sizeof(SWI_LOCALDEV_DESC)*cp.numlocalstreams);

swiGetSwitchCaps(hd, &cp, localdevs, cp.numlocalstreams);

printf("Driver Software Std. %s Rev. %2.f\n",
((cp.swstandard == MVIP95_STANDARD_MVIP95)? "MVIP-95" :
"MVIP-90"),
(float)cp.swstdrevision/100.0);

printf("Hardware Std. %s Rev. %2.f.\n",
((cp.hwstandard == MVIP95_STANDARD_HMVIP)? "HMVIP" :
"MVIP-90"),
(float)cp.hwstdrevision/100.0);
printf("Driver Rev. %.2f\n", (float)cp.dvrrevision/100.0);
printf(" Domain %04X, Routing %04X, Blocking %04X.\n",
cp.domain, cp.routing, cp.blocking );

if( cp.numlocalstreams > 0 )
{
DWORD i;

printf("Supports %d local streams:\n\t",
cp.numlocalstreams );
for( i=0; i<cp.numlocalstreams; i++ )
printf( "%2d ", i+16 );
printf("with\n\t");
for( i=0; i<cp.numlocalstreams; i++ )
printf( "%2d ", localdevs[i].timeslots );
printf("timeslots respectively.\n");
}
free(localdevs);
}



Table of Contents Index NMS Glossary Previous Page Next Page Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.