Table of Contents Index NMS Glossary Previous Page Next Page Version


Appendix B

Switching Application Example


Introduction
Scenario
Hardware
The Sample Program

IntroductionTop of Page

This appendix provides an example of using the CT Access Switching service to develop a Call Center application.

ScenarioTop of Page

There are 24 incoming lines with 24 analog operator stations, as illustrated in Figure 6.

Note: A real application would have more incoming lines than operators.
appb0.gif

Figure 6. Call Center Example


This program:

  1. Accepts a call on an incoming T1 line.

    
    
  2. Plays a "please hold" message, and sends silence to the caller.

    
    Note: A real application may do some preparatory work such as database
    look-up, etc. before transferring a call to an operator.
  3. Plays a "you have a call......" message to the operator (this assumes that the operator is already listening).

    
    
  4. Connects the voice paths of the incoming line and an operator station.

    
    
  5. Monitors the incoming line for hang-up.

    
    
  6. Breaks down both ends of the call when either end hangs up.

    
    
  7. Goes back to Step 1.

HardwareTop of Page

For purposes of this example, the hardware is:

The Sample ProgramTop of Page

Figure 7 illustrates the initial state of the switch blocks in the system when there are no connections. Stream connections and only timeslot 0 are shown.
appb1.gif

Figure 7. Initial State of the Switches


* Only trunk one is shown.

  1. Open the switching device and get the switch handle for the AG 4000 board and the CX 2000 board. This example assumes that the switches are open in MVIP-95 mode, and that their states will be restored on exit.

    void myInitialize(CTAHD ctahd, SWIHD *t1hd, SWIHD *cxhd)
    {
    SWI_TERMINUS inputs[24], outputs[24];
    unsigned count;

    /* Open a switch handle to the AG 4000 board */
    swiOpenSwitch(ctahd, "AGSW", 0, SWI_ENABLE_RESTORE, t1hd);

    /* Open a switch handle to the CX 2000 board */
    swiOpenSwitch(ctahd, "CXSW", 0, SWI_ENABLE_RESTORE, cxhd);

    /* Connect the DSPs to the line interfaces on the AG 4000: */

    /* Connect the voice streams: */
    /* Connect network XMIT to DSP RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 0;
    inputs[count].timeslot = (DWORD)count;

    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 17;
    outputs[count].timeslot = (DWORD)count;
    }
    /* Make output address(es) read from input address(es) */
    swiMakeConnection(*t1hd, inputs, outputs, count);

    /* Connect DSP XMIT to network RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 16;
    inputs[count].timeslot = (DWORD)count;

    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 1;
    outputs[count].timeslot = (DWORD)count;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);

    /* Connect the signaling streams: */
    /* Connect network XMIT to DSP RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 2;
    inputs[count].timeslot = (DWORD)count;


    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 19;
    outputs[count].timeslot = (DWORD)count;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);

    /* Connect DSP XMIT to network RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 18;
    inputs[count].timeslot = (DWORD)count;

    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 3;
    outputs[count].timeslot = (DWORD)count;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);
    }
    /* Connect the DSPs to the line interfaces on the CX 2000 (signaling only)*/
    /* Connect the signaling streams: */
    /* Connect network XMIT to DSP RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 2;
    inputs[count].timeslot = (DWORD)count;

    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 7;
    outputs[count].timeslot = (DWORD)count;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);

    /* Connect DSP XMIT to network RCV */
    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 6;
    inputs[count].timeslot = (DWORD)count;

    outputs[count].bus = MVIP95_LOCAL_BUS;
    outputs[count].stream = 3;
    outputs[count].timeslot = (DWORD)count;
    }
    1. Using switching, nail up the CX 2000 lines to the MVIP bus on streams 0 and 1.

      /* Nails up CX 2000 lines to the MVIP bus */
      void myConnectAgCx(SWIHD cxhd)
      {
      SWI_TERMINUS outputs[24], inputs[24];
      unsigned count;

      /* Connect Voice lines: */

      /* Connect CX2000 local:0:0..23 to mvip:1:0..23 */
      for (count = 0; count < 24; count++)
      {
      inputs[count].bus = MVIP95_LOCAL_BUS;
      inputs[count].stream = 0;
      inputs[count].timeslot = (DWORD)count;

      outputs[count].bus = MVIP95_MVIP_BUS;
      outputs[count].stream = 1;
      outputs[count].timeslot = (DWORD)count;
      }
      swiMakeConnection(cxhd, inputs, outputs, count);

      /* Connect CX2000 mvip:0:0..23 to local:1:0..23 */
      for (count = 0; count < 24; count++)
      {
      inputs[count].bus = MVIP95_MVIP_BUS;
      inputs[count].stream = 0;
      inputs[count].timeslot = (DWORD)count;

      outputs[count].bus = MVIP95_LOCAL_BUS;
      outputs[count].stream = 1;
      outputs[count].timeslot = (DWORD)count;
      }
      swiMakeConnection(cxhd, inputs, outputs, count);
      }
