📄 cmcallhighlevel.c
字号:
{
length = strlen(partyId);
if ((len-length-1-strlen(number)) > 0)
{
strcat(partyId,";");
strcat(partyId,number);
}
}
}
error=0;
}
cmiAPIExit(hApp, "cmCallGetCalledPartyId(callerId=%.100s)=%d", nprn(partyId), error);
return error;
}
RVAPI
int RVCALLCONV cmCallSetIndependentSupplementaryService(
IN HCALL hsCall
)
{
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallIndependentSupplementaryService(hsCall=0x%p)", hsCall);
if (cmCallGetOrigin(hsCall,NULL))
{
cmCallSetParam(hsCall,cmParamMultiRate,0,0,0);
cmCallSetParam(hsCall,cmParamConferenceGoal,0,cmCallIndependentSupplementaryService,0);
cmCallSetParam(hsCall,cmParamInformationTransferCapability,0,cmITCUnrestricted,0);
cmCallSetParam(hsCall,cmParamRequestedRate,0,0,0);
}
cmiAPIExit(hApp, "cmCallIndependentSupplementaryService=0");
return 0;
}
RVAPI
int RVCALLCONV cmCallAnswerExt(
IN HCALL hsCall,
IN char* display,
IN char* userUser,
IN int userUserSize)
{
int status = RV_ERROR_UNKNOWN;
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallAnswerExt(hsCall=0x%p,display=%.100s,userUser=,userUserSize=%d)", hsCall, nprn(display), userUserSize);
if (display)
cmCallSetParam((HCALL)hsCall,cmParamConnectDisplay,0,0,display);
if (userUser)
cmCallSetParam((HCALL)hsCall,cmParamConnectUserUser,0,userUserSize,userUser);
status = cmCallAnswer(hsCall);
cmiAPIExit(hApp, "cmCallAnswerExt=%d", status);
return status;
}
RVAPI
int RVCALLCONV cmCallAnswerDisplay(
IN HCALL hsCall,
IN char* display)
{
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallAnswerDisplay(hsCall=0x%p,display=%.100s)", hsCall, nprn(display));
cmCallAnswerExt(hsCall,display,NULL,0);
cmiAPIExit(hApp, "cmCallAnswerDisplay=0");
return 0;
}
RVAPI
int RVCALLCONV cmCallGetDisplayInfo(
IN HCALL hsCall,
OUT char* display,
IN int displaySize)
{
RvInt32 size=displaySize-1;
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallGetDisplayInfo(hsCall=0x%p,display,displaySize=%d)", hsCall, displaySize);
if (display && displaySize>0)
{
if (size)
display[0]=0;
cmCallGetParam((HCALL)hsCall,(cmCallGetOrigin(hsCall,NULL)?cmParamConnectDisplay:cmParamDisplay),0,(RvInt32*)&size,display);
if (size<displaySize)
display[size]=0;
}
cmiAPIExit(hApp, "cmCallGetDisplayInfo(%.100s)=%d", nprn(display), size);
return size;
}
RVAPI
int RVCALLCONV cmCallGetUserUserInfo(
IN HCALL hsCall,
OUT char* userUser,
IN int userUserSize)
{
RvUint32 size=userUserSize-1;
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallGetUserUserInfo(hsCall=0x%p,userUser,userUserSize=%d)", hsCall, userUserSize);
if (userUser)
{
cmCallGetParam((HCALL)hsCall,(cmCallGetOrigin(hsCall,NULL)?cmParamConnectUserUser:cmParamUserUser),0,(RvInt32*)&size,userUser);
}
cmiAPIExit(hApp, "cmCallGetUserUserInfo(%.16s)=%d", nprn(userUser), size);
return size;
}
RVAPI
int RVCALLCONV cmCallGetRemoteEndpointInfoHandle(
IN HCALL hsCall)
{
RvInt32 endpointInfo;
HAPP hApp;
cmCallParam param;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallGetRemoteEndpointInfoHandle(hsCall=0x%p)", hsCall);
if (cmCallGetOrigin(hsCall, NULL))
param = cmParamFullDestinationInfo;
else
param = cmParamFullSourceInfo;
cmCallGetParam(hsCall, param, 0, &endpointInfo, NULL);
cmiAPIExit(hApp, "cmCallGetRemoteEndpointInfoHandle=%d", endpointInfo);
return endpointInfo;
}
RVAPI
int RVCALLCONV cmCallGetLocalEndpointInfoHandle(
IN HCALL hsCall)
{
RvInt32 endpointInfo;
HAPP hApp;
cmCallParam param;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallGetLocalEndpointInfoHandle(hsCall=0x%p)", hsCall);
if (cmCallGetOrigin(hsCall, NULL))
param = cmParamFullSourceInfo;
else
param = cmParamFullDestinationInfo;
cmCallGetParam(hsCall, param, 0, &endpointInfo, NULL);
cmiAPIExit(hApp, "cmCallGetLocalEndpointInfoHandle=%d", endpointInfo);
return endpointInfo;
}
RVAPI
int RVCALLCONV cmGetEndpointInfoHandle(
IN HAPP hApp)
{
int endpointInfo;
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp,"cmGetEndpointInfoHandle(hApp=0x%p)",hApp);
__pvtGetNodeIdByFieldIds(endpointInfo,((cmElem*)hApp)->hVal,cmGetRASConfigurationHandle(hApp),
{_q931(registrationInfo)
_q931(terminalType)
LAST_TOKEN });
cmiAPIExit(hApp,"cmGetEndpointInfoHandle=%d",endpointInfo);
return endpointInfo;
}
RVAPI
int RVCALLCONV cmCallGetRate(
IN HCALL hsCall,
OUT RvUint32* rate)
{
HAPP hApp;
int _rate;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp,"cmCallGetRate(hsCall=0x%p,rate)", hsCall);
cmCallGetParam(hsCall,cmParamRate,0,&_rate,NULL);
cmiAPIExit(hApp, "cmCallGetRate(rate=%ld)=%d", _rate, 0);
if (rate) *rate=_rate;
return _rate;
}
RVAPI
int RVCALLCONV cmCallSetRate(
IN HCALL hsCall,
IN RvUint32 rate)
{
HAPP hApp;
hApp=cmGetAHandle((HPROTOCOL)hsCall);
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallSetRate(hsCall=0x%p,rate=%ld)", hsCall, rate);
cmCallSetParam(hsCall,cmParamRequestedRate,0,(RvInt32)rate,NULL);
if (cmiAutoRAS(hApp))
cmiAutoRASCallSetRate(hsCall,(int)rate);
else
if (!((cmElem *)hApp)->gatekeeper)
{
/* We're not a GK, and there's no automatic ras - notify application about it */
cmCallSetParam(hsCall,cmParamRate,0,(RvInt32)rate,NULL);
callNewRate((callElem *)hsCall);
}
cmiAPIExit(hApp, "cmCallSetRate=%d", 0);
return 0;
}
RVAPI
int RVCALLCONV cmCallOverlapSending(IN HCALL hsCall,char * address)
{
return cmCallOverlapSendingExt(hsCall,address,RV_FALSE);
}
RVAPI
int RVCALLCONV cmCallForward(
IN HCALL hsCall,
IN char* destAddress)
{
RvChar destA[512];
RvChar bmpStr[512];
RvChar* numPtr=NULL;
int id=0;
int i;
RvBool namedID=RV_TRUE;
RvChar* nextPtr=NULL;
HAPP hApp=cmGetAHandle((HPROTOCOL)hsCall);
RvChar delimiter;
if (!hApp || !hsCall) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmCallForward(hsCall=0x%p,destAddr=%.100s)", hsCall, nprn(destAddress));
delimiter=cmGetDelimiter(hApp);
strncpy(destA,destAddress,sizeof(destA));
numPtr=destA;
id=0;
while(numPtr&&namedID)
{
int iDelimiter = delimiter;
namedID=RV_FALSE;
nextPtr=(RvChar*) strchr(numPtr,iDelimiter);
{
cmAlias alias;
while(isspace((int)*numPtr)) numPtr++;
if (nextPtr)
{
*nextPtr=0;
nextPtr++;
}
if (insertAlias(&numPtr,&alias,bmpStr) >= 0)
{
namedID=RV_TRUE;
cmCallSetParam(hsCall,cmParamAlternativeAliasAddress,id++,0,(char *)&alias);
}
else if (!strncmp("EXT:",numPtr,4))
{
namedID=RV_TRUE;
numPtr+=4;
alias.string=numPtr;
alias.length=(RvUint16)strlen(alias.string);
alias.type=cmAliasTypeE164;
cmCallSetParam(hsCall,cmParamAlternativeExtension,0,0,(char *)&alias);
}
else
if (!strncmp("EXTID:",numPtr,6))
{
namedID=RV_TRUE;
numPtr+=6;
alias.type=cmAliasTypeH323ID;
alias.length=(RvUint16)utlChr2Bmp(numPtr, (RvUint8*)bmpStr);
alias.string=bmpStr;
cmCallSetParam(hsCall,cmParamAlternativeExtension,0,0,(char *)&alias);
}
else
if (strlen(numPtr)==strspn(numPtr,"0123456789,#*;"))
{
i=-1;
while(numPtr)
{
alias.string=numPtr;
numPtr=(RvChar*) strchr(numPtr,';');
if (numPtr)
{
*numPtr=0;
numPtr++;
}
alias.type=cmAliasTypeE164;
alias.length=(RvUint16)strlen(alias.string);
cmCallSetParam((HCALL)hsCall,(i<0)?cmParamAlternativeAliasAddress:cmParamAlternativeDestExtraCallInfo,(i<0)?id++:i,sizeof(cmAlias),(char*)&alias);
i++;
}
alias.string=numPtr;
break;
}
}
if (!strncmp("TA:",numPtr,3))
{
cmTransportAddress qAddress;
RvAddress addr;
namedID=RV_TRUE;
numPtr+=3;
memset(&qAddress, 0, sizeof(qAddress));
qAddress.ip = cmTransportTypeIP;
qAddress.port = 1720;
if (stringToCoreAddress(numPtr, &addr) == RV_OK)
{
RvH323CoreToCmAddress(&addr, &qAddress);
RvAddressDestruct(&addr);
}
if (qAddress.port == 0)
qAddress.port = 1720;
cmCallSetParam((HCALL)hsCall,cmParamAlternativeAddress,0,
sizeof(cmTransportAddress),(char*)&qAddress);
}
if (namedID)
numPtr=nextPtr;
}
cmCallSetParam((HCALL)hsCall,cmParamFacilityReason,0,cmReasonTypeCallForwarded,NULL);
cmCallFacility(hsCall,-1);
cmiAPIExit(hApp, "cmCallForward()=0");
return 0;
}
#ifdef __cplusplus
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -