Synopsis:
handle=CCgetslot(port,channel)
Arguments:
port – The logical E1/T1 port number.
channel – The channel number.
Description: This function returns a handle to the external H.100 or SCBUS transmit timeslot for the port and channel. The timeslot handle references the transmit timeslot of the given port and channel which has been ‘nailed’ to a H.100 or SCBUS timeslot by the library at start-up. This only applies to boards that have switching capabilities and not to the PROSODY_S type virtual boards which do not have any external switching capability.
The returned handle is actually obtained from the physical H.100 or SCBUS stream and timeslot from the following formula:
handle = stream * 4096 + timeslot
For the SCbus the stream is always 24 which is the internal fixed stream that is used by the ACULAB firmware when SCBUS is present.
For example, if a board has four E1 ports and is fitted with a H.100 bus then upon startup the CACULAB.DLL library will automatically ‘nail’ the transmit timeslots from the E1 ports to the H.100 bus starting at stream 0, timeslot 0 (or as defined by the ACUCC_TSOFFS environment variable) . Since each H.100 stream can have 128 timeslots then all four E1 ports will be nailed to the timeslots of stream 0 on the H.100 bus (with appropriate gaps wherever there are signalling channels on the ports).
From the formula shown above, the handles returned by the CCgetslot() function would range from 0 though to 127 for the channels on these four ports.
If there was a second board present in the system with another four E1 ports then these channels would be nailed to stream 1 of the H.100 bus and the handles returned by CCgetslot() for the channels on these four ports would range from 4096 to 4223.
The external bus handle returned by CCgetslot() can be used in the CClisten() function to allow the ‘receive’ timeslot of one channel to ‘listen’ to the ‘transmit’ timeslot from another channel via the external H.100 or SCBUS.
For example, if there was an inbound call on E1 port 0, channel 1 and an outbound call on E1 port 1, channel 12 then these two conversations could be connected together with the following calls:
CClisten(0,1,CCgetslot(1,12));
CClisten(1,12,CCgetslot(0,1));
Returns: This function returns the logical timeslot handle for the given port and channel or a negative error code.