亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? faststart.c

?? 基于h323協(xié)議的軟phone
?? C
?? 第 1 頁 / 共 4 頁
字號:
/***********************************************************************
        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.
***********************************************************************/

#include "rvinternal.h"
#include "pvaltree.h"
#include "pvaltreeStackApi.h"
#include "psyntreeStackApi.h"
#include "rvh323timer.h"
#include "msg.h"
#include "cm.h"
#include "cmictrl.h"
#include "cmdebprn.h"
#include "cmintr.h"
#include "cmConf.h"
#include "q931asn1.h"
#include "h245.h"
#include "cmutils.h"
#include "copybits.h"
#include "prnutils.h"
#include "cmCrossReference.h"
#include "cmchan.h"
#include "cmCall.h"
#include "cmChanGetByXXX.h"


#ifdef __cplusplus
extern "C" {
#endif


    /*These are theoretical maxima, these numbers are used in the lcn allocation procedure and is assumed to never be changed */
/*The main assumption here is that (MAX_FASTSTART_CHANNELS+1)*MAX_LCN_S <= 64K(the number of possible LCNs)*/
#define MAX_FASTSTART_CHANNELS  511
#define MAX_LCN_S               128


/* Maximum number of session ids that fast start can handle */
#define MAX_FS_SESSION_ID 10



/********************************************************************************************
 * Description of THREAD_FSLocalStorage
 * This structure holds thread related information for FASTSTART
 * bufferSize   - The size of allocated buffer. We might need that when we'll have to realloc
 * buffer       - The encoding/decoding buffer
 ********************************************************************************************/
typedef struct
{
    RvUint32    bufferSize;
    RvUint8*    buffer;
} THREAD_FSLocalStorage;



int cmcCallAddressCallbacks(
    IN cmElem*      app,
    IN H245Channel*     channel,
    IN int          h225ParamNodeId,
    IN RvBool       origin);

int notifyChannelState(H245Channel*channel,cmChannelState_e state, cmChannelStateMode_e stateMode);

int  cmcReadyEvent  (H245Control* ctrl);

static void buildLCParameters(callElem* call, int elemNodeId, cmCapDataType type, cmFastStartChannel* fsChannel)
{

    int paramNodeId,nodeId;
    cmElem*app=(cmElem*)emaGetInstance((EMAElement)call);
    HPVT hVal;

    hVal=app->hVal;
    /* Build and fill the dataType either from the configuration or from the given
       structure */
    nodeId=pvtAddBranch(hVal,elemNodeId,__h245(dataType));

    if (fsChannel->dataTypeHandle<0)
        confGetDataType(hVal, app->h245Conf,fsChannel->channelName, nodeId, NULL, RV_FALSE);
    else
        pvtMoveTree(hVal,nodeId,fsChannel->dataTypeHandle);

    paramNodeId=pvtAddBranch2(hVal,elemNodeId,__h245(multiplexParameters),__h245(h2250LogicalChannelParameters));

    /* Build and set the mediaChannel subtree (rtp) */
    if (fsChannel->rtp.ip || fsChannel->rtp.port)
    {
        nodeId=pvtAddBranch(hVal,paramNodeId,__h245(mediaChannel));
        getGoodAddressForCall((HCALL)call,&fsChannel->rtp);
        cmTAToVt_H245(hVal, nodeId, &fsChannel->rtp);
    }

    /* Build and set the mediaControlChannel subtree (rtcp) */

    if (fsChannel->rtcp.ip || fsChannel->rtcp.port)
    {
        nodeId=pvtAddBranch(hVal,paramNodeId,__h245(mediaControlChannel));
        getGoodAddressForCall((HCALL)call,&fsChannel->rtcp);
        cmTAToVt_H245(hVal, nodeId, &fsChannel->rtcp);
    }


    /* fill in the session id according to the transalation table */
    pvtAdd(hVal,paramNodeId,__h245(sessionID),type,NULL,NULL);
}


/************************************************************************
 * cmFastStartBuild
 * purpose: Build a single OpenLogicalChannel message for use in fast start
 *          proposals
 * input  : hsCall      - Stack handle for the call
 *          type        - DataType of the proposed channel
 *          direction   - Direction of the proposed channel
 *          fsChannel   - FastStart channel information
 * return : Node ID of created OpenLogicalChannel on success
 *          Negative value on failure
 ************************************************************************/
RVAPI int RVCALLCONV
cmFastStartBuild(
    IN HCALL                hsCall,
    IN cmCapDataType        type,
    IN cmChannelDirection   direction,
    IN cmFastStartChannel*  fsChannel)
{
    callElem* call=(callElem*)hsCall;
    /*H245Control* ctrl=getControl(hsCall);*/
    cmElem*app=(cmElem*)emaGetInstance((EMAElement)hsCall);
    HPVT hVal;
    int outElemId,openMsgId=RV_ERROR_UNKNOWN;


    if (!hsCall || !app) return RV_ERROR_UNKNOWN;
    hVal=app->hVal;

    cmiAPIEnter((HAPP)app, "cmFastStartBuild: hsCall=0x%p",hsCall);
    if (emaLock((EMAElement)hsCall))
    {
        /* Build a OLC message for the channel */
        openMsgId = pvtAddRoot(hVal, app->synOLC, 0, NULL);
        /* Build the forward logical channel subtree (should be dummy for receiving channel) */
        outElemId=pvtAddBranch(hVal,openMsgId,__h245(forwardLogicalChannelParameters));

        if (direction==dirBoth)
        {
            buildLCParameters(call, outElemId, type, fsChannel);
            /* Now build the reverse logical channel subtree */
            outElemId=pvtAddBranch(hVal,openMsgId,__h245(reverseLogicalChannelParameters));
        }
        if (direction==dirReceive)
        {
            pvtAddBranch2(hVal,outElemId, __h245(multiplexParameters),__h245(none));

            /* Write nullData in the dataType part and dummy number as lcn */
            pvtAddBranch2(hVal,outElemId,__h245(dataType),__h245(nullData));
            pvtAdd(hVal,openMsgId,__h245(forwardLogicalChannelNumber),323,NULL,NULL);

            /* Now get to business and build the reverse logical channel subtree */
            outElemId=pvtAddBranch(hVal,openMsgId,__h245(reverseLogicalChannelParameters));
        }

        buildLCParameters(call, outElemId, type, fsChannel);


        if (direction!=dirReceive)
        {
            /* allocate a logical channel number for the current channel and write it into the
               appEvent message */
            pvtAdd(hVal,openMsgId,__h245(forwardLogicalChannelNumber),++call->lcnOut,NULL,NULL);
        }
        emaUnlock((EMAElement)hsCall);
    }
    cmiAPIExit((HAPP)app, "cmFastStartBuild: [%d]",openMsgId);
    return openMsgId;
}


/************************************************************************
 * cmCallAddFastStartMessage
 * purpose: Add an OpenLogicalChannel message to the fast start proposal
 *          on the origin side of the call.
 * input  : hsCall      - Stack handle for the call
 *          fsMessageId - Node ID of the OpenLogicalChannel to add
 * return : Non-negative value on success
 *          Negative value on failure
 ************************************************************************/
RVAPI int RVCALLCONV
cmCallAddFastStartMessage(IN HCALL hsCall, IN int fsMessageId)
{
    callElem* call=(callElem*)hsCall;
    HAPP hApp=(HAPP)emaGetInstance((EMAElement)hsCall);

    if (!hsCall || !hApp) return RV_ERROR_UNKNOWN;
    cmiAPIEnter(hApp, "cmCallAddFastStartMessage: hsCall=0x%p",hsCall);
    if (call->fastStartNodesCount == ((cmElem *)hApp)->maxFsProposed)
    {
        /* array is maxFsProposed+1 size, must leave the last one -1 */
        cmiAPIExit(hApp, "cmCallAddFastStartMessage: no more room [-1]");
        return RV_ERROR_OUTOFRANGE;
    }

    if (emaLock((EMAElement)hsCall))
    {
        if (m_callget(call,callInitiator))
        {
            call->fastStartNodes[call->fastStartNodesCount++]=fsMessageId;
            call->fastStartState=fssRequest;
        }
        emaUnlock((EMAElement)hsCall);
    }
    cmiAPIExit(hApp, "cmCallAddFastStartMessage: [1]");

    return RV_TRUE;
}


/******************************************************************************************
 * cmFastStartOpenChannels
 *
 * Purpose:  This API function enables the caller to supply a structure with data about
 *           the offered logical channels for fast start procedure. The structure includes
 *           all offered channels, both incoming and outgoing, arranged by their type, i.e.
 *           Audio channels, Video channels, etc.
 *
 * Input:    hsCall - A handle to the call whose setup message shall carry the
 *                    fast start offer.
 *
 *           fsMessage - A pointer to the structure containing the channels data.
 *
 * Reurned Value: RV_TRUE or negative value on failure.
 *
 ****************************************************************************************/
RVAPI int RVCALLCONV
cmFastStartOpenChannels(IN HCALL hsCall, IN cmFastStartMessage* fsMessage)
{
    int openMsgId,index,channelType,ret=1;
    callElem* call=(callElem*)hsCall;
    /*H245Control* ctrl=getControl(hsCall);*/
    HAPP hApp;
    HPVT hVal;

    if (!hsCall || fsMessage->partnerChannelsNum<=0) return RV_ERROR_UNKNOWN;
    hApp=(HAPP)emaGetInstance((EMAElement)call);
    if (!hApp) return RV_ERROR_UNKNOWN;
    cmiAPIEnter(hApp, "cmFastStartOpenChannels: hsCall=0x%p",hsCall);

    if (emaLock((EMAElement)hsCall))
    {
        hVal = ((cmElem *)hApp)->hVal;

         /* This is the main loop that goes over the offered channls in the given structure
         and build from it the sub-tree to be saved in the H245 machine and attached to the
         SETUP message. The order is acccording to the channel type (Audio, Video etc.) */
        for (channelType = 0; channelType< fsMessage->partnerChannelsNum ;channelType++)
        {
            cmAlternativeChannels* aChannel;
            /* We currently handle only audio and video channels in faststart */
            if ( (fsMessage->partnerChannels[channelType].type < cmCapEmpty) || (fsMessage->partnerChannels[channelType].type > cmCapData) )
                continue;

            aChannel=&fsMessage->partnerChannels[channelType].receive;

            /* Go over the offered receive channels */
            for (index=0;index<aChannel->altChannelNumber;index++)
            {
                /* Build logicalChannel message */
                openMsgId = cmFastStartBuild(hsCall, fsMessage->partnerChannels[channelType].type, dirReceive, &aChannel->channels[index]);
                /* The OLC is ready for the receive channel, encode it */
                cmCallAddFastStartMessage(hsCall, openMsgId);
            }

            aChannel=&fsMessage->partnerChannels[channelType].transmit;

            /* Now go over the offered transmit channels */
            for (index=0;index<aChannel->altChannelNumber;index++)
            {
                /* Build logicalChannel message */
                openMsgId = cmFastStartBuild(hsCall, fsMessage->partnerChannels[channelType].type, dirTransmit, &aChannel->channels[index]);
                /* The OLC is ready for the receive channel, encode it */
                cmCallAddFastStartMessage(hsCall, openMsgId);
            }
        }
        emaUnlock((EMAElement)hsCall);
    }

    cmiAPIExit(hApp, "cmFastStartOpenChannels: [%d]",ret);

    return ret;
}


/************************************************************************
 * cmFastStartGetByIndex
 * purpose: Get faststart information of a single OpenLogicalChannel
 *          message from the faststart proposal string
 * input  : hsCall  - Stack handle for the call
 *          index   - Index of the faststart proposal to get (0-based)
 * return : Node ID of the OpenLogicalChannel message proposal on success
 *          Negative value on failure
 ************************************************************************/
RVAPI int RVCALLCONV
cmFastStartGetByIndex(IN HCALL hsCall, IN int index)
{
    int nodeId=RV_ERROR_UNKNOWN;
    HAPP hApp=(HAPP)emaGetInstance((EMAElement)hsCall);
    callElem * call = (callElem*)hsCall;

    if (!hApp || !hsCall) return RV_ERROR_UNKNOWN;

    cmiAPIEnter(hApp, "cmFastStartGetByIndex: hsCall=0x%p, initiator=%d",hsCall, m_callget(call,callInitiator));
    if (emaLock((EMAElement)hsCall))
    {
        if (m_callget(call,callInitiator))
        {
            /* make sure we got an Ack */
            if (call->fastStartState == fssAck)
            {
                /* bounds check */
                if ((index >= 0) && (index < ((callElem*)hsCall)->fastStartNodesAckCount))
                    nodeId = call->fastStartNodesAck[index];
            }
        }
        else
        {
            /* bounds check */
            if ((index >= 0) && (index < ((callElem*)hsCall)->fastStartNodesCount))
                nodeId = call->fastStartNodes[index];
        }
        emaUnlock((EMAElement)hsCall);
    }

    cmiAPIExit(hApp, "cmFastStartGetByIndex: [%d]",nodeId);
    return nodeId;
}


/************************************************************************
 * cmFastStartGet
 * purpose: Get faststart information of a single OpenLogicalChannel
 *          message from the faststart proposal string
 * input  : hsCall      - Stack handle for the call
 *          fsChannelId - PVT node ID of the root of the faststart proposal
 *                        of one of the channels
 * output : type        - DataType of the proposed channel
 *          direction   - Direction of the proposed channel
 *          fsChannel   - FastStart channel information

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av午夜一区麻豆| 91精品国产综合久久精品app| www.av亚洲| 欧美一区二区三区在| 国产精品你懂的在线| 亚洲成人av电影在线| 成人性视频免费网站| 日韩欧美激情四射| 亚洲精品老司机| 粉嫩在线一区二区三区视频| 日韩一级片在线播放| 一二三区精品视频| 成人免费高清在线| 精品国产精品网麻豆系列 | 精品少妇一区二区三区日产乱码| 国产精品乱人伦中文| 韩国av一区二区三区在线观看| 在线看一区二区| 中文字幕国产一区| 精品亚洲欧美一区| 欧美一级黄色录像| 午夜久久久影院| 欧美三区在线视频| 夜夜揉揉日日人人青青一国产精品| 欧美日韩黄色影视| 亚洲欧美日韩国产中文在线| 处破女av一区二区| 久久久久国产精品免费免费搜索| 日韩—二三区免费观看av| 欧美影视一区在线| 亚洲女同一区二区| 91高清视频在线| 亚洲人亚洲人成电影网站色| 粉嫩嫩av羞羞动漫久久久| 久久久精品tv| 豆国产96在线|亚洲| 国产精品免费丝袜| 99久久精品一区| 国产精品不卡在线| 一本一道综合狠狠老| 亚洲欧美在线观看| 日本久久电影网| 亚洲国产视频直播| 91精品啪在线观看国产60岁| 免费精品视频最新在线| 91精品国产色综合久久ai换脸 | 国产精品996| 久久久www成人免费毛片麻豆| 国产成人精品一区二区三区四区 | 国产99久久精品| 中文字幕av一区 二区| gogo大胆日本视频一区| 中文字幕亚洲在| 在线免费观看成人短视频| 天堂精品中文字幕在线| 欧美xingq一区二区| 国产成人a级片| 亚洲精品一二三| 91精品国产色综合久久不卡蜜臀| 国产精品一线二线三线| ...xxx性欧美| 欧美精品第一页| 国产精品一区免费视频| 亚洲三级免费观看| 欧美一区二区三区四区久久| 国产精品一区二区免费不卡| 亚洲啪啪综合av一区二区三区| 欧美婷婷六月丁香综合色| 蜜桃视频在线一区| 国产精品麻豆99久久久久久| 欧美在线不卡一区| 精品系列免费在线观看| 亚洲免费在线视频| 精品国产百合女同互慰| 91影视在线播放| 美腿丝袜一区二区三区| 国产精品电影一区二区| 欧美精品亚洲二区| 成人午夜免费视频| 日一区二区三区| 亚洲欧洲成人精品av97| 久久男人中文字幕资源站| 在线观看一区不卡| 国产福利一区在线| 午夜精品久久久久久久久久久 | 日韩二区三区在线观看| 欧美午夜精品久久久久久超碰| 黄色资源网久久资源365| 亚洲制服丝袜在线| 中文在线一区二区| 欧美一区二区黄色| 欧美视频一区二区三区| gogogo免费视频观看亚洲一| 蜜臀av一级做a爰片久久| 亚洲毛片av在线| 久久久精品人体av艺术| 欧美日韩一区二区不卡| 国产一级精品在线| 日本少妇一区二区| 亚洲一区二区三区视频在线| 国产精品的网站| 久久久蜜臀国产一区二区| 欧美一区二区三区四区在线观看 | 欧美激情综合在线| 精品少妇一区二区三区日产乱码 | 中文字幕在线免费不卡| 国产欧美日韩久久| 欧美videos中文字幕| 日韩一区二区免费视频| 欧美无砖专区一中文字| 色婷婷久久久久swag精品| 成人午夜视频在线| 国产91在线|亚洲| 国产高清精品在线| 国产白丝网站精品污在线入口| 久国产精品韩国三级视频| 全部av―极品视觉盛宴亚洲| 天堂一区二区在线免费观看| 亚洲高清免费在线| 亚洲成人在线免费| 天天综合色天天综合色h| 视频在线观看91| 日韩av在线播放中文字幕| 丝袜诱惑制服诱惑色一区在线观看| 一区二区三区鲁丝不卡| 一区二区日韩av| 亚洲电影你懂得| 日韩中文字幕亚洲一区二区va在线| 舔着乳尖日韩一区| 美女在线视频一区| 精品一区二区成人精品| 丁香一区二区三区| 99re成人在线| 欧美唯美清纯偷拍| 欧美va在线播放| 亚洲国产高清在线| 一区二区三区日韩精品视频| 亚洲卡通欧美制服中文| 亚洲成人免费在线观看| 日本亚洲视频在线| 懂色av一区二区三区免费看| 色欲综合视频天天天| 欧美日韩情趣电影| 久久久亚洲国产美女国产盗摄 | 日本韩国一区二区三区| 91精品免费在线观看| 一区二区三区欧美久久| 日本在线观看不卡视频| 国产精品亚洲视频| 日本韩国一区二区三区视频| 91精品国产91久久综合桃花| 一本大道av伊人久久综合| 在线观看精品一区| 精品国产麻豆免费人成网站| 亚洲欧洲精品一区二区精品久久久 | 精品粉嫩超白一线天av| 中文字幕在线不卡一区| 免费人成在线不卡| 91原创在线视频| 91精品国产一区二区三区蜜臀| 国产欧美日韩精品a在线观看| 亚洲国产一区二区视频| 精品一二三四在线| 欧美日韩精品一区二区三区四区 | 日韩亚洲电影在线| 亚洲欧洲综合另类| 国产一区999| 欧美一区二区三区的| 亚洲视频综合在线| 韩国欧美国产一区| 欧美日韩在线播放三区四区| 国产精品三级视频| 国产做a爰片久久毛片| 欧美午夜一区二区三区| 国产精品理伦片| 奇米影视一区二区三区小说| 色综合一个色综合| 中文字幕欧美激情| 加勒比av一区二区| 4438x亚洲最大成人网| 亚洲人成网站在线| 国产一区二区美女| 日韩精品中文字幕一区| 亚洲一区二区在线免费观看视频| 国产91丝袜在线播放| 欧美精品一区二区三区蜜桃| 日韩精品一二三四| 欧美日韩视频不卡| 一级做a爱片久久| 在线国产电影不卡| 自拍偷拍国产亚洲| 99久久精品国产精品久久| 日本一区二区动态图| 国产一区二区三区观看| 精品久久久久久久久久久久久久久 | 97se亚洲国产综合自在线观| 久久久久久一二三区| 精品一区二区三区免费观看 | 欧美日韩在线播放一区| 亚洲在线一区二区三区|