gc_GetXmitSlot( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_GetXmitSlot( ) function retrieves the network CT Bus time slot number of the specified device's channel. The CT Bus time slot information is returned in the SC_TSINFO structure, which includes the number of the network CT Bus time slot connected to the device's transmit channel.
linedev Global Call line device handle sctsinfop points to the SC_TSINFO CT Bus time slot information structure. See SC_TSINFO for more information. Termination Events
Cautions
For voice resources, the routing function for the corresponding library must be called, for example, dx_getxmitslot( ), dx_listen( ), and dx_unlisten( ).
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> #include <gcisdn.h> #define MAX_CHAN 30 /* max. number of channels in system */ /* * Data structure which stores all information for each line */ static struct linebag { LINEDEV ldev; /* GlobalCall API line device handle */ CRN crn; /* GlobalCall API call handle */ int blocked; /* channel blocked/unblocked */ int networkh; /* network handle */ } port[MAX_CHAN+1]; struct linebag *pline; /* pointer to access line device */ /* * Assume the following has been done: * 1. Opened line devices for each time slot on DTIB1. * 2. Each line device and voice handle is stored in * linebag structure "port" */ int call_getxmitslot(int port_num) { GC_INFO gc_error_info; /* GlobalCall error information data */ SC_TSINFO sc_tsinfo; /* CTBus timeslot structure */ long scts; /* Find info for this time slot, specified by 'port_num' */ /* (assumes port_num is valid) */ pline = port + port_num; /* Fill in the CTbus time slot information */ sc_tsinfo.sc_numts = 1; sc_tsinfo.sc_tsarrayp = &scts; /* Get CTbus time slot connected to transmit of * digital channel on board ...1 */ if (gc_GetXmitSlot(pline->ldev, &sc_tsinfo) == -1) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetXmitSlot() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", pline->ldev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); return (gc_error_info.gcValue); } return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation