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

📄 cmras.h

📁 基于h323协议的软phone
💻 H
📖 第 1 页 / 共 3 页
字号:
    cmRASParamNeedResponse,                 /* RvBool                           */
    cmRASParamMaintainConnection,           /* RvBool                           */
    cmRASParamMultipleCalls,                /* RvBool                           */
    cmRASParamWillRespondToIRR,             /* RvBool                           */
    cmRASParamSupportsAltGk,                /* RvBool                           */
    cmRASParamAdditiveRegistration,         /* RvBool                           */
    cmRASParamSupportsAdditiveRegistration, /* RvBool                           */
    cmRASParamSegmentedResponseSupported,   /* RvBool                           */
    cmRASParamNextSegmentRequested,         /* int                              */
    cmRASParamCapacityInfoRequested,        /* RvBool                           */
    cmRASParamHopCount,                     /* int                              */
    cmRASParamInvalidTerminalAlias,         /* cmAlias                          */
    cmRASParamUnregReason,                  /* cmRASUnregReason                 */
    cmRASParamIrrStatus,                    /* int, cmRASIrrComplete,
                                               cmRASIrrIncomplete,
                                               cmRASIrrInvalidCall              */
    cmRASParamCallHandle,                   /* HCALL - set in svalue: the call
                                               handle of this transaction       */
    cmRASParamExtension,                    /* cmAlias                          */
    cmRASParamLast
} cmRASParam;




typedef struct
{
    cmTransportAddress  rasAddress;
    cmRASAlias          gatekeeperIdentifier;
    RvBool              needToRegister;
    RvUint8             priority;
}cmAlternateGatekeeper;

typedef enum
{
    cmRASErrorParamNotFound
} cmRASError;





/* Application's handle of a RAS transaction */
RV_DECLARE_HANDLE(HAPPRAS);

/* Stack's handle of a RAS transaction */
RV_DECLARE_HANDLE(HRAS);




/************************************************************************
 *
 *                              API functions
 *
 ************************************************************************/

/************************************************************************
 * cmRASStartTransaction
 * purpose: Create a RAS transaction.
 *          This function exchanges handles with the application and connects
 *          between the transaction and the call (if applicable).
 * input  : hApp        - Application's handle for a stack instance
 *          haRas       - Application's handle for the RAS transaction
 *          transaction - The transaction type we want to start
 *          destAddress - Address of the destination.
 *                        If set to NULL, then it's for the gatekeeper
 *          hsCall      - Stack's call handle if the transaction is related
 *                        to a call. NULL otherwise.
 * output : lphsRas     - The stack's RAS transaction handle that was
 *                        created.
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASStartTransaction(
    IN  HAPP             hApp,
    IN  HAPPRAS          haRas,
    OUT LPHRAS           lphsRas,
    IN  cmRASTransaction transaction,
    IN  cmRASTransport*  destAddress,
    IN  HCALL            hsCall);


/************************************************************************
 * cmRASSetHandle
 * purpose: Sets or changes the application handle for a RAS transaction.
 * input  : hsRas   - Stack's handle for the RAS transaction
 *          haRas   - Application's handle for the RAS transaction to be set
 * output : none
 * return : Non-negative value on success
 *          Negative value on failure
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASSetHandle(
    IN  HRAS            hsRas,
    IN  HAPPRAS         haRas);


/************************************************************************
 * cmRASGetParam
 * purpose: Get a parameter about the RAS transaction
 * input  : hsRas   - Stack's handle for the RAS transaction
 *          trStage - The transaction stage the parameters
 *          param   - Type of the RAS parameter
 *          index   - If the parameter has several instances, the index
 *                    that identifies the specific instance (0-based).
 *                    0 otherwise.
 *          value   - If the parameter value is a structure, the value
 *                    represents the length of the parameter.
 * output : value   - For a RvBool or int - the parameter's value.
 *                    For a structure - the length of the parameter.
 *          svalue  - For a structure - svalue represents the parameter
 *                    itself. Can be set to NULL if we're only interested
 *                    in its length.
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASGetParam(
    IN  HRAS             hsRas,
    IN  cmRASTrStage     trStage,
    IN  cmRASParam       param,
    IN  int              index,
    IN  OUT RvInt32*     value, /* value or length */
    IN  char*            svalue);