Figure 8 illustrates the state of the switches in the system:
appb2.gif

Figure 8. State of the Switches


The program returns to this state after each call.
  • Wait for incoming calls on the incoming lines (using the NCC service).

    
    
  • When a call comes in, use the NCC service to perform call control. Once the T1 call is connected, play "please hold" (using the Voice Message service) and then send a silence pattern to the incoming line using the Switching service.

    /* Send Silence to incoming T1 call */
    void mySendSilence(SWIHD t1hd, DWORD timeslot)
    {
    SWI_TERMINUS output;
    BYTE pattern = 0x7F; /* Silence pattern for MU-law */

    /* Send silence pattern to incoming call via local:1:timeslot */
    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 1;
    output.timeslot = timeslot;
    swiSendPattern(t1hd, &pattern, &output, 1);
    }
  • Notify the operator of the incoming call (using the Voice Message service). Before doing this, connect the DSP port assigned to the incoming call to the CX 2000 operator station (this assumes the battery and the bit detector are enabled on the CX 2000 ports).

    /* Connect T1 DSP to CX 2000 station, DUPLEX connection via the CT bus,
    * in preparation for playing the "here comes a call" message.
    */
    void myConnect4KCx(SWIHD t1hd, DWORD timeslot)
    {
    SWI_TERMINUS output, input;

    /* Connect AG4000 T1 local:16:timeslot to mvip:0:timeslot */
    input.bus = MVIP95_LOCAL_BUS;
    input.stream = 16;
    input.timeslot = timeslot;

    output.bus = MVIP95_MVIP_BUS;
    output.stream = 0;
    output.timeslot = timeslot;
    swiMakeConnection(t1hd, &input, &output, 1);

    /* Connect AG4000 T1 mvip:1:timeslot to local:17:timeslot */
    input.bus = MVIP95_MVIP_BUS;
    input.stream = 1;
    input.timeslot = timeslot;

    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 17;
    output.timeslot = timeslot;
    swiMakeConnection(t1hd, &input, &output, 1);
    }
    Figure 9 illustrates the state of the switches in the system:
    appb3.gif

    Figure 9. State of the Switches

  • Connect the voice paths of the AG 4000 T1 line and the CX 2000 operator station so that the caller and the operator can carry on a conversation. To do this, connect the AG 4000 board's voice streams to the CX 2000 board's operator voice streams.

    /* Connect Voice paths of CX 2000 station and 
    * the incoming call, DUPLEX connection.
    */
    void myConnectVoice(SWIHD t1hd, DWORD timeslot)
    {
    SWI_TERMINUS output, input;

    /* Connect AG 4000 T1 local:0:timeslot to mvip:0:timeslot */
    input.bus = MVIP95_LOCAL_BUS;
    input.stream = 0;
    input.timeslot = timeslot;

    output.bus = MVIP95_MVIP_BUS;
    output.stream = 0;
    output.timeslot = timeslot;

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

    /* Connect AG 4000 T1 mvip:1:timeslot to local:1:timeslot */
    input.bus = MVIP95_MVIP_BUS;
    input.stream = 1;
    input.timeslot = timeslot;

    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 1;
    output.timeslot = timeslot;

    swiMakeConnection(t1hd, &input, &output, 1);
    }
    Figure 10 illustrates the state of the switches in the system:
    appb4.gif

    Figure 10. State of the Switches

  • If either end hangs up, disconnect the call using the NCC service. Reconnect the AG 4000 board's DSP streams to the AG 4000 board's line interface streams.

    /* Reset paths to get ready for next incoming call.
    */
    void myResetT1Line(SWIHD t1hd, DWORD timeslot)
    {
    SWI_TERMINUS output, input;

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

    /* Reconnect voice streams */
    input.bus = MVIP95_LOCAL_BUS;
    input.stream = 0;
    input.timeslot = timeslot;

    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 17;
    output.timeslot = timeslot;

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

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

    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 1;
    output.timeslot = timeslot;

    swiMakeConnection(t1hd, &input, &output, 1);
    This returns the application to the initial state illustrated in Figure 8.

    1. At the end of the program, call swiCloseSwitch to close all the switches and restore the state of the switch blocks.

      /* Close open switches */
      void myShutdown(SWIHD t1hd, SWIHD cxhd)
      {
      swiCloseSwitch(t1hd);
      swiCloseSwitch(cxhd);
      }



  • 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.