(Page 1 of 1 in this chapter) Version


Chapter 3

Initializing a BRI Service Application


3.1 Introduction
3.2 Initializing the Application
3.3 Initializing CT Access
3.3.1 Specifying B Channel CTA Contexts
3.4 Starting the ISDN Protocol
3.5 Stopping the ISDN Protocol

3.1 Introduction

This chapter explains how to:

3.2 Initializing the Application

      1. The application initializes CT Access and creates a separate CTA context for each B channel on the trunk that it will interact with. For more information, refer to Section 3.3, Initializing CT Access.

        
        
      2. The application initializes an ISDN protocol stack instance on each
        B channel CTA context, using
        briStartProtocol.

3.3 Initializing CT Access

To begin call control operations, the application initializes CT Access, as follows:

  1. It initializes CT Access services using ctaInitialize. This includes the following services and service managers:
    Service

    Service Manager

    BRI

    BRIMGR

    SWI

    SWIMGR

    ADI

    ADIMGR or QDIMGR

    Optional. Only needed if your application requires media functions.

    
    
  2. It creates one or more event queues, using ctaCreateQueue. Each function call creates a queue and returns a handle. Make sure at least one queue is attached to the BRI service manager.

    
    
  3. It creates one or more contexts, using ctaCreateContext. Each call creates a CTA context and returns a CTA context handle.

    
    
  4. It opens services on the CTA contexts using ctaOpenServices.

For more information about initializing CT Access, refer to the CT Access Developer's Reference Manual.

3.3.1 Specifying B Channel CTA Contexts

Create a separate CTA context for each B channel on each trunk that your application will interact with. To open CTA contexts under CT Access, use ctaCreateContext followed by ctaOpenServices.

In each call to ctaOpenServices, specify for each service, the MVIP address for the CTA context.

For the BRI service, the MVIP address you provide refers to the local streams and timeslots associated to the BRI trunks.

For more information about the BX 2000 switch model, refer to the BX 2000 Installation and Developer's Manual.

When a CTA context is opened on the BRI service, the timeslot specified in the MVIP address structure allows the BRI service to assign the CTA context to a trunk. The timeslot number may vary during the CTA context's existence.

The BRI service only supports the non-exclusive mode for channel assignment. Therefore, when an incoming call arrives on a BRI trunk, the BRI service assigns it to the first idle CTA context opened on this trunk. It does not check the timeslot specified by the application at ctaOpenServices.

When a CTA context calls briPlaceCall, the call is placed on one of the two
B channels of the associated BRI trunk. The application must call briGetCallStatus to retrieve the B channel timeslot assigned by the network for the call, and then route it to the MVIP bus and DSP resources, if needed.

When a call is disconnected, the application must also disconnect the MVIP bus from both the DSP resources (if any) and the BRI trunk.

Note: One or several applications may share the same trunk by opening CTA contexts with the same MVIP address. In this case, in a multi-point configuration, all applications receive a BRIEVN_INCOMING_CALL event if a call arrives on the shared trunk. If all applications accept or answer the call, only one will get the connection and the others will receive a disconnect event due to multi-point access contention.

3.4 Starting the ISDN Protocol

To initialize the ISDN protocol stack instance from within your application, call briStartProtocol. To direct briStartProtocol to initialize a stack instance correctly, set the arguments as follows:
Argument

Setting

protoname

BRI_PROTOCOL

protoparms

NULL

parms

Pointer to a parameter structure to configure the BRI service. If the application needs to change any of the parameters, it should pass the structure name BRI_START_PARMS in this call. For more information about BRI_START_PARMS, refer to Appendix D.

If the application does not need to change parameters, pass NULL to accept the default settings.

The BRIEVN_STARTPROTOCOL_DONE event contains the completion status of the start request. If the ISDN protocol stack instance started successfully, the value field in this event contains CTA_REASON_FINISHED. Otherwise, another reason code appears here.

For more information about briStartProtocol, refer to Chapter 6.

3.5 Stopping the ISDN Protocol

To stop the ISDN protocol, call briStopProtocol from within the application. This function releases all the resources the BRI service allocated for the CTA context.

The BRIEVN_STOP_PROTOCOL event contains the completion status of the stop request. If the protocol stopped successfully, the value field in this event contains CTA_REASON_FINISHED. Otherwise, another reason code appears here.

For more information about briStopProtocol, refer to Chapter 6.



(Page 1 of 1 in this chapter) Version


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