/************************************************************************
 * cmRASSetParam
 * purpose: Set a parameter about the RAS transaction
 * input  : hsRas   - Stack's handle for the RAS transaction
 *          trStage - The transaction stage the parameters
 *          param   - Type of the RAS parameter
 *          index   - If the parameter has several instances, the index
 *                    that identifies the specific instance (0-based).
 *                    0 otherwise.
 *          value   - For a RvBool or int - the parameter's value.
 *                    For a structure - the length of the parameter.
 *          svalue  - For a structure - svalue represents the parameter
 *                    itself.
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASSetParam(
    IN  HRAS             hsRas,
    IN  cmRASTrStage     trStage,
    IN  cmRASParam       param,
    IN  int              index,
    IN  RvInt32          value,
    IN  char*            svalue);


/************************************************************************
 * cmRASGetNumOfParams
 * purpose: Returns the number of params in sequences on the property
 *          tree.
 * input  : hsRas   - Stack's handle for the RAS transaction
 *          trStage - The transaction stage the parameters
 *          param   - Type of the RAS parameter
 * output : none
 * return : Number of params in sequence on the property tree on success
 *          Negative value on failure
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASGetNumOfParams(
    IN  HRAS             hsRas,
    IN  cmRASTrStage     trStage,
    IN  cmRASParam       param);


/************************************************************************
 * cmRASRequest
 * purpose: Send an outgoing RAS transaction
 * input  : hsRas       - Stack's handle for the RAS transaction
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASRequest(
    IN  HRAS             hsRas);


/************************************************************************
 * cmRASDummyRequest
 * purpose: Called after cmRASStartTransaction() on cmRASUnsolicitedIRR.
 *          It allows the application to wait for an unsolicited IRR on
 *          a specific call.
 * input  : hsRas       - Stack's handle for the RAS transaction
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASDummyRequest(
    IN  HRAS         hsRas);


/************************************************************************
 * cmRASConfirm
 * purpose: Sends a confirm response on an incoming RAS request
 * input  : hsRas       - Stack's handle for the RAS transaction
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASConfirm(
    IN  HRAS             hsRas);


/************************************************************************
 * cmRASReject
 * purpose: Sends a reject response on an incoming RAS request
 * input  : hsRas       - Stack's handle for the RAS transaction
 *          reason      - The reject reason to use
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASReject(
    IN  HRAS             hsRas,
    IN  cmRASReason      reason);


/************************************************************************
 * cmRASInProgress
 * purpose: Sends a RIP (ReplyInProgress) message on a transaction
 * input  : hsRas       - Stack's handle for the RAS transaction
 *          delay       - Delay to use in RIP message (in milliseconds)
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASInProgress(
    IN  HRAS         hsRas,
    IN  int          delay);


/************************************************************************
 * cmRASClose
 * purpose: Close a RAS transaction
 * input  : hsRas       - Stack's handle for the RAS transaction
 * output : none
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASClose(
    IN  HRAS             hsRas);






/************************************************************************
 * cmRASGetHandle
 * purpose: Returns the stack's handle of the transaction from the
 *          application's handle.
 *          This function is slow and should not be used frequently
 * input  : hApp        - Application's handle for a stack instance
 *          haRas       - Application's handle for the RAS transaction
 * output : lphsRas     - The stack's RAS transaction handle
 * return : If an error occurs, the function returns a negative value.
 *          If no error occurs, the function returns a non-negative value.
 ************************************************************************/
RVAPI
int RVCALLCONV cmRASGetHandle(
    IN  HAPP    hApp,
    IN  HAPPRAS haRas,
    OUT LPHRAS  hsRas);


/************************************************************************
 * cmRASGetTransaction
 * purpose: Returns the type of RAS transaction
 * input  : hsRas       - Stack's handle for the RAS transaction
 * output : transaction - The type of transaction

⌨️ 快捷键说明

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