⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmintr.h

📁 基于h323协议的软phone
💻 H
字号:
/*
***********************************************************************************

NOTICE:
This document contains information that is proprietary to RADVISION LTD..
No part of this publication may be reproduced in any form whatsoever without
written prior approval by RADVISION LTD..

RADVISION LTD. reserves the right to revise this publication and make changes
without obligation to notify any person of such revisions or changes.

***********************************************************************************
*/


#ifndef _CMINTERNAL_H
#define _CMINTERNAL_H

#include "rvinternal.h"
#include "rvlock.h"
#include "rvmutex.h"
#include "rvrandomgenerator.h"
#include "psyntree.h"
#include "pvaltree.h"
#include "cm.h"
#include "cmcallcid.h"
#include "rvh323timer.h"
#include "rvh323connection.h"
#include "cat.h"
#include "ra.h"
#include "ema.h"
#include "tpkt.h"
#include "transport.h"
#include "cmiras.h"
#include "cmiAddOns.h"
#include "cmCrossReference.h"
#include "cmmib.h"
#include "rvwatchdog.h"

#ifdef __cplusplus
extern "C" {
#endif

#define ifE(a) if(a)(a)


typedef struct
{
    RvInt32 nameId;
} fieldNames;


typedef enum
{
    makeCall                        =1,
    useGKCallSignalAddressToMakeCall=2,
    answerCall                      =4,
    useGKCallSignalAddressToAnswer  =8
}preGrantedArqFlags;

typedef enum
{
    ctrlReqNo,
    ctrlReqConnect,
    ctrlReqSeparate
}controlFlags;

typedef enum
{
    pmodeFullProperty,
    pmodeCopySingleMessages,
    pmodeDeleteSingleMessages,
    pmodeDoNotUseProperty
} propertyMode;


/* Enumeration of syntax trees needed to hold information for activating cmParam
   functions without the use of a properties database */
typedef enum
{
    cmParamSynSOAliasAddress,
    cmParamSynAliasAddress,
    cmParamSynCalledPartyNumber,
    cmParamSynCalledSubaddress,
    cmParamSynCallingPartyNumber,
    cmParamSynCallingSubaddress,
    cmParamSynEndpointType,
    cmParamSynConferenceGoal,
    cmParamSynCallType,
    cmParamSynUserData,
    cmParamSynNonStandardParameter,
    cmParamSynReleaseCompleteReason,
    cmParamSynFacilityReason,
    cmParamSynLast
} cmParamSyn;



typedef struct __cmElem
{
    /* Global callbacks of H.323 */
    SCMEVENT                    cmMyEvent;
    SCMCALLEVENT                cmMyCallEvent;

    /* control */
    SCMSESSIONEVENT             cmMySessionEvent;
    SCMCHANEVENT                cmMyChannelEvent;
    SCMPROTOCOLEVENT            cmMyProtocolEvent;
    CMPROTOCOLEVENT             cmMyProtocolEventReplacement;
    int                         cmMyProtocolEventReplacementSize;

    cmEvCallNewRawMessageT      cmEvCallNewRawMessage;
    cmEvCallSendRawMessageT     cmEvCallSendRawMessage;
    cmEvCallReleaseMessageContextT
                                cmEvCallReleaseMessageContext;

    cmNewCallbackEH             newCallback;

    RvThread                    threadInformation; /* Memory space for the current thread information.
                                                      This will only be used of the current thread
                                                      wan't constructed before cmInitialize() was called. */
    RvThread*                   pThreadInfo; /* Current thread information */

    RvSelectEngine*             selectEngine; /* FD select engine */
    RvH323TimerPoolHandle       hTimers; /* Timers pool */
    HAPPPARTNER                 hAppPartner;
    propertyMode                callPropertyMode;   /* Mode used for the property database of
                                                       the stack */

    int         h245Conf; /* H.245 configuration node id */
    int         q931Conf; /* Q.931 configuration node id */
    int         rasConf;  /* RAS configuration node id */

    HPST        synProtH245; /* Syntax of H.245 messages (MultimediaSystemControlMessage) */
    HPST        synProtQ931; /* Syntax of Q.931 messages (Q931Message) */
    HPST        synProtRAS; /* Syntax of RAS messages (RASMessage) */

    HPST        synAnnexL;
    HPST        synAnnexM;

    char        dynamicPayloadNumber; /* 0-31 */

    /* Log sources used byt the CM */
    RvLogSource log;
    RvLogSource logAPI;
    RvLogSource logCB;
    RvLogSource logERR;
    RvLogSource logTPKT;
    RvLogSource logConfig;
    RvLogSource logFastStart;
    RvLogSource logAppl;
    RvLogSource logWatchdog;

    int         level; /* Level of calls for CMAPI and CMAPICB functions */

    RvBool      gatekeeper; /* RV_TRUE if we're running as a gatekeeper,
                               RV_FALSE if we're running as an endpoint */

    HPST        hSyn;
    HPST        hAddrSyn;
    HPST        hAddrSynH245;
    HPST        synOLC;
    HPVT        hVal;               /* PVT used by the stack */
    HCFG        hCfg;               /* Configuration of the stack */
    RvBool      start;              /* RV_TRUE if stack is running, RV_FALSE if only initialized */
    RvBool      cidAssociate;
    char        delimiter;
    RvBool      diffSrcAddressInSetupAndARQ;
    HAPPAPP     haApp;              /* Application's handle for the stack's instance */
    RvLock      appLock; /* Application lock used to protect parts of this struct */
    RVHCAT      hCat;

    RvRandomGenerator               randomGenerator; /* Random numbers generator */
    RvH323UniqueIdGeneratorHandle   guidGenerator; /* Globally Unique ID generator to use */

    /* RAS */
    HRASMGR             rasManager;
    HAUTORASMGR         hAutoRas;
    RvBool              manualRAS; /* RV_TRUE if we're working with manual RAS,
                                      RV_FALSE if we're working with automatic RAS */
    HPST                synConfRAS;
    RvH323Connection    rasUnicastConnection; /* The Unicast handle used for sending and receiving
                                             RAS messages */
    RvH323Connection    rasMulticastConnection; /* The Multicast handle used for receiving RAS messages */

    RvUint32        localIPAddress;
    HPST            synConfQ931;
    HPST            synConfH245;
    HPST            h245TransCap;
    HPST            h245RedEnc;
    HPST            h245DataType;
    HPST            synKeySync; /* KeySyncMaterial syntax. Used for H.235 secured channels */

    HTPKTCTRL       hTpktCtrl;
    HAPPTRANS       hTransport;

    /*Calls*/
    HEMA        hCalls;
    int         crv;
    int         appDB;      /* PVT root node if application's default messages */
    int         busy;       /* Number of calls currently connected or being connected */
    int         t302;
    int         t304;
    int         postControlDisconnectionDelay;
    /*RAS Call*/

    /*Endpoint*/
    cmTransportAddress  annexEAddress;
    int                 rasGranted;
    int                 rasGrantedProtocol;
    int                 irrFrequencyInCall;
    RvPortRange*        portRange; /* Port range used by the stack */
    
    /*RAS*/
    HPST        hRASSyn;
    RvPvtNodeId rasAddessID;/*Local RAS Address*/
    int         requestSeqNum;
    int         q931Chan;
    int         q931AnnexEChan;

    /*Control*/
    char        h245protocolID[12]; /* Protocol Identifier of outgoing TCS messages */
    int         h245protocolIDLen;  /* Protocol Identifier length */
    int         maxChannels;
    HEMA        hChannels;

    /* MIB - H341 */
    HSTATISTIC  hStatistic;     /* Current stack's statistics */
    MibEventT   mibEvent;       /* MIB Callbacks to call */
    HMibHandleT mibHandle;      /* Handle of MIB to use */

    /* Other */
    int         encodeBufferSize;
    RvMutex     applicationLock;    /* Application specific lock. Used for cmMeiEnter/Exit */

    /* Watchdog */
    RvWatchdog  watchdog; /* Watchdog module we're using */
    RvTimer*    watchdogTimer; /* Timer activating the watchdog at a set interval */

    /* Syntax types used by cmGetSynTreeByRootName for backward compatability */
    HPST        synQ931UU;
    HPST        synTerminalLabel;
    HPST        synGkCrypto;
    HPST        synGkPwdCert;

    HPST        synParams[cmParamSynLast];

    /*fast Start*/
    int*        fastStartBuff; /* Array of proposals for all calls in the stack.
                                  The size of this array is:
                                  maxCalls*(maxFsProposed+maxFsAccepted) */
    RvUint8*    fastStartBuff2; /* Array of indexes to match acked channels to proposed ones */
    int         maxFsProposed; /* Maximum number of proposed channels in a single call */
    int         maxFsAccepted; /* Maximum number of accepted channels in a single call */

    /* Resource enumerations allocated by watchdog */
    RvUint32    cmTimersResourceVal;
    RvUint32    cmValTreeResourceVal;
} cmElem;




typedef enum
{
    cmRasStateInit,
    cmRasStateAwaiting,
    cmRasStateIdle
}rasStateFlags;


fieldNames* getParamFieldName(
           IN  cmRASParam       param);
int getParamFieldNameSize(
           IN  cmRASParam       param);
int cmiReportControl(IN HCALL call,
             IN cmControlState      state,
             IN cmControlStateMode  stateMode);

typedef enum
{
    fssNo,
    fssRequest,
    fssAck,
    fssRej
}fssFlags;

int cmFastStartChannelsConnect( HCALL hsCall);
int cmCallPreCallBack(HAPP hApp);


/************************************************************************
 * cmGetTimersHandle
 * purpose: Get the CM timers handle
 * input  : hApp            - Stack's instance handle
 * output : none
 * return : Timers handle on success
 ************************************************************************/
RvH323TimerPoolHandle cmGetTimersHandle(
        IN    HAPP                 hApp);


/************************************************************************
 * cmIsRoutedCall
 * purpose: Check if the call is routed or direct. Used to create perCallInfo
 *          inside IRR messages by the ras module.
 * input  : hsCall  - Call handle to check
 * output : none
 * return : RV_TRUE if call is routed
 ************************************************************************/
RvBool cmIsRoutedCall(IN HCALL hsCall);


void cmLock(IN HAPP hApp);
void cmUnlock(IN HAPP hApp);

int cmCallTryControlAfterACF(
    IN  HCALL hsCall
    );
                             

#ifdef __cplusplus
}
#endif

#endif  /* _CMINTERNAL_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -