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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? faststart.c

?? 基于h323協議的軟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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜不卡在线观看免费| 国产综合色在线| 欧美亚洲高清一区| 夜夜揉揉日日人人青青一国产精品| 在线免费观看视频一区| 亚洲国产精品嫩草影院| 91精品国产综合久久婷婷香蕉 | 欧美一区二区视频免费观看| 日本va欧美va瓶| 国产喂奶挤奶一区二区三区| 白白色亚洲国产精品| 亚洲三级视频在线观看| 欧美日韩一区二区三区不卡 | 亚洲欧美色图小说| 欧美日韩一级视频| 激情图片小说一区| 亚洲欧美另类在线| 欧美一区二区免费| 成人午夜激情视频| 午夜电影网一区| 久久久久久夜精品精品免费| a美女胸又www黄视频久久| 亚洲国产一区二区三区| 久久综合色之久久综合| 色综合婷婷久久| 精品午夜一区二区三区在线观看| 国产精品色一区二区三区| 欧美日韩一卡二卡三卡| 国产成人啪午夜精品网站男同| 亚洲综合成人在线视频| 久久天天做天天爱综合色| 欧美最猛性xxxxx直播| 国产在线一区二区综合免费视频| √…a在线天堂一区| 精品美女在线播放| 在线视频亚洲一区| 激情五月播播久久久精品| 亚洲综合激情网| 欧美激情综合五月色丁香| 欧美老肥妇做.爰bbww| 成人深夜在线观看| 精品一区二区三区av| 亚洲主播在线观看| 国产精品区一区二区三区| 日韩欧美一二三四区| 欧美自拍丝袜亚洲| www.综合网.com| 9人人澡人人爽人人精品| 免费精品视频最新在线| 亚洲一区av在线| 中文字幕综合网| 国产日韩成人精品| 欧美精品一区二区久久久| 欧美日韩一区国产| 91麻豆自制传媒国产之光| 国产美女主播视频一区| 麻豆一区二区三| 视频一区中文字幕国产| 亚洲欧美另类在线| 亚洲色图一区二区| 最新国产の精品合集bt伙计| 久久久国产午夜精品| 欧美成人伊人久久综合网| 欧美精品久久99久久在免费线| 91国偷自产一区二区使用方法| 波多野结衣在线一区| 国产激情一区二区三区| 国产麻豆精品在线观看| 国产在线视视频有精品| 狠狠狠色丁香婷婷综合激情| 久久精品久久久精品美女| 另类小说综合欧美亚洲| 久久精品国产一区二区三| 日本成人在线电影网| 免费看欧美女人艹b| 美腿丝袜亚洲色图| 国产资源精品在线观看| 国产精品一二三在| 成人亚洲一区二区一| 99久久伊人精品| 94色蜜桃网一区二区三区| 91在线视频网址| 91麻豆免费看片| 欧美午夜一区二区三区免费大片| 精品污污网站免费看| 欧美午夜精品久久久久久孕妇 | 99久久精品久久久久久清纯| 成人精品一区二区三区中文字幕| 成人av电影在线观看| 99久久国产综合精品色伊| 精品国产乱码久久久久久老虎| 欧美一级日韩免费不卡| 精品av久久707| 国产精品欧美极品| 亚洲综合av网| 精品制服美女久久| 国产成人午夜高潮毛片| 成av人片一区二区| 在线亚洲一区二区| 日韩你懂的在线播放| 久久久久久久久伊人| 国产精品动漫网站| 午夜免费欧美电影| 国产一区二区电影| 一本一道久久a久久精品综合蜜臀| 在线视频国内一区二区| 日韩一区二区免费在线电影| 久久新电视剧免费观看| 亚洲欧美色一区| 日韩av在线发布| 成人免费毛片app| 555夜色666亚洲国产免| 久久五月婷婷丁香社区| 一区二区三区在线高清| 久久国产乱子精品免费女| 99精品久久久久久| 欧美精品日韩精品| 国产精品第四页| 免费久久精品视频| 色老头久久综合| 亚洲精品一区二区三区影院 | 高清不卡一区二区| 欧美色网站导航| 中文字幕欧美激情一区| 香蕉影视欧美成人| jlzzjlzz亚洲日本少妇| 91精品国产综合久久精品麻豆| 国产精品久久久久久久蜜臀| 婷婷久久综合九色国产成人| av一区二区三区四区| 91精品国产综合久久福利软件 | 91久久香蕉国产日韩欧美9色| 欧美va亚洲va| 亚洲一区欧美一区| 99久久婷婷国产综合精品| 日韩一区二区三区免费看| 亚洲男人天堂av网| 国产69精品一区二区亚洲孕妇| 欧美日本在线播放| 一区二区在线免费| 成人午夜视频网站| 久久男人中文字幕资源站| 日韩精品一卡二卡三卡四卡无卡 | 在线观看精品一区| 国产精品久久三区| 国产福利一区二区三区视频| 欧美一区二区三区在线观看视频 | 午夜精品成人在线| 色欧美片视频在线观看| 国产色爱av资源综合区| 久久www免费人成看片高清| 欧美日本一区二区三区四区| 有坂深雪av一区二区精品| 9i看片成人免费高清| 国产欧美一区二区在线观看| 国产乱对白刺激视频不卡| 久久一区二区三区四区| 久久精品国产一区二区三 | 亚洲成人av在线电影| 91视频精品在这里| 国产精品久久久久久久午夜片| 国产91在线|亚洲| 国产精品理论片| av网站一区二区三区| 国产精品二三区| 99re免费视频精品全部| 国产精品传媒在线| 97国产一区二区| 亚洲婷婷国产精品电影人久久| av成人老司机| 亚洲少妇30p| 欧美性色综合网| 日本成人在线不卡视频| 日韩欧美一区二区三区在线| 免费高清不卡av| 久久综合久久鬼色中文字| 国产一区二区看久久| 中文字幕av一区二区三区免费看| 床上的激情91.| 一区二区三区在线观看国产| 欧美日韩www| 精品一二三四在线| 中文字幕精品一区二区三区精品| 9i在线看片成人免费| 亚洲小说春色综合另类电影| 91麻豆精品国产自产在线| 久久99在线观看| 中文字幕中文字幕一区| 91福利视频在线| 免费视频最近日韩| 国产精品污污网站在线观看| 91久久一区二区| 韩国一区二区在线观看| 亚洲欧洲中文日韩久久av乱码| 欧美在线观看视频在线| 精品一区二区成人精品| 亚洲欧美在线aaa| 欧美一区二区在线视频| 国产成人免费在线视频| 亚洲国产精品久久艾草纯爱 |