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

📄 cmcall.h

📁 基于h323协议的软phone
💻 H
📖 第 1 页 / 共 2 页
字号:
/***********************************************************************
        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 _CMCALL_
#define _CMCALL_

#include "transport.h"
#include "rvh323timer.h"
#include "cat.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Maximum number of states in the call's state queue.
 * We do our best not to have a state-change of a call from within another state-change
 * callback to give the best backward-compatibility we can and to reduce call-stack nesting
 */
#define RV_H323CALL_STATE_MAX (5)

/* Dummy state definition, as held inside the queue */
#define RV_H323CALL_STATE_DUMMY (0xff)

/* The following definition allows debugging the stack while the flags are used
   as fields inside callElem instead of a bitfield. It should be commented out even
   in regular debug mode. */
/* #define RV_H323CALL_DEBUG_FLAGS */


/************************************************************************
 * cmCallParamEnum
 * Enumeration value of parameters as properties stored inside a call when
 * the property DB is not used as a single root with several messages
 * beneith it.
 * Each group of parameters that belong to the same type of message is
 * written one after the other, so we know when we're done with the
 * parameters of a specific message type.
 ************************************************************************/
typedef enum
{
    /* SETUP */
        cmEnumSetupSendingComplete   ,
        cmEnumInformationTransferCapability ,
        cmEnumDisplay                ,
        cmEnumCalledPartyNumber      ,
        cmEnumCalledPartySubAddress  ,
        cmEnumCallingPartyNumber     ,
        cmEnumCallingPartySubAddress ,
        cmEnumFullSourceAddress      ,
        cmEnumFullDestinationAddress ,
        cmEnumDestExtraCallInfo      ,
        cmEnumExtension              ,

        cmEnumFullSourceInfo         ,

        cmEnumDestCallSignalAddress  ,
        cmEnumSrcCallSignalAddress   ,
        cmEnumSetupH245Address       ,

        cmEnumActiveMc               ,
        cmEnumConferenceGoal         ,
        cmEnumCallType               ,

        cmEnumUserUser               ,

        cmEnumSetupNonStandardData   ,
        cmEnumSetupNonStandard       ,

        cmEnumSetupFastStart         ,
        cmEnumSetupCanOverlapSending ,

    /* CALL PROCEEDING */
        cmEnumCallProcH245Address    ,
        cmEnumCallProceedingNonStandardData,
        cmEnumCallProceedingNonStandard,

        cmEnumCallProcFastStart      ,

    /* ALERTING */
        cmEnumAlertingH245Address    ,
        cmEnumAlertingNonStandardData,
        cmEnumAlertingNonStandard    ,
        cmEnumAlertingFastStart      ,

    /* CONNECT */
        cmEnumH245Address            ,
        cmEnumConnectDisplay         ,
        cmEnumConnectUserUser        ,
        cmEnumConnectNonStandardData ,
        cmEnumConnectNonStandard     ,
        cmEnumConnectFastStart       ,
        cmEnumConnectConnectedAddress,

    /* RELEASE COMPLETE */
        cmEnumReleaseCompleteReason  ,
        cmEnumReleaseCompleteCause   ,
        cmEnumReleaseCompleteNonStandardData,
        cmEnumReleaseCompleteNonStandard,

    /* FACILITY */
        cmEnumAlternativeAddress     ,
        cmEnumAlternativeAliasAddress,
        cmEnumAlternativeDestExtraCallInfo
                                           ,
        cmEnumAlternativeExtension   ,
        cmEnumFacilityCID            ,
        cmEnumFacilityReason         ,

    /* LAST ITEM - used to calculate size on compilation */
        cmEnumLast
} cmCallParamEnum;



/* This list holds the positions of all the fields inside the flags field of a callElem. */
typedef enum
{
    e_remoteVersion = 0,
    e_newCIDRequired = e_remoteVersion+5,

    e_callInitiator,
    e_dummyRAS,
    e_enableOverlapSending,
    e_remoteCanOverlapSend,
    e_multiRate,
    e_overrideCID,
    e_gatekeeperRouted,

    e_notified,
    e_callWithoutQ931,
    e_control,
    e_h245Tunneling,
    e_notEstablishControl,
    e_isParallelTunneling,
    e_h245Stage,
    e_isMultiplexed = e_h245Stage+5,
    e_shutdownEmptyConnection,
    e_fastStartFinished,
    e_controlDisconnected,
    e_preservedCall,
    e_callDialInvoked,
    e_sendCallProceeding,
    e_sendAlerting,

    /* Last enumeration value */
    e_lastCallFlag /* This should always be the last flag - it is used for validity checks */
} callElemEnumPosition;



/* This list holds the mask to use for each of the flags. There are fields that are not
   boolean, whose flags have a bigger mask than those of the boolean fields. */
typedef enum
{
    s_remoteVersion=0x1f,
    s_newCIDRequired=1,

    s_callInitiator=1,
    s_dummyRAS=1,
    s_enableOverlapSending=1,
    s_remoteCanOverlapSend=1,
    s_multiRate=1,
    s_overrideCID=1,
    s_gatekeeperRouted=1,

    s_notified=1,
    s_callWithoutQ931=1,
    s_control=1,
    s_h245Tunneling=1,
    s_notEstablishControl=1,
    s_isParallelTunneling=1,
    s_h245Stage=0x1f,
    s_isMultiplexed=1,
    s_shutdownEmptyConnection=1,
    s_fastStartFinished=1,
    s_controlDisconnected=1,
    s_preservedCall=1,
    s_callDialInvoked=1,
    s_sendCallProceeding=1,
    s_sendAlerting=1
} callElemEnumSize;


#ifdef RV_H323CALL_DEBUG_FLAGS

#define m_callset(_call,_field,_value) (_call)->flags.##_field = _value
#define m_callget(_call,_field) (_call)->flags.##_field

#else

/* field_mask(field) defines the mask to use on the flags to handle the given field
 * example:
 *  field_mask(h245Stage);
 * The above returns the mask for the h245Stage boolean field inside callInfo.flags
 */
#define field_mask(_field) (s_##_field<<(e_##_field))

/* Set and get macros for fields inside callInfo.flags */
#define m_callset(_call,_field,_value) \
    ((_call)->flags = ( ((_call)->flags  & ~(field_mask(_field))) | (field_mask(_field) & ((int)(_value) << (e_##_field))) ))
#define m_callget(_call,_field) \
    (((_call)->flags  & (field_mask(_field))) >> (e_##_field))

#endif  /* RV_H323CALL_DEBUG_FLAGS */



/************************************************************************
 * callElem
 * Call element. Holds the information about the call.

⌨️ 快捷键说明

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