📄 isdn.h
字号:
| Structure containing statistics about a specific trunk resource
*/
typedef struct _TB640_ISDN_TRUNK_RESOURCE_STATS
{
TB640_ISDN_TRUNK_RESOURCE_STATE State;
TBX_UINT32 un32LastIdleTimestamp;
} TB640_ISDN_TRUNK_RESOURCE_STATS, *PTB640_ISDN_TRUNK_RESOURCE_STATS;
/*
| Structure containing information about a specific Ctbus resource
*/
typedef struct _TB640_ISDN_CTBUS_INFO
{
/* Stream resource information */
TBX_UINT8 un8Trunk;
TBX_UINT8 un8Timeslot;
TB640_RESOURCE_HANDLE hCtbusResource;
TBX_UINT8 un8CtbusStream;
TBX_UINT8 un8CtbusTimeslot;
} TB640_ISDN_CTBUS_INFO, *PTB640_ISDN_CTBUS_INFO;
/*
| Structure containing information about a specific trunk resource
*/
typedef struct _TB640_ISDN_TRUNK_RESOURCE_INFO
{
/* Information about the trunk resource itself */
TBX_UINT8 un8Trunk;
TBX_UINT8 un8Timeslot;
TB640_RESOURCE_HANDLE hTrunkResource;
TB640_ISDN_BCHANNEL_STATUS BChannelStatus;
TB640_CALL_HANDLE hCall;
TB640_CONNECTION_HANDLE hConnection; /* Only used when destroying the app */
TB640_ISDN_TRUNK_RESOURCE_STATS Statistics;
TBX_UINT32 un32HistoryReadIdx;
TBX_UINT32 un32HistoryWriteIdx;
TB640_ISDN_HISTORY_ENTRY aHistoryEntry [TB640_ISDN_NB_HISTORY_FOR_TIMESLOT];
TB640_ISDN_CTBUS_INFO CtbusInfo;
} TB640_ISDN_TRUNK_RESOURCE_INFO, *PTB640_ISDN_TRUNK_RESOURCE_INFO;
/*
| Structure containing information about a specific call
*/
typedef struct _TB640_ISDN_CALL_CFG
{
TBX_CHAR szCallingPhoneNb[TB640_ISDN_OUTBAND_CALLING_ADDRESS_MAX_LENGTH];
TBX_CHAR szCalledPhoneNb[TB640_ISDN_OUTBAND_CALLED_ADDRESS_MAX_LENGTH];
TBX_CHAR szRedirectingPhoneNb[TB640_ISDN_REDIRECTING_ADDRESS_MAX_LENGTH];
} TB640_ISDN_CALL_CFG, *PTB640_ISDN_CALL_CFG;
/*
| Structure containing information about a specific trunk
*/
typedef struct _TB640_ISDN_TRUNK_INFO
{
/* Information about the trunk itself */
TBX_UINT8 un8Trunk;
TB640_TRUNK_HANDLE hTrunk;
TBX_BOOL fActivated;
TBX_BOOL fIncludedInStressTesting;
TB640_TRUNK_CFG TrunkConfiguration;
TBX_UINT32 un32OpLibIdx;
TBX_UINT32 un32NbTrunkResource;
TB640_ISDN_TRUNK_RESOURCE_INFO aResourceInfo [TB640_ISDN_MAX_TIMESLOT_IN_TRUNK];
/* Information about the stack connected to the trunk */
TB640_ISDN_HANDLE hStack;
TB640_ISDN_CFG StackConfiguration;
TBX_BOOL fStackAvailable;
TBX_UINT32 un32NbCallOpeningFailure;
TBX_UINT32 un32NbTimeoutOccured;
/* Information about the calls made on the trunk */
TB640_ISDN_CALL_CFG CallConfiguration;
} TB640_ISDN_TRUNK_INFO, *PTB640_ISDN_TRUNK_INFO;
/*
| Structure containing information about a specific adapter
*/
typedef struct _TB640_ISDN_ADAPTER_INFO
{
TBX_CHAR szAdapterName [TB640_ISDN_MAX_ADAPTER_NAME_LENGTH];
TBX_ADAPTER_HANDLE hAdapter;
TBX_ADAPTER_INFO AdapterInfo;
TBX_UINT32 aun32FeatureEnabled [TBX_FEATURE_TYPE_LAST];
/* State of the adapter */
TBX_SEM AdapterSem;
TBX_BOOL fAttached;
volatile TBX_BOOL fSynced;
TBX_UINT32 un32NbSyncReceived;
TBX_SEM AttachOrDetachOpDoneSem;
/* Operation library information */
TBX_UINT32 un32NbOperationLib;
TBX_ASYNC_LIB_HANDLE ahOperationLib [TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
TBX_UINT64 aun64UniqueId [TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
struct
{
TBX_SEM aOperationLibSem[TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
PTBX_CHAR apszOperationLibSemFile[TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
TBX_UINT32 aun32OperationLibSemLine[TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
TBX_UINT32 aun32OperationLibSemProcess[TB640_ISDN_NB_OPERATION_LIBRARY_REQUIRED];
} Lock;
/* Counter to see if there are any transient calls at a specific time */
TBX_SEM TransientCallsSem;
volatile TBX_UINT32 un32TransientCalls;
/* Trunk and trunk resource information */
TBX_UINT32 un32NbTrunk;
TB640_ISDN_TRUNK_INFO aTrunkInfo [TB640_ISDN_MAX_SUPPORTED_TRUNKS_PER_ADAPTER];
/* Hash table for quick reverse lookups of handle->trunk nb, timeslot nb, etc. */
TBX_HASH_HANDLE hStackHash;
TBX_HASH_HANDLE hCtBusHash;
TBX_HASH_HANDLE hTrunkHash;
TBX_HASH_HANDLE hTrunkResHash;
TBX_UINT32 un32AdapterCpu0Usage;
TBX_UINT32 un32AdapterCpu1Usage;
} TB640_ISDN_ADAPTER_INFO, *PTB640_ISDN_ADAPTER_INFO;
/*
| Structure containing all information required by the overall application
*/
typedef struct _TB640_ISDN_CONTEXT
{
/* TBX library information */
FILE * pFileStdErr;
TBX_LIB_HANDLE hTbxLib;
/* Logging facilities */
TBX_SEM DisplaySem;
FILE * pLogFile;
TBX_CHAR szFilename [128];
TBX_UINT32 un32LogNumber;
TBX_UINT32 un32FileLogLevel;
TBX_UINT32 un32DisplayLogLevel;
/* Application global flags */
TBX_BOOL fAnswerCallsManually;
TBX_UINT32 un32MinRefreshDelayMsec;
TBX_UINT32 un32GatewayPortNumber;
TBX_UINT32 aun32GatewayPort[TBX_API_MAX_EXTRA_GW_PORTS];
TBX_BOOL fCTBusConnection;
TBX_BOOL fDoConnection;
TBX_BOOL fDisplayBChannelStates;
/* Application unique ID (to be able to recover the event if the app. crashed */
TBX_UINT64 un64AppUniqueId;
/* Adapter resource information */
TBX_UINT32 un32NbAdapter;
TB640_ISDN_ADAPTER_INFO ahAdapterInfo [TB640_ISDN_MAX_SUPPORTED_ADAPTERS];
} TB640_ISDN_CONTEXT, *PTB640_ISDN_CONTEXT;
/*
| Structure containing all information for a call
*/
typedef struct _TB640_ISDN_CALL_CONTEXT
{
/* Information on parent */
PTBX_ASYNC_OP_CONTEXT pOpContext;
TBX_BOOL fSpuriousCallContext;
/* State of this call (used by the framework) */
TB640_ISDN_CALL_APP_STATE State;
TB640_ISDN_CALL_APP_SUB_STATE SubState;
TB640_CALL_HANDLE hCall;
/* State of this call (used by the application) */
TBX_BOOL fCallValid;
TBX_BOOL fIsdnDisconnected;
TBX_BOOL fIsdnNeedToDisconnect;
TBX_BOOL fWaitForDisconnection;
TBX_BOOL fConnected;
TBX_BOOL fCallOriginator;
TBX_BOOL fReceivedCallConnected;
TBX_BOOL fReceivedConnectConfirm;
TBX_BOOL fCallSuccessful;
TBX_BOOL fTimeoutOccured;
TBX_BOOL fResetChannelOccured;
TBX_BOOL fNeedToRestart;
TBX_BOOL fManualMode;
TBX_INT nCreateRspExpected;
TBX_INT nDestroyRspExpected;
TBX_INT nRestartCount;
TBX_INT nDigitReceived;
TB640_CONNECTION_HANDLE hConnection;
TBX_UINT32 un32MinCallDuration;
TBX_UINT32 un32MaxCallDuration;
/* Overlap mode */
TBX_INT nNbExpectedDigit;
TBX_UINT8 un8NewDigitsSize;
TBX_UINT8 aun8NewDigits [ TB640_ISDN_MAX_NB_DIGIT_IN_NUMBERS ];
/* Debuging stuff */
TBX_UINT32 un32Debug;
/* Adapter/Trunk/timeslot information */
TBX_UINT32 un32AdapterIndex;
TB640_RESOURCE_HANDLE hTrunkResource;
TBX_UINT32 un32TrunkIndex;
TBX_UINT32 un32TimeslotIndex;
/* Call information */
TBX_UINT8 aun8OutbandCalledAddress[ TB640_ISDN_OUTBAND_CALLED_ADDRESS_MAX_LENGTH ];
TBX_UINT8 aun8OutbandCallingAddress[ TB640_ISDN_OUTBAND_CALLING_ADDRESS_MAX_LENGTH ];
TBX_UINT8 aun8Redirecting[ TB640_ISDN_REDIRECTING_ADDRESS_MAX_LENGTH ];
TBX_UINT8 aun8Cause[2];
TBX_UINT8 aun8DigitReceived [TB640_ISDN_MAX_NB_DIGIT_IN_NUMBERS];
/* Call history */
TBX_UINT32 un32HistoryReadIdx;
TBX_UINT32 un32HistoryWriteIdx;
TB640_ISDN_HISTORY_ENTRY aHistoryEntry [TB640_ISDN_NB_HISTORY_FOR_CALL];
} TB640_ISDN_CALL_CONTEXT, *PTB640_ISDN_CALL_CONTEXT;
/*--------------------------------------------------------------------------------------------------------------------------------
| Global variables
*------------------------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------
| Macros
*------------------------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------
| Function Prototypes
*------------------------------------------------------------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------------------------------------------------------------
| C++ support
*------------------------------------------------------------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __ISDN_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -