📄 sipxtapiinternal.h
字号:
// // // Copyright (C) 2005-2006 SIPez LLC.// Licensed to SIPfoundry under a Contributor Agreement.// // Copyright (C) 2004-2006 SIPfoundry Inc.// Licensed by SIPfoundry under the LGPL license.// // Copyright (C) 2004-2006 Pingtel Corp.// Licensed to SIPfoundry under a Contributor Agreement.// // $$//////////////////////////////////////////////////////////////////////////////#ifndef _SIPXTAPIINTERNAL_H /* [ */#define _SIPXTAPIINTERNAL_H// SYSTEM INCLUDES// APPLICATION INCLUDES#include "tapi/sipXtapi.h"#include "tapi/SipXMessageObserver.h"#include "net/SipSession.h"#include "net/SipUserAgent.h"#include "net/SipSubscribeClient.h"#include "utl/UtlDefs.h"#include "utl/UtlContainable.h"#include "os/OsRWMutex.h"#include "os/OsReadLock.h"#include "os/OsWriteLock.h"#include "os/OsSysLog.h"#include "os/OsMutex.h"// DEFINES/** sipXtapi can be configured to expire after a certain date *///#define SIPXTAPI_EVAL_EXPIRATION #ifdef SIPXTAPI_EVAL_EXPIRATION# define EVAL_EXPIRE_MONTH 9# define EVAL_EXPIRE_DAY 1# define EVAL_EXPIRE_YEAR 2005#endif// MACROS// EXTERNAL FUNCTIONS// EXTERNAL VARIABLES// CONSTANTS// FORWARD DECLARATIONSclass SipSubscribeServer;class SipSubscribeClient;// STRUCTS// TYPEDEFStypedef struct{ bool bInitialized ; /**< Is the data valid */ bool bMuted ; /**< Muted state (regain gain) */ int iGain ; /**< Gain setting (GAIN_MIN-GAIN_MAX) */ UtlString device; /**< Desired auto device */} MIC_SETTING ;typedef struct{ bool bInitialized ; /**< Is the data valid */ int iVol ; /**< Gain setting (VOLUME_MIN-VOLUME_MAX) */ UtlString device; /**< Desired auto device */} SPEAKER_SETTING ;typedef struct{ bool bInitialized ; /**< Is the data valid */ bool bEnabled ; /**< Is AEC enabled? */} AEC_SETTING ;typedef struct { bool bInitialized; /**< Is the data valid */ int numCodecs; /**< Number of codecs */ SIPX_AUDIO_BANDWIDTH_ID codecPref; /**< Numeric Id of codec preference */ SIPX_AUDIO_BANDWIDTH_ID fallBack; /**< Fallback id if codec setting fails */ UtlString sPreferences; /**< List of preferred codecs */ SdpCodec** sdpCodecArray; /**< Pointer to an array of codecs */} AUDIO_CODEC_PREFERENCES;typedef struct { bool bInitialized; /**< Is the data valid */ int numCodecs; /**< Number of codecs */ SIPX_VIDEO_BANDWIDTH_ID codecPref; /**< Numeric Id of codec preference */ SIPX_VIDEO_BANDWIDTH_ID fallBack; /**< Fallback id if codec setting fails */ UtlString sPreferences; /**< List of preferred codecs */ SdpCodec** sdpCodecArray; /**< Pointer to an array of codecs */} VIDEO_CODEC_PREFERENCES;typedef struct { bool bInitialized; /**< Is the data valid */ bool bEnabled; /**< Is SRTP enabled */ int iCipherType; /**< Cipher type */ int iCipherKeyLen; /**< Cipher key length */ int iAuthType; /**< Authentication type */ int iAuthKeyLen; /**< Authentication key length */ int iAuthTagLen; /**< Tag length */ int iSecurity; /**< Protection level */ UtlString sKey; /**< Key */} SRTP_SETTING;typedef struct{ bool bInitialized; bool tonePlaying;} TONE_STATES;typedef struct{ SipUserAgent* pSipUserAgent ; SdpCodecFactory* pCodecFactory ; CallManager* pCallManager ; SipLineMgr* pLineManager ; SipRefreshMgr* pRefreshManager ; SipSubscribeServer* pSubscribeServer; SipSubscribeClient* pSubscribeClient; MIC_SETTING micSetting ; SPEAKER_SETTING speakerSettings[2] ; AEC_SETTING aecSetting ; SPEAKER_TYPE enabledSpeaker ; AUDIO_CODEC_PREFERENCES audioCodecSetting; VIDEO_CODEC_PREFERENCES videoCodecSetting; TONE_STATES toneStates; char* inputAudioDevices[MAX_AUDIO_DEVICES] ; char* outputAudioDevices[MAX_AUDIO_DEVICES] ; SipXMessageObserver* pMessageObserver; OsNotification *pStunNotification ; /**< Signals the initial stun success/failure when calling sipXconfigEnableStun */ OsMutex* pLock ; int nCalls ; /**< Counter for inprocess calls */ int nConferences ; /**< Counter for inprocess conferences */ int nLines ; /**< Counter for inprocess lines */} SIPX_INSTANCE_DATA ;typedef enum{ SIPX_INTERNAL_CALLSTATE_UNKNOWN, /** Unknown call state */ SIPX_INTERNAL_CALLSTATE_OUTBOUND_IDLE, /** Created call not connecting yet */ SIPX_INTERNAL_CALLSTATE_OUTBOUND_ATTEMPT, /** Early dialog: outbound */ SIPX_INTERNAL_CALLSTATE_INBOUND_ATEMPT, /** Early dialog: inbound */ SIPX_INTERNAL_CALLSTATE_CONNECTED, /** Active call - remote audio */ SIPX_INTERNAL_CALLSTATE_HELD, /** Remotely held call */ SIPX_INTERNAL_CALLSTATE_BRIDGED, /** Locally held call */ SIPX_INTERNAL_CALLSTATE_DISCONNECTED, /** Disconnected or failed */} SIPX_INTERNAL_CALLSTATE ;typedef struct{ UtlString* callId; UtlString* sessionCallId; UtlString* ghostCallId; UtlString* remoteAddress ; UtlString* lineURI ; SIPX_LINE hLine ; SIPX_INSTANCE_DATA* pInst ; OsRWMutex* pMutex ; SIPX_CONF hConf ; SIPX_VIDEO_DISPLAY display; UtlBoolean bRemoveInsteadOfDrop ; /** Remove the call instead of dropping it -- this is used as part of consultative transfer when we are the transfer target and need to replace a call leg within the same CpPeerCall. */ SIPX_CALLSTATE_EVENT lastCallstateEvent ; SIPX_CALLSTATE_CAUSE lastCallstateCause ; SIPX_INTERNAL_CALLSTATE state ; UtlBoolean bInFocus ;} SIPX_CALL_DATA ;typedef enum CONF_HOLD_STATE{ CONF_STATE_UNHELD = 0, CONF_STATE_BRIDGING_HOLD, CONF_STATE_NON_BRIDGING_HOLD,} CONF_HOLD_STATE;typedef struct{ UtlString* strCallId ; SIPX_INSTANCE_DATA* pInst ; size_t nCalls ; SIPX_CALL hCalls[CONF_MAX_CONNECTIONS] ; CONF_HOLD_STATE confHoldState; OsRWMutex* pMutex ;} SIPX_CONF_DATA ;typedef struct{ Url* lineURI ; SIPX_INSTANCE_DATA* pInst ; OsRWMutex* pMutex ; SIPX_CONTACT_TYPE contactType ; UtlSList* pLineAliases ;} SIPX_LINE_DATA ;typedef struct{ SIPX_INFO_INFO infoData; SIPX_INSTANCE_DATA* pInst; SipSession* pSession; OsRWMutex* pMutex;} SIPX_INFO_DATA;typedef struct{ SIPX_INSTANCE_DATA* pInst; UtlString* pResourceId; UtlString* pEventType; HttpBody* pContent;} SIPX_PUBLISH_DATA;typedef struct{ SIPX_INSTANCE_DATA* pInst; UtlString* pDialogHandle;} SIPX_SUBSCRIPTION_DATA;/** * internal sipXtapi structure that binds a * an event callback proc * with an instance pointer and user data */typedef struct{ SIPX_EVENT_CALLBACK_PROC pCallbackProc; void* pUserData; SIPX_INSTANCE_DATA* pInst;} EVENT_LISTENER_DATA;/** * internal sipXtapi structure that binds a * an call callback proc * with an instance pointer and user data */typedef struct { CALLBACKPROC pCallbackProc ; void* pUserData ; SIPX_INSTANCE_DATA* pInst ;} CALL_LISTENER_DATA ;/** * internal sipXtapi structure that binds a * an line callback proc * with an instance pointer and user data */typedef struct{ LINECALLBACKPROC pCallbackProc; void* pUserData; SIPX_INSTANCE_DATA* pInst;} LINE_LISTENER_DATA;typedef enum SIPX_LOCK_TYPE{ SIPX_LOCK_NONE, SIPX_LOCK_READ, SIPX_LOCK_WRITE} SIPX_LOCK_TYPE ;/* ============================ FUNCTION POINTER DEFINITIONS =============== */typedef void (*sipxCallEventCallbackFn)(const void* pSrc, const char* szCallId, SipSession* pSession, const char* szRemoteAddress, SIPX_CALLSTATE_MAJOR eMajorState, SIPX_CALLSTATE_MINOR eMinorState, void* pEventData, const char* assertedIdentity);typedef void (*sipxLineEventCallbackFn)(const void* pSrc, const char* szLineIdentifier, SIPX_LINE_EVENT_TYPE_MAJOR major, SIPX_LINE_EVENT_TYPE_MINOR minor, const char *bodyBytes ); typedef void (*sipxEventCallbackFn)(const void* pSrc, SIPX_EVENT_CATEGORY category, void* pInfo); /* ============================ FUNCTIONS ================================= *//** * Fire events to interested listeners (call events only). */void sipxFireCallEvent(const void* pSrc, const char* szCallId, SipSession* pSession,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -