📄 protocalapi.h
字号:
/****************************************************************************** Copyright(C) 2005,2006 Frank ZHANG All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ****************************************************************************** If you want to distribute this software with modifications under any terms other than the GPL or distribute the software linked with proprietary applications that are not distributed in full compliance with the GNU Public License, a Commercial License is needed. Commercial licensing and support of this software are available at a fee. For more information, See http://www.openmgcp.org ******************************************************************************//******************************************************************************* Authors : Frank ZHANG* Description : *** Date of creation : 08/03/2005*** History :* 2005/08/03 Frank ZHANG : - Creation******************************************************************************/#ifndef __PROTOCALAPI_H__#define __PROTOCALAPI_H__#include "typedef.h"#include "debg.h"#include "mgcpdef.h"#ifdef __cplusplusextern "C" {#endiftypedef DWORD H_STACK;typedef DWORD H_ENDPOINT;/* Callback message data from mgcp stack to application */typedef enum{ MGCP_CBK_MSG_CREATRE_CONNECTION = 1, /* CRCX command, need response */ MGCP_CBK_MSG_MODIFY_CONNECTION, /* MDCX command, need response */ MGCP_CBK_MSG_DELETE_CONNECTION, /* DLCX command, need no response */ MGCP_CBK_MSG_CONFIG_ENDPOINT, /* EPCF command, need no response*/ MGCP_CBK_MSG_RESTART_STATE, /* Restart result, need no response */ MGCP_CBK_MSG_SIGNAL_REQUEST, /* Signal request, need no response */ MGCP_CBK_MSG_EXPERIMENTAL_PARM /* Experimental Parameters */} E_MGCP_CBK_MSG_CODE;/* Create connection CBK message data */typedef struct{ DWORD dwTransacID; /* Transaction ID */ char *pcCallId; /* Call ID of the connection */ DWORD dwConnectionID; /* Connection ID */ LOCAL_CONNEC_OPTS *pLocalConnecOpt; /* Connection options */ CONNECTION_MODE *pMode; /* Connection mode */ CONNECTION_DESCRIPTOR *pRemoteConnectDescrpt; H_ENDPOINT pSecondEndpoint; /* Either of RemoteConnDes or SecondEndpnt must be include if connection mode is send mode */ DWORD dwSecondConnID; /* When second endpoint ID is used, the second connection id must be assigned by stack */ EXPERIMENTAL_PARAMS *pExperiParamList;} MGCP_CBK_CRCX;/* Modify connection CBK message data */typedef struct{ char *pcCallId; /* Call ID of the connection */ DWORD dwConnectionID; /* Connection ID of the call */ LOCAL_CONNEC_OPTS *pLocalConnecOpt; /* Connection parameters */ CONNECTION_MODE *pMode; /* Connection mode */ CONNECTION_DESCRIPTOR *pRemoteConnectDescrpt; EXPERIMENTAL_PARAMS *pExperiParamList;} MGCP_CBK_MDCX;/* Delete connection CBK message data */typedef struct{ DWORD wConnectionNum; /* Connection number to be deleted in the connection ID list*/ DWORD *pdwConnecIdList; /* Connection ID list */ /* Connection parameters returned by application if delet specific connection */ CONNECTION_PARAMETERS ConnectionParams; EXPERIMENTAL_PARAMS *pExperiParamList;} MGCP_CBK_DLCX;/* Confige endpoint CBK message data */typedef struct{ BEARER_INFO *pBearerInfo; EXPERIMENTAL_PARAMS *pExperiParamList;} MGCP_CBK_EPCF;/* Restart state CBK message data */typedef enum{ RESTART_STATE_CONNECTED = 1, RESTART_STATE_DISCONNECTED} MGCP_CBK_LINK_STATE;/* Signale request CBK message data */typedef struct{ E_MGCP_PACKAGE ePkgID; E_MGCP_EVENT eSigID; DWORD dwConnecID; EVENT_PARAMETERS *pSigParamList; /* Signal parameters */ DWORD dwSigDuration; /* Signal duration, for TO signal, it is the actual duration; for OO signal, 0 means switch off the signal, none 0 means switch on the signal; for BR signal, this value is meaningless */} MGCP_CBK_SIG_REQ;typedef struct{ EXPERIMENTAL_PARAMS *pExperiParamList;} MGCP_CBK_EXPERIMENTAL_PARAM;typedef struct{ E_MGCP_CBK_MSG_CODE eType; union { MGCP_CBK_CRCX CbkCreateConnection; MGCP_CBK_MDCX CbkModifyConnection; MGCP_CBK_DLCX CbkDeleteConnection; MGCP_CBK_EPCF CbkConfigEndpoint; MGCP_CBK_SIG_REQ CbkSignaleRequest; MGCP_CBK_LINK_STATE CbkRestartState; MGCP_CBK_EXPERIMENTAL_PARAM CbkExperiParam; } u;} MGCP_CBK_MSG;/* Callback function of the stack to nofify the application incoming MGCP command/response, return OK if the application accept the incoming MSG, otherwise return FAIL and the return the MGCP response code */typedef LONG (*CBK_MGCP_STACK)(H_ENDPOINT hEndpointHandle, MGCP_CBK_MSG *pCbkMsg, WORD *pwErrorCode);/* Callback function to check the signal validity, such as if it is supported by this endpoint, hook state is preconditioned, if it is embedded signal request, the hook state must not be checked; return OK if the signal is valid, otherwise return FAIL */typedef LONG (*CBK_SIG_CHECK)(H_ENDPOINT hEndpointHandle, MGCP_EVENT_ID *pSigID, BOOL bEmbeddedRqnt, WORD *pwErrorCode);/* Callback function to get the connection paramters */typedef void (*CBK_GET_CONNEC_PARAMS)(H_ENDPOINT hEndpointHandle, DWORD dwConnecID, CONNECTION_PARAMETERS *pConnecParams);LONG MgcpStackCreate(H_STACK *ppStack, CBK_MGCP_STACK pCbkNotfyApp, CBK_GET_CONNEC_PARAMS pCbkGetConnParams);LONG MgcpStackStart(H_STACK pStack);void MgcpStackDestroy(H_STACK pStack);LONG MgcpStackSetNetwork(H_STACK pStack, DWORD dwLocalIPAddr, WORD wPort);LONG MgcpStackSetDomainName(H_STACK pStack, char *pcDomainName);LONG MgcpStackRegisterEndpoint(H_STACK pStack, H_ENDPOINT *ppEndpoint, char *pcEndpointName, CBK_SIG_CHECK pCbkSigCheck);LONG MgcpStackSetDoaminNameValidatione(H_STACK pStack, BOOL bOnOff);LONG MgcpStackSetMax1Retries(H_STACK pStack, WORD wRetryValue);LONG MgcpStackSetMax2Retries(H_STACK pStack, WORD wRetryValue);LONG MgcpStackSetMaxRTO(H_STACK pStack, WORD wRTOValue);LONG MgcpStackSetMaxInitRTO(H_STACK pStack, WORD wValue);LONG MgcpStackSetTimerMax(H_STACK pStack, WORD wValue);LONG MgcpSackSetTimerHIST(H_STACK pStack, WORD wValue);LONG MgcpStackSetMax1LookUp(H_STACK pStack, BOOL bOnOff);LONG MgcpStackSetMax2LookUp(H_STACK pStack, BOOL bOnOff);LONG MgcpSackSetThreeWayHandShake(H_STACK pStack, BOOL bOnOff);LONG MgcpStackSetRestartMaxDelay(H_STACK pStack, DWORD dwMaxDelayValue);LONG MgcpStackSetDisconnectInitialDelay(H_STACK pStack, DWORD dwDelayValue);LONG MgcpStackSetDisconnectMinDelay(H_STACK pStack, DWORD dwDelayValue);LONG MgcpStackSetDisconnectMaxDelay(H_STACK pStack, DWORD dwDelayValue);LONG MgcpStackSetRetureUnsupportPackages(H_STACK pStack, BOOL bOnOff);LONG MgcpEndpointSetCallAgent(H_ENDPOINT pEndpoint, char *pcCaName, WORD wPort);LONG MgcpEndpointAddSupportedPackage(H_ENDPOINT pEndpoint, E_MGCP_PACKAGE ePackage);LONG MgcpEndpointRemoveSupportedPackage(H_ENDPOINT pEndpoint, E_MGCP_PACKAGE ePackage);void MgcpEndpointClearSupportedPackages(H_ENDPOINT pEndpoint);LONG MgcpEndpointSetDefaultPackage(H_ENDPOINT pEndpoint, E_MGCP_PACKAGE ePackage);LONG MgcpEndpointAddCodecCapability(H_ENDPOINT pEndpoint, MGCP_CODEC *pCabability);void MgcpEndpointClearCodecCapability(H_ENDPOINT pEndpoint);LONG MgcpEndpointSetRestartDealy(H_ENDPOINT pEndpoint, DWORD dwRestartDelay);LONG MgcpEndpointAddPersistentEvent(H_ENDPOINT pEndpoint, E_MGCP_PACKAGE ePkgID, E_MGCP_EVENT eEventID);void MgcpEndpointClearPersistentEvents(H_ENDPOINT pEndpoint);LONG MgcpEndpointNotifyEvent(H_ENDPOINT pEndpoint, MGCP_OBSERVED_EVENT *pEvent, EXPERIMENTAL_PARAMS *pExperiParamList);LONG MgcpEndpointDelConnection(H_ENDPOINT pEndpoint, char *pcCallId, DWORD dwConnecId, WORD wReasonCode, CONNECTION_PARAMETERS *pConnecParam, EXPERIMENTAL_PARAMS *pExperiParams);LONG MgcpEndpointAcceptCRCX(H_ENDPOINT pEndpoint, DWORD dwConnecID, CONNECTION_DESCRIPTOR *pLocalConnecDesc, EXPERIMENTAL_PARAMS *pExperParam);LONG MgcpEndpointRejectCRCX(H_ENDPOINT pEndpoint, DWORD dwConnecID, WORD wRspCode, EXPERIMENTAL_PARAMS *pExperParam);LONG MgcpEndpointAcceptMDCX(H_ENDPOINT pEndpoint, DWORD dwConnecID, CONNECTION_DESCRIPTOR *pLocalConnecDesc, EXPERIMENTAL_PARAMS *pExperParam);LONG MgcpEndpointRejectMDCX(H_ENDPOINT pEndpoint, DWORD dwConnecID, WORD wRspCode, EXPERIMENTAL_PARAMS *pExperParam);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -