Version


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

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

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

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

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