(Page 2 of 2 in this chapter)


Introduction

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

Scenario

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

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

Figure 16. Call Center Example


This program:

  1. Accepts a call on an incoming analog 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.

Hardware

For purposes of this example, the hardware is:

1 AG-T1 (24 digital line interfaces and 24 DSP ports, 1 for each incoming line).

1 AG S-Connect with 24 analog operator station hybrids.

Note: A real call center application may use different hardware configurations.

Program

Figure 17 illustrates the initial state of the MVIP switches in the system when there are no connections. Stream connections and only timeslot 0 are shown.

Figure 17. Initial State of the MVIP Switches

  • Open the switching device and get the switch handle for the AG-T1 board and the S-Connect 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-T1 board */
    swiOpenSwitch(ctahd, "AGSW", 0, SWI_ENABLE_RESTORE, t1hd);

    /* Open a switch handle to the AG S-Connect board */
    swiOpenSwitch(ctahd, "AGCXSW", 0, SWI_ENABLE_RESTORE, cxhd);

    /* Connect the DSPs to the line interfaces on the AG-T1: */

    /* Connect the voice streams: */
    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 = 5;
    outputs[count].timeslot = (DWORD)count;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);

    for (count = 0; count < 24; count++)
    {
    inputs[count].bus = MVIP95_LOCAL_BUS;
    inputs[count].stream = 4;
    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: */
    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);

    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;
    }
    swiMakeConnection(*t1hd, inputs, outputs, count);
    }

  • Using switching, nail up the S-Connect lines to the MVIP bus on streams 0 and 1.

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

    /* Connect Voice lines: */

    /* Connect AGCX local:0:0..7 to mvip:1:0..7 */
    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 AGCX mvip:0:0..7 to local:1:0..7 */
    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);
    }

  • Provide battery to the S-Connect analog operator stations by sending a pattern to them.

    
     /* Provide battery AG SConnect stations */
    void mySendOffhook(SWIHD cxhd)
    {
    SWI_TERMINUS outputs[24];
    BYTE patterns[24];
    unsigned count;

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

    Figure 18 illustrates the state of the MVIP switches in the system.

    Figure 18. State of the MVIP Switches

    
    
    The program returns to this state after each call.

    1. Wait for incoming calls on the incoming lines (using the ADI service).

      
      
    2. When a call comes in, use the ADI service to perform call control. Once the 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 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);
      }

    3. 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 S Connect operator station.

      
       /* Connect DSP to AG SConnect station, DUPLX connection,
      * in preparation for playing the "here comes a call" message.
      */
      void myConnectT1AgCx(SWIHD t1hd, DWORD timeslot)
      {
      SWI_TERMINUS output, input;

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

      input.bus = MVIP95_LOCAL_BUS;
      input.stream = 4;
      input.timeslot = timeslot;
      swiMakeConnection(t1hd, &input, &output, 1);

      /* Connect T1 mvip:1:timeslot to local:5:timeslot */
      output.bus = MVIP95_LOCAL_BUS;
      output.stream = 5;
      output.timeslot = timeslot;

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

    Figure 19 illustrates the state of the MVIP switches in the system.

    Figure 19. State of the MVIP Switches

  • Connect the voice paths of the analog line and an analog operator station so that the caller and the operator can carry on a conversation. To do this, connect the AG-T1 board's incoming call voice streams to the S-Connect board's operator voice streams.

    
     /* Connect Voice paths of AG SConnection station and 
    * the incoming call, DUPLEX connection.
    */
    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);

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

    Figure 20 illustrates the state of the MVIP switches in the system.

    Figure 20. State of the MVIP Switches

  • If either end hangs up, disconnect the call using the ADI service. Reconnect the AG-T1 boards's DSP streams to the AG-T1 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 */
    output.bus = MVIP95_LOCAL_BUS;
    output.stream = 5;
    output.timeslot = timeslot;

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

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

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

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

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

    /* reconnect the signaling streams: */
    input.bus = MVIP95_LOCAL_BUS;
    input.stream = 2;
    input.timeslot = timeslot;

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

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

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

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

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

    This returns the application to the initial state illustrated in Figure 18.
    
    
  • 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);
    }



  • (Page 2 of 2 in this chapter)


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