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

📄 cmparam.c

📁 基于h323协议的软phone
💻 C
📖 第 1 页 / 共 5 页
字号:
 *          hold parameters without a properties database.
 * input  : app         - Stack instance handle
 * output : none
 * return : non-negative value on success
 *          negative value on failure
 ************************************************************************/
int endParamSyntax(IN cmElem*  app)
{
    int i;
    for (i = 0; i < cmParamSynLast; i++)
        if (app->synParams[i] != NULL)
            pstDestruct(app->synParams[i]);
        return 0;
}



/************************************************************************
 * getParamMessage
 * purpose: Return the message the parameter belongs to
 * input  : param   - Call parameter
 * output : none
 * return : Message fieldID value on success
 *          Negative value on failure
 ************************************************************************/
static RvPstFieldId getParamMessage(IN  cmCallParam       param)
{
    switch(param)
    {
        case cmParamSourceAddress          :
        case cmParamDestinationAddress     :
        case cmParamFullSourceAddress      :
        case cmParamFullDestinationAddress :
        case cmParamDestExtraCallInfo      :
        case cmParamCalledPartyNumber      :
        case cmParamCalledPartySubAddress  :
        case cmParamCallingPartyNumber     :
        case cmParamCallingPartySubAddress :
        case cmParamExtension              :
        case cmParamFullSourceInfo         :
        case cmParamSourceInfo             :
        case cmParamDestCallSignalAddress  :
        case cmParamSrcCallSignalAddress   :
        case cmParamSetupH245Address       :
        case cmParamActiveMc               :
        case cmParamConferenceGoal         :
        case cmParamCallType               :
        case cmParamInformationTransferCapability :
        case cmParamDisplay                :
        case cmParamUserUser               :
        case cmParamSetupNonStandardData   :
        case cmParamSetupNonStandard       :
        case cmParamSetupFastStart         :
        case cmParamSetupCanOverlapSending :
        case cmParamSetupSendingComplete   :
        case cmParamFullDestExtraCallInfo  :
        case cmParamFullExtension          : return __q931(setup);

        case cmParamCallProcH245Address    :
        case cmParamCallProceedingNonStandardData:
        case cmParamCallProceedingNonStandard:
        case cmParamCallProcFastStart      : return __q931(callProceeding);

        case cmParamAlertingH245Address    :
        case cmParamAlertingNonStandardData:
        case cmParamAlertingNonStandard    :
        case cmParamAlertingFastStart      : return __q931(alerting);

        case cmParamH245Address            :
        case cmParamConnectDisplay         :
        case cmParamConnectUserUser        :
        case cmParamConnectNonStandardData :
        case cmParamConnectNonStandard     :
        case cmParamConnectFastStart       :
        case cmParamConnectedAddress       : return __q931(connect);

        case cmParamReleaseCompleteReason  :
        case cmParamReleaseCompleteCause   :
        case cmParamReleaseCompleteNonStandardData:
        case cmParamReleaseCompleteNonStandard
                                           : return __q931(releaseComplete);

        case cmParamAlternativeAddress     :
        case cmParamAlternativeAliasAddress:
        case cmParamAlternativeDestExtraCallInfo:
        case cmParamAlternativeExtension   :
        case cmParamFacilityCID            :
        case cmParamFacilityReason         : return __q931(facility);
        default                            : break;
    }
    return RV_ERROR_UNKNOWN;
}



/************************************************************************
 * getParamPlace
 * purpose: Return the place inside the Q931 message that the parameter
 *          belongs to. This function shortens the amount of PVT nodes that
 *          are accessed when building a message from scratch if the
 *          property DB of the call is not used.
 * input  : param   - Call parameter to check
 * output : none
 * return : Place of parameter in message on success
 *          Negative value on failure
 ************************************************************************/
