The connection ID is a handle to a call on a B channel. It is used to identify the call in all communications between the ACU and the application. When an incoming call arrives, the protocol stack assigns it a connection ID. When the application places a call, it assigns a connection ID to the call. When a call is disconnected, the connection ID is freed. The ID can then be assigned to a new call by the protocol stack or the application.
A different set of connection IDs is available for each D channel. Thus a call is identified both by its D channel context and by its connection ID.
The range of connection IDs available for a trunk is between 0 and ACU_MX_CALLS (defined in isdnacu.h). In an NFAS group containing multiple trunks, there are ACU_MX_CALLS connection IDs for each NAI. The connection ID and NAI together identify a particular call.
The connection ID assigned to an incoming call by the protocol stack is the highest available unused value. For example, if 60 connection IDs are available for a trunk, and connection IDs 59 and 58 are already allocated to calls, the protocol stack assigns ID 57 to the next call.
To reduce the chance of collision, assign connection IDs beginning with 0 when placing outgoing calls. The application must also keep track of which connection IDs are in use and which are available.