📄 protocalapi.c
字号:
* otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetDoaminNameValidatione(H_STACK pStack, BOOL bOnOff){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->bCheckDomainName = bOnOff; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMax1Retries * * Description : Set the max1 retries in retransmission procedure * * Input parameters : pStack - Handle of the stack * wRetryValue - Retry value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMax1Retries(H_STACK pStack, WORD wRetryValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->wCounterMax1 = wRetryValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMax2Retries * * Description : Set the max2 retries in retransmission procedure * * Input parameters : pStack - Handle of the stack * wRetryValue - Retry value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMax2Retries(H_STACK pStack, WORD wRetryValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->wCounterMax2 = wRetryValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMaxRTO * * Description : Set the max RTO value of the stack. * * Input parameters : pStack - Handle of the stack * wRTOValue - Max RTO value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMaxRTO(H_STACK pStack, WORD wRTOValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->dwTimerMaxRTO = wRTOValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMaxInitRTO * * Description : Set the max initial RTO of the stack. * * Input parameters : pStack - Handle of the stack * wValue - Max initial RTO value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMaxInitRTO(H_STACK pStack, WORD wValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->dwTimerInitRTO = wValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetTimerMax * * Description : Set the MaxTimer value of the stack. * * Input parameters : pStack - Handle of the stack * wValue - Max timer value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetTimerMax(H_STACK pStack, WORD wValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->dwTimerMax = wValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpSackSetTimerHIST * * Description : Set the HIST timer value of the stack. * * Input parameters : pStack - Handle of the stack * wValue - HIST timer value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpSackSetTimerHIST(H_STACK pStack, WORD wValue){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->dwTimerHIST = wValue; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMax1LookUp * * Description : Set the if need loop up DNS when retries reach Max1 * * Input parameters : pStack - Handle of the stack * bOnOff - Whether need loop up DNS flag * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMax1LookUp(H_STACK pStack, BOOL bOnOff){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->bMax1LookUp = bOnOff; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetMax2LookUp * * Description : Set the if need loop up DNS when retries reach Max2 * * Input parameters : pStack - Handle of the stack * bOnOff - Whether need loop up DNS flag * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetMax2LookUp(H_STACK pStack, BOOL bOnOff){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->bMax2LookUp = bOnOff; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpSackSetThreeWayHandShake * * Description : Set the if use three way handshake procedure of the stack * * Input parameters : pStack - Handle of the stack * bOnOff - Whether use three way handshake procedure flag * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpSackSetThreeWayHandShake(H_STACK pStack, BOOL bOnOff){ H_MGCP_TRANSAC_MANAGER pTransacMng; Assert(pStack); pTransacMng = (H_MGCP_TRANSAC_MANAGER)(((MGCP_STACK*)pStack)->pTransacMng); Assert(pTransacMng); if (pTransacMng) { pthread_mutex_lock(&pTransacMng->pTranMngMutex); pTransacMng->bUseThreeWayHandShake = bOnOff; pthread_mutex_unlock(&pTransacMng->pTranMngMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetRestartMaxDelay * * Description : Set the restart max dealy value of the stack. * * Input parameters : pStack - Handle of the stack * dwMaxDelayValue - restart max dealy value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetRestartMaxDelay(H_STACK pStack, DWORD dwMaxDelayValue){ H_MGCP_ENDPOINT_CONTROL pEndpntCtrl; Assert(pStack); pEndpntCtrl = (H_MGCP_ENDPOINT_CONTROL)(((MGCP_STACK*)pStack)->pEndpointCtl); Assert(pEndpntCtrl); if (pEndpntCtrl) { pthread_mutex_lock(&pEndpntCtrl->pEndpoinCtrltMutex); pEndpntCtrl->dwMWD = dwMaxDelayValue; pthread_mutex_unlock(&pEndpntCtrl->pEndpoinCtrltMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetDisconnectInitialDelay * * Description : Set the disconnect initial dealy value of the stack. * * Input parameters : pStack - Handle of the stack * dwDelayValue - disconnect initial dealy value * * Output parameters : * * Return value : Return OK if the stack is configured successfully, * otherwise return FAIL. * * Comments : * * History : * 2005/12/16 : Creation * * Date : Dec 16 2005, Frank ZHANG ******************************************************************************/LONG MgcpStackSetDisconnectInitialDelay(H_STACK pStack, DWORD dwDelayValue){ H_MGCP_ENDPOINT_CONTROL pEndpntCtrl; Assert(pStack); pEndpntCtrl = (H_MGCP_ENDPOINT_CONTROL)(((MGCP_STACK*)pStack)->pEndpointCtl); Assert(pEndpntCtrl); if (pEndpntCtrl) { pthread_mutex_lock(&pEndpntCtrl->pEndpoinCtrltMutex); pEndpntCtrl->dwTdinit = dwDelayValue; pthread_mutex_unlock(&pEndpntCtrl->pEndpoinCtrltMutex); return OK; } return FAIL;}/****************************************************************************** * Function : MgcpStackSetDisconnectMinDelay * * Description : Set the disconnect min dealy value of the stack. * * Input parameters : pStack - Handle of the stack * dwDelayValue - Disconnect min dealy value
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -