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

📄 cmcontrol.h

📁 基于h323协议的软phone
💻 H
字号:
/***********************************************************************
        Copyright (c) 2002 RADVISION Ltd.
************************************************************************
NOTICE:
This document contains information that is confidential and proprietary
to RADVISION Ltd.. No part of this document may be reproduced in any
form whatsoever without written prior approval by RADVISION Ltd..

RADVISION Ltd. reserve the right to revise this publication and make
changes without obligation to notify any person of such revisions or
changes.
***********************************************************************/

#ifndef _CMCOTROL_
#define _CMCOTROL_

#include "cm.h"
#include "rvh323timer.h"
#include "cmCrossReference.h"
#include "cmictrl.h"

#ifdef __cplusplus
extern "C" {
#endif


typedef enum
{
    ControlStateNotInitialized,
    ControlStateInitialized,
    ControlStateConnected,
    ControlStateConference,
    ControlStateEndSession,
    ControlStateTransmittedSidePaused /* TCS0 was received. Waiting to get out of this state */
} ControlState;

typedef enum
{
    CapStatusReleased,
    CapStatusSent,
    CapStatusAcknowledged,
    CapStatusRejected
} CapStatus;


/************************************************************************
 * outgoingCapInfo struct
 * Outgoing capabilities negotiated for the call
 ************************************************************************/
typedef struct
{
    RvBool      waiting;        /* RV_TRUE if we're waiting for an Ack */
    RvTimer*    timer;          /* Timer used for negotiations of capabilities */
    RvUint8     seqNum;         /* Sequence number of the current TCS exchange between the endpoints */
    RvPvtNodeId termNodeId;     /* Current outgoing capabilities of this terminal */
    int         rejectCause;    /* Reject cause if rejected */
} OutgoingCapInfo;



/************************************************************************
 * incomingCapInfo struct
 * Incoming capabilities negotiated for the call
 ************************************************************************/
typedef struct
{
    char        pID[12];        /* Protocol Identifier of incoming capability. */
    int         pIDLen;
    RvUint8     seqNum;
    RvPvtNodeId termNodeId;
    RvBool      manualResponse;
} IncomingCapInfo;





/* Request Mode Information */
typedef struct
{
    RvUint8  seqNum;
    RvTimer* timer;
} OutRequestModeInfo;

typedef struct
{
    RvUint8 seqNum;
} InRequestModeInfo;




/* Master - Slave Information */
typedef enum
{
    MsdStateIdle,
    MsdStateIncomingAwaitingManualAcknoledge,
    MsdStateIncomingAwaitingResponse,
    MsdStateOutgoingAwaitingResponse
} MsdState;

typedef enum
{
    MsdStatusIndeterminate,
    MsdStatusMaster,
    MsdStatusSlave
} MsdStatus;


typedef struct
{
    MsdState   state;
    RvTimer*   timer;
    MsdStatus  status;
    int        myTerminalType;
    int        terminalType;
    int        myStatusDeterminationNumber;
    int        statusDeterminationNumber;
    int        count;
    RvBool     manualResponse;
} MasterSlaveInfo;





/* Round Trip Information */

typedef struct
{
    RvTimer*    timer;
    RvInt32     timeStart;
    int         seqNum;
    RvBool      waiting;
} RoundTripInfo;

/* The channel state enumeration */
typedef enum
{
    ChannelStateReleased = -1,
    ChannelStateIdle,
    ChannelStateAwaitingEstablishment,
    ChannelStateFaststart,
    ChannelStateFsAwaitingEstablish,
    ChannelStateEstablished,
    ChannelStateAwaitingRelease,
    ChannelStateAwaitingConfirmation
} ChannelState;


/* The channelParams union to decide between H.225 parameters and H.223 parameters */
typedef union
{
    struct
    {
        int             fastStartChannelIndex; /* -1 for normal channels. For faststart channels,
                                              this is the index of the approval in callElem. */
        int             dynamicPayloadNumber;
        int             portNumber; /* portNumber field set by the local side for this channel.
                                   This is an optional field used for ATM. */
        RvBool          bFlowControlToZero;
        /* RTP and RTCP addresses for the channel. Stored as node id's */
        RvPvtNodeId     recvRtpAddressID; /* Local RTP addres for this channel. -1 if NA */
        RvPvtNodeId     recvRtcpAddressID; /* Local RTCP address for this channel. -1 if NA */
        RvPvtNodeId     sendRtpAddressID; /* Remote RTP address for this channel. -1 if NA */
        RvPvtNodeId     sendRtcpAddressID; /* Remote RTCP address for this channel. -1 if NA */

        RvPvtNodeId     redEncID; /* Redundancy encoding of the channel (redundancyEncoding field in h2250LogicalChannelParameters) */
        RvPvtNodeId     transCapID; /* Transport capabilities of the channel (transportCapability field in h2250LogicalChannelParameters) */

        /* Separate Stack related information */
        RvPvtNodeId     separateStackID; /* Separate Stack of the channel (separateStack.networkAddress.localAreaAddress) */
        int             externalReferenceLength; /* Separate Stack's external reference length */
        char            externalReference[256]; /* Separate Stack's external reference */
        RvBool          isAssociated; /* RV_TRUE if the channel is associated - used for separateStack information */
        cmT120SetupProcedure
                        t120SetupProcedure;
        cmTerminalLabel source; /* Type of terminal on source side of this channel */
        cmTerminalLabel destination; /* Type of terminal on destination side of this channel */

    }h225Params;

    struct
    {
        int oren;/* h223 parameters */
    }h223Params;

}ChannelParamsUnion;


/* ChannelParamsType - Defines whether the parameters are H.225 or H.223 */
typedef enum
{
    ChannelParamsUndefined = -1,
    ChannelParamsH225,
    ChannelParamsH223
}ChannelParamsType;

/* The ChannelParams Object includes the parameters data and the type of the parameters */
typedef struct
{
    ChannelParamsType  eType;
    ChannelParamsUnion data;
}ChannelParams;


/************************************************************************
 * Control struct
 * This structure holds the H.245 control information necessary for
 * connecting a regular call with H245 channel.
 ************************************************************************/
typedef struct __Control
{
     /* The control state */
    ControlState       eState;          /* Control channel's state */
    ControlState       eLastState;      /* last state before receiving TCS0 */

    /* The capabilities information */
    OutgoingCapInfo    outCap;          /* Outgoing capabilities */
    IncomingCapInfo    inCap;           /* Incoming capabilities */
    CapStatus          eInCapStatus;    /* Incoming capabilities status */
    CapStatus          eOutCapStatus;   /* Outgoing capabilities status */

    /* Master - Slave information */
    MasterSlaveInfo    msd;             /* MasterSlaveDetermination process structure */
    RvBool             bIsMasterSlave;  /* RV_TRUE if at least 1 MSD procedure was finished */
    RvBool             bIsMaster;       /* RV_TRUE if local endpoint is master in this call */

    /* Request Mode */
    OutRequestModeInfo outRequestMode;
    InRequestModeInfo  inRequestMode;

   /* Channel Information */
    int                logicalChannelOut;
    RvBool             bIsDerived;
    RvBool             bFirstAudioIn;
    RvBool             bFirstVideoIn;
    RvBool             bFirstDataIn;
    RvBool             bFirstAudioOut;
    RvBool             bFirstVideoOut;
    RvBool             bFirstDataOut;
    int                conflictChannels;   /* Used to prevent sid conflicts. Causes the stack to reject incoming
                                              simplex channels with sid=0 until all offered channels are ACKed,
                                              timed out, rejected or dropped. */
    int                nextFreeSID;

    /* General H245 Information */
    RoundTripInfo      roundTrip;
    int                multiPointMode;

    /* Link to the first channel in the channel list */
    HCHAN*             hFirstChannel;

    /* H.323 information */
    cmTerminalLabel    myTerminalLabel;
    cmTransportAddress mcLocationTA;

    /* stored incoming OLCs before control got connected */
    RvPvtNodeId        incomingOLCs[2];

} H245Control;





/************************************************************************
 * Channel struct
 * This structure holds the channel information stored in the stack
 ************************************************************************/
typedef struct ChannelElem H245Channel;
struct ChannelElem
{
    /* Refernce to the H.223 parameters or H.225 parameters */
    ChannelParams   pChannelParams;

    /* General H.245 channel information */
    RvBool       bIsDuplex;     /* Is the channel unidirectional or bidirectional? */
    int          sessionId;
    int          myLogicalChannelNum;   /* Logical Channel Number of this channel */
    int          reverseLogicalChannelNum;
    RvBool       bOrigin;   /* RV_TRUE if we're the origin of this channel, RV_FALSE otherwise */
    int          remotePortNumber;   /* portNumber field set by the remote side for this channel */
    ChannelState eState;          /* The state of the channel */
    RvPvtNodeId  dataTypeID;     /* The data type node id of this channel */
    RvPvtNodeId  requestCloseParamID;

    /* Timers */
    RvTimer*     pTimer;
    RvTimer*     pRequestCloseTimer;
    RvTimer*     pMediaLoopTimer;

    /* Associated channels */
    H245Channel* pPartner;  /* Opposite channel with the same session ID */
    H245Channel* pBase;
    H245Channel* pAssociated;   /* Pointer to the assiciated channel */
    H245Channel* pReplacementCh;

    /* Reference to the H245 control */
    HCONTROL     hCtrl;     /* Control object holding this channel. */

    /* Links to other channels on the same call */
    H245Channel* pPrev;     /* Previous channel that belongs to the same call */
    H245Channel* pNext;     /* Next channel that belongs to the same call */
};




#ifdef __cplusplus
}
#endif


#endif  /* _CMCOTROL_ */

⌨️ 快捷键说明

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