(Page 3 of 18 in this chapter)


2.2 Managing Ports, Contexts and Protocols

The AG driver gives the application access to any AG board in the system. Applications must always open a driver (using adiOpenDriver), and then may open one or more ports (adiOpenPort). A port is the object on which telephony functions are performed, and it contains physical and logical resources on the AG board. A port is represented by a context and a context handle (ctahd), a software handle that enables the application to keep track of software activities. This manual refers to ports and contexts almost interchangeably, but keep in mind that the term port connotes an object, typically connected to a telephony network and used to process calls, and the term context refers to a software handle.

In order to access most functionality on a port, the application must associate a telephony protocol with the port using adiStartProtocol. The telephony protocol is embodied by a Trunk Control Program (TCP), and must be loaded by agmon during board initialization. TCPs exist for most standard telephone line interfaces. See the AG Access Installation Manual for details about agmon.

Starting a protocol enables the use of call control functions. Almost all AG Access functions require a protocol to be started and running. For applications that do not use call control functions, or choose to manage the line interface manually, a special TCP is provided called "NOCC" for "no call control."

The following AG Access functions manage ports and protocols:

To...

Use...

Gain access to all AG boards with one driver handle

adiOpenDriver

Close an open driver

adiCloseDriver

Retrieve an event from the AG driver and processes it

adiFetchAndProcess

Allocate an AG Access port

adiOpenPort

Halt and deallocate a port

adiClosePort

Load a Trunk Control Program (TCP) and enable the use of functions requiring AG DSP resources

adiStartProtocol

Halt the port's TCP, terminating functions on the port, and unload the TCP.

adiStopProtocol



(Page 3 of 18 in this chapter)


Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights reserved.