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

📄 cmutils.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 _RV_CMUTILS_H
#define _RV_CMUTILS_H

#include "rvlog.h"
#include "cmintr.h"
#include "cm.h"

#ifdef __cplusplus
extern "C" {
#endif

int setNonStandard(
        IN  HPVT  hVal,
        IN  int   nodeId,
        IN  cmNonStandard*nonStandard
);
int setNonStandardParam(
        IN  HPVT  hVal,
        IN  int   vNodeId,
        IN  cmNonStandardParam*nonStandard
);

int getNonStandard(
        IN  HPVT  hVal,
        IN  int   nodeId,
        OUT cmNonStandard*nonStandard
);

int getNonStandardParam(
        IN  HPVT  hVal,
        IN  int   vNodeId,
        OUT cmNonStandardParam*nonStandard
);

RvInt32 getEnumNameId(
          IN    fieldNames* enumFieldNames,
          IN    int     enumFieldNamesSize,
          IN    unsigned    enumValue
);

int getEnumValueByNameId(
                    IN  fieldNames* enumFieldNames,
            IN  RvInt32     nameId
);
int aliasToVt(
          IN  HPVT    hVal,
          IN  cmAlias*alias,
          IN  int     nodeId);

int vtToAlias(
          IN  HPVT    hVal,
          IN  cmAlias*alias,
          IN  int     nodeId);


int cmVtToTA(HPVT hVal,int nodeId, cmTransportAddress* ta);

int cmTAToVt(HPVT hVal,int nodeId, cmTransportAddress* ta);

int cmVtToTA_H245(HPVT hVal,int nodeId, cmTransportAddress* ta);

int cmTAToVt_H245(HPVT hVal,int nodeId, cmTransportAddress* ta);


/**************************************************************************************
 * RvH323CoreToCmAddress
 *
 * Purpose: Convert a core address into a CM address.
 *
 * Input:   coreAddress - Core adress to convert
 * Output:  cmAddress   - CM address to create
 * Returns: RV_OK on success, other on failure
 **************************************************************************************/
RvStatus RvH323CoreToCmAddress(
    IN  RvAddress*          coreAddress,
    OUT cmTransportAddress* cmAddress);


/**************************************************************************************
 * RvH323CmToCoreAddress
 *
 * Purpose: Convert a CM address into a core address.
 *
 * Input:   cmAddress   - CM address to create
 * Output:  coreAddress - Core adress to convert. This address must be destructed
 *                        by the caller to this function
 * Returns: RV_OK on success, other on failure
 **************************************************************************************/
RvStatus RvH323CmToCoreAddress(
    IN  cmTransportAddress* cmAddress,
    OUT RvAddress*          coreAddress);


/**************************************************************************************
 * RvH323CmPrintMessage
 *
 * Purpose: Print an incoming or an outgoing message to the logfile.
 *
 * Input:   logSource           - Log source to print into
 *          messageStr          - String to use before printing the message
 *          hVal                - Value tree to use
 *          messageNodeId       - Message root node to print. Shout be set to -1 if decoding
 *                                of the buffer failed for incoming messages.
 *          messageBuffer       - Message buffer to print
 *          messageBufferSize   - Size of the message buffer. Should be set to -1 if encoding
 *                                of the nodeId failed for outgoing messages.
 *          isIncoming          - RV_TRUE if the message is incoming, RV_FALSE for outgoing
 * Output:  None
 * Returns: None
 **************************************************************************************/
#if (RV_LOGMASK_COMPILEMASK & (RV_LOGLEVEL_DEBUG | RV_LOGLEVEL_ERROR))
void RvH323CmPrintMessage(
    IN RvLogSource*     logSource,
    IN const RvChar*    messageStr,
    IN HPVT             hVal,
    IN RvPvtNodeId      messageNodeId,
    IN RvUint8*         messageBuffer,
    IN int              messageBufferSize,
    IN RvBool           isIncoming);
#else
#define RvH323CmPrintMessage(_log, _msgStr, _hVal, _msgNodeId, _msgBuf, _msgBufSize, _isIncoming)
#endif



/**************************************************************************************
 * encodeDecodeBufferInit
 *
 * Purpose: To initialize the buffer for coding purposes.
 *
 * Input:   none
 *
 * Output:  none
 *
 **************************************************************************************/
void encodeDecodeBufferInit(void);

/**************************************************************************************
 * getEncodeDecodeBuffer
 *
 * Purpose: To get the buffer for coding purposes.
 *
 * Input:   bufferSize   - The size of buffer required.
 *          buffer       - A pointer to the buffer.
 *
 *
 * Output:  buffer       - A pointer to the buffer .
 *
 **************************************************************************************/
void getEncodeDecodeBuffer(IN int bufferSize, OUT RvUint8 **buffer);

/**************************************************************************************
 * encodeDecodeBufferEnd
 *
 * Purpose: close down the local storage.
 *
 * Input:   none.
 * Output:  none.
 *
 **************************************************************************************/
void encodeDecodeBufferEnd(void);

/**************************************************************************************
 * cleanMessage
 *
 * Purpose: Deletes all tunneling elements (H.245, H.450, annex M, annex L) from the
 *          given message. This is to avoid resending tunneled messages when reusing
 *          messages from the cm Property tree.
 *
 * Input:   hPvt - handle to the PVT of the message
 *          message  - A pvt node to the message.
 *
 * Output:  None.
 *
 **************************************************************************************/
void cleanMessage(IN HPVT hPvt, IN int message);

#ifdef __cplusplus
}
#endif

#endif  /* _RV_CMUTILS_H */


⌨️ 快捷键说明

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