static paramPlace getParamPlace(IN  cmCallParam       param)
{
    switch(param)
    {
        case cmParamSetupSendingComplete   :
        case cmParamInformationTransferCapability :

        case cmParamDisplay                :
        case cmParamCalledPartyNumber      :
        case cmParamCalledPartySubAddress  :
        case cmParamCallingPartyNumber     :
        case cmParamCallingPartySubAddress :
        case cmParamConnectDisplay         :
        case cmParamReleaseCompleteCause   :
                                             return placeQ931;
        case cmParamSourceAddress          :
        case cmParamDestinationAddress     :
        case cmParamFullSourceAddress      :
        case cmParamFullDestinationAddress :
        case cmParamDestExtraCallInfo      :
        case cmParamExtension              :

        case cmParamFullSourceInfo         :
        case cmParamSourceInfo             :


        case cmParamDestCallSignalAddress  :
        case cmParamSrcCallSignalAddress   :
        case cmParamSetupH245Address       :

        case cmParamActiveMc               :
        case cmParamConferenceGoal         :
        case cmParamCallType               :

        case cmParamSetupFastStart         :
        case cmParamSetupCanOverlapSending :

        case cmParamCallProcFastStart      :


        case cmParamAlertingH245Address    :
        case cmParamCallProcH245Address    :
        case cmParamAlertingFastStart      :
        case cmParamH245Address            :
        case cmParamConnectFastStart       :
        case cmParamReleaseCompleteReason  :
        case cmParamAlternativeAddress     :
        case cmParamAlternativeAliasAddress:
        case cmParamAlternativeDestExtraCallInfo
                                           :
        case cmParamAlternativeExtension   :
        case cmParamFacilityCID            :
        case cmParamFacilityReason         :
        case cmParamConnectedAddress       : return placePER_Specific;

        case cmParamUserUser               :

        case cmParamSetupNonStandardData   :
        case cmParamSetupNonStandard       :

        case cmParamCallProceedingNonStandardData:
        case cmParamCallProceedingNonStandard:


        case cmParamAlertingNonStandardData:
        case cmParamAlertingNonStandard    :
        case cmParamConnectUserUser        :
        case cmParamConnectNonStandardData :
        case cmParamConnectNonStandard     :
        case cmParamReleaseCompleteNonStandardData:
        case cmParamReleaseCompleteNonStandard   : return placePER_Gen;

        default:break;
    }
    return (paramPlace)RV_ERROR_UNKNOWN;
}

/************************************************************************
 * getFirstMessageParameterNumber
 * purpose: Get the enumeration value of the first parameter for the given
 *          type of message.
 *          This function is used when we're not using any property DB.
 * input  : messageType - Type of message to get
 * output : none
 * return : First parameter enumerataion value for the given message type on success
 *          Negative value on failure
 ************************************************************************/
static cmCallParamEnum getFirstMessageParameterNumber(cmCallQ931MsgType messageType)
{
    switch(messageType)
    {
        case cmQ931setup            : return cmEnumSetupSendingComplete;
        case cmQ931callProceeding   : return cmEnumCallProcH245Address;
        case cmQ931connect          : return cmEnumH245Address;
        case cmQ931alerting         : return cmEnumAlertingH245Address;
        case cmQ931releaseComplete  : return cmEnumReleaseCompleteReason;
        case cmQ931facility         : return cmEnumAlternativeAddress;
        default                     : break;
    }
    return (cmCallParamEnum)RV_ERROR_UNKNOWN;
}


/************************************************************************
 * getParamSyntax
 * purpose: Get the syntax tree to use for a specific parameter
 *          enumeration.
 *          This function is used when we're not using any property DB.
 * input  : app         - Stack instance to use
 *          paramNumber - Property enumeration to convert
 * output : none
 * return : Syntax tree handle on success
 *          NULL on failure
 ************************************************************************/
static HPST getParamSyntax(
    IN  cmElem*         app,
    IN  cmCallParamEnum paramNumber)
{
    switch (paramNumber)
    {
        /* Simple types can be handled with any syntax. They will get their syntax
           when we add the parameters themselves to the outgoing messages. Since they
           are the root values, the syntax won't help - so we just ignore it... */

        /* Boolean */
        case cmEnumSetupSendingComplete             :
        case cmEnumActiveMc                         :
        case cmEnumSetupCanOverlapSending           : return app->synProtQ931;

        /* Integer */
        case cmEnumInformationTransferCapability    :
        case cmEnumReleaseCompleteCause             : return app->synProtQ931;

        /* String */
        case cmEnumDisplay                          :
        case cmEnumSetupFastStart                   :
        case cmEnumCallProcFastStart                :
        case cmEnumAlertingFastStart                :
        case cmEnumConnectDisplay                   :
        case cmEnumConnectFastStart                 :
        case cmEnumFacilityCID                      : return app->synProtQ931;

        /* CalledPartyNumber */
        case cmEnumCalledPartyNumber                : return app->synParams[cmParamSynCalledPartyNumber];

        /* CalledPartySubaddress */
        case cmEnumCalledPartySubAddress            : return app->synParams[cmParamSynCalledSubaddress];

        /* CallingPartyNumber */
        case cmEnumCallingPartyNumber               : return app->synParams[cmParamSynCallingPartyNumber];

        /* CallingPartySubaddress */
        case cmEnumCallingPartySubAddress           : return app->synParams[cmParamSynCallingSubaddress];

        /* AliasAddress */
        case cmEnumDestExtraCallInfo                :

⌨️ 快捷键说明

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