当前位置: 首页>>代码示例>>C++>>正文


C++ CC_CallPtr::getCallInfo方法代码示例

本文整理汇总了C++中CC_CallPtr::getCallInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CC_CallPtr::getCallInfo方法的具体用法?C++ CC_CallPtr::getCallInfo怎么用?C++ CC_CallPtr::getCallInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CC_CallPtr的用法示例。


在下文中一共展示了CC_CallPtr::getCallInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleRemoveVideoFromConnectedCall

static void handleRemoveVideoFromConnectedCall( CallControlManagerPtr ccmPtr)
{
    CC_CallPtr call = getFirstCallInGivenState(ccmPtr, CONNECTED);

    if(call != NULL)
    {
		if(call->getCallInfo()->hasCapability(CC_CallCapabilityEnum::canUpdateVideoMediaCap))
		{
			if(call->updateVideoMediaCap(CC_SDP_DIRECTION_INACTIVE))
			{
				CSFLogDebugS(logTag, "Removed video from first connected call.");
			}
			else
			{
				CSFLogDebugS(logTag, "Failed to remove video from first connected call.");
			}
		}
		else
		{
			CSFLogDebugS(logTag, "Cannot add video to this call - capability not currently available.");
		}
    }
    else
    {
    	CSFLogDebugS(logTag, "No currently connected calls, cannot remove video.");
    }
}
开发者ID:kennych,项目名称:ikran,代码行数:27,代码来源:testapp.cpp

示例2: handleUnmuteVideoForFirstConnectedCall

static void handleUnmuteVideoForFirstConnectedCall (CallControlManagerPtr ccmPtr)
{
    //If there is more than 1 call with a mix of audio/video calls
    //the we may need to look at the cc_sdp_direction_t to figure out
    //which CONNECTED call is actually a video call and is sending video
    CC_CallPtr call = getFirstCallInGivenState(ccmPtr, CONNECTED);

    if (call != NULL)
    {
    	CSFLogDebugS(logTag, "Unmuting (video) 1st connected call...");
    	if (!call->unmuteVideo())
    	{
    		CSFLogDebugS(logTag, "Attempt to unmute (video) failed.");
    	}
        CC_CallInfoPtr info = call->getCallInfo();
        if (info->isVideoMuted())
        {
        	CSFLogDebugS(logTag, "UNMUTE FAILED TO BE REFLECTED IN CALL INFO.");
        }
    }
    else
    {
    	CSFLogDebugS(logTag, "No calls exist that can be unmuted (video).");
    }
}
开发者ID:kennych,项目名称:ikran,代码行数:25,代码来源:testapp.cpp

示例3: awaitCallCapability

//Returns true if given capability is available on entry to this function, or became
//available within the specified timeframe
bool awaitCallCapability (CC_CallPtr call, CC_CallCapabilityEnum::CC_CallCapability capToWaitFor, int timeoutMilliSeconds)
{
    int nTimeStart = GetTimeNow();
    int remainingTimeout = timeoutMilliSeconds;

    do
    {
        CC_CallInfoPtr info = call->getCallInfo();

        if (info != NULL)
        {
            if (info->hasCapability(capToWaitFor))
            {
                return true;
            }
        }
        else
        {
        	CSFLogDebugS(logTag, "CC_CallPtr->getCallInfo() failed");
            return false;
        }

        int nTimeElapsed = GetTimeElapsedSince( nTimeStart );
        remainingTimeout -= nTimeElapsed;
    } while (_callCapsMayHaveChanged.TimedWait(base::TimeDelta::FromMilliseconds(remainingTimeout)));

    return false;
}
开发者ID:kennych,项目名称:ikran,代码行数:30,代码来源:testapp.cpp

示例4: printCallSummary

void printCallSummary(CC_DevicePtr devicePtr)
{
    if (devicePtr == NULL)
    {
        return;
    }

    CC_DeviceInfoPtr deviceInfoPtr = devicePtr->getDeviceInfo();

    if (deviceInfoPtr == NULL)
    {
        return;
    }

    vector<CC_CallPtr> calls = deviceInfoPtr->getCalls();

    CSFLogDebugS(logTag, " List of all calls ");
    for (vector<CC_CallPtr>::iterator it = calls.begin(); it != calls.end(); it++)
    {
        CC_CallPtr call = *it;

        if (call==NULL)
        {
            continue;
        }

        CC_CallInfoPtr callInfoPtr = call->getCallInfo();

        if (callInfoPtr==NULL)
        {
            continue;
		}
        bool audioMute = callInfoPtr->isAudioMuted();
        bool videoMute = callInfoPtr->isVideoMuted();
        
        PRINT_OFFSET_1;
        PRINT_EVENT_INFO_NICELY_USING_GETNAME("CallState", callInfoPtr, getCallState, call_state_getname);
        PRINT_OFFSET_1;
        PRINT_EVENT_INFO_NICELY_USING_GETNAME("CallType", callInfoPtr, getCallType, call_type_getname);
        PRINT_OFFSET_1;
        PRINT_EVENT_INFO_NICELY_USING_GETNAME("VideoDirection", callInfoPtr, getVideoDirection, sdp_direction_getname);
        PRINT_OFFSET_1;
        CSFLogDebugS(logTag, "(AudioMute ");
        CSFLogDebugS(logTag, "----------");
        CSFLogDebug(logTag, " %s )", (audioMute) ? "true" : "false");
        PRINT_OFFSET_1;
        CSFLogDebugS(logTag, "(VideoMute ");
        CSFLogDebugS(logTag, "----------");
        CSFLogDebug(logTag, " %s )", (videoMute) ? "true" : "false");
        PRINT_OFFSET_1;
        printCallPartiesInfo(callInfoPtr);
        PRINT_OFFSET_1;
        CSFLogDebugS(logTag, "(CallCaps ");
        CSFLogDebugS(logTag, "----------");
        printCallCapabilities(callInfoPtr, WRAPPED_LINE_ALIGNMENT_OFFSET_2);

    }//end for (calls)
    CSFLogDebugS(logTag, "End of List");
}
开发者ID:AsherBond,项目名称:ikran,代码行数:59,代码来源:EventPrinter.cpp

示例5: getFirstCallInGivenStates

/**
  This function gets a snapshot of all calls and examines each one in turn. If it find a call whose
  state is one of the specified states then it returns that call.

  @param [in] ccmPtr -

  @param [in] callStates - A vector of the call states being checked for. All existing calls are examined and the
                          first (in no particular order) call that is in one of those states is returned,
                          if there is one.

  @return Returns a NULL_PTR if there are no calls in the given states. If a call is found in the given states
          then that CC_CallPtr is returned.
*/
static CC_CallPtr getFirstCallInGivenStates (CallControlManagerPtr ccmPtr, const vector<cc_call_state_t>& callStates)
{
	CSFLogDebugS(logTag, "getFirstCallInGivenStates()");

	if (ccmPtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    CC_DevicePtr devicePtr = ccmPtr->getActiveDevice();

    if (devicePtr == NULL)
    {
    	CSFLogDebugS(logTag, "devicePtr was NULL, returning");
        return NULL_PTR(CC_Call);
    }

    CC_DeviceInfoPtr deviceInfoPtr = devicePtr->getDeviceInfo();

    if (deviceInfoPtr == NULL)
    {
    	CSFLogDebugS(logTag, "deviceInfoPtr was NULL, returning");
        return NULL_PTR(CC_Call);
    }

    vector<CC_CallPtr> calls = deviceInfoPtr->getCalls();

    for (vector<CC_CallPtr>::iterator it = calls.begin(); it != calls.end(); it++)
    {
        CC_CallPtr call = *it;

        if (call == NULL)
        {
            continue;
        }

        CC_CallInfoPtr callInfoPtr = call->getCallInfo();

        if (callInfoPtr == NULL)
        {
            continue;
        }

        CSFLogDebugS(logTag, "about to check call for states");

        for (vector<cc_call_state_t>::const_iterator it = callStates.begin(); it != callStates.end(); it++)
        {
          	cc_call_state_t callState = *it;
            if (callInfoPtr->getCallState() == callState)
            {
                return call;
            }
        }
    }//end for (calls)

    return NULL_PTR(CC_Call);
}
开发者ID:kennych,项目名称:ikran,代码行数:70,代码来源:testapp.cpp

示例6: handleVideoAvailableChangeOnConnectedCall

static void handleVideoAvailableChangeOnConnectedCall(CallControlManagerPtr ccmPtr)
{
	vector<cc_call_state_t> permittedCallStates;
	permittedCallStates.push_back(CONNECTED);
	permittedCallStates.push_back(RINGOUT);
	permittedCallStates.push_back(OFFHOOK);
	CSFLogDebugS(logTag, "About to getFirstCallInGivenStates()");
	CC_CallPtr call = getFirstCallInGivenStates(ccmPtr, permittedCallStates);

    if (call != NULL)
    {
    	if(call->getCallInfo()->getVideoDirection() == CC_SDP_DIRECTION_INACTIVE)
    	{
    	    //A GUI client would hide the video window at this point
    		CSFLogDebugS(logTag, "Video now inactive.");
    	}
    	else if(call->getCallInfo()->getVideoDirection() == CC_SDP_DIRECTION_SENDRECV)
    	{
    		//A GUI client would (re)display the video window at this point
    		CSFLogDebugS(logTag, "Video now active in both directions.");
    	}
    	else if(call->getCallInfo()->getVideoDirection() == CC_SDP_DIRECTION_RECVONLY)
    	{
    		//A GUI client would (re)display the video window at this point
    		CSFLogDebugS(logTag, "Video now active in receive direction.");
    	}
    	else
    	{
    		//We're not supporting either send-only or video,
    		//we should never end up in this state.
    		CSFLogDebugS(logTag, "Video now in unsupported configuration.");
    	}
    }
    else
    {
    	CSFLogDebugS(logTag,"Notified of VideoAvailable change, but no connected call to apply it to.");
    }

}
开发者ID:kennych,项目名称:ikran,代码行数:39,代码来源:testapp.cpp

示例7: handleAddVideoToConnectedCall

static void handleAddVideoToConnectedCall( CallControlManagerPtr ccmPtr)
{
#ifndef NOVIDEO
    CC_CallPtr call = getFirstCallInGivenState(ccmPtr, CONNECTED);

    if(call != NULL)
    {
    	if(call->getCallInfo()->getVideoDirection() == CC_SDP_DIRECTION_SENDRECV)
    	{
    		CSFLogDebugS(logTag, "First connected call already has video.");
    	}
    	else
    	{
        	if(call->getCallInfo()->hasCapability(CC_CallCapabilityEnum::canUpdateVideoMediaCap))
        	{
				if(call->updateVideoMediaCap(CC_SDP_DIRECTION_SENDRECV))
				{
					call->setRemoteWindow((VideoWindowHandle)hVideoWindow);
					CSFLogDebugS(logTag, "Video added to first connected call.");
				}
				else
				{
					CSFLogDebugS(logTag, "Failed to add video to first connected call.");
				}
    		}
        	else
        	{
        		CSFLogDebugS(logTag, "Cannot add video to this call - capability not currently available.");
        	}
		}
    }
    else
    {
    	CSFLogDebugS(logTag, "No currently connected calls, cannot add video.");
    }
#endif
}
开发者ID:kennych,项目名称:ikran,代码行数:37,代码来源:testapp.cpp

示例8: getFirstCallInGivenState

/**
  This function gets a snapshot of all calls and examines each one in turn. If it find a call that is in
  the specified state then it returns this call.

  @param [in] ccmPtr - 

  @param [in] callState - This is the call state being checked for. All existing calls are examined and the
                          first (in no particular order) call that is in this state is returned, if there is one.
                    
  @return Returns a NULL_PTR if there are no calls in the given state. If a call is found in the given state
          then that CC_CallPtr is returned.
*/
static CC_CallPtr getFirstCallInGivenState (CallControlManagerPtr ccmPtr, cc_call_state_t callState)
{
    if (ccmPtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    CC_DevicePtr devicePtr = ccmPtr->getActiveDevice();

    if (devicePtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    CC_DeviceInfoPtr deviceInfoPtr = devicePtr->getDeviceInfo();

    if (deviceInfoPtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    vector<CC_CallPtr> calls = deviceInfoPtr->getCalls();

    for (vector<CC_CallPtr>::iterator it = calls.begin(); it != calls.end(); it++)
    {
        CC_CallPtr call = *it;

        if (call == NULL)
        {
            continue;
        }

        CC_CallInfoPtr callInfoPtr = call->getCallInfo();

        if (callInfoPtr == NULL)
        {
            continue;
        }

        if (callInfoPtr->getCallState() == callState)
        {
            return call;
        }
    }//end for (calls)

    return NULL_PTR(CC_Call);
}
开发者ID:kennych,项目名称:ikran,代码行数:59,代码来源:testapp.cpp

示例9: getFirstCallWithCapability

/**
  This function gets a snapshot of all calls and examines each one in turn. If it find a call that has the
  specified capability then it returns this call.

  @param [in] ccmPtr - 

  @param [in] cap - This is the capability being examined. All existing calls are examined and the first (in
                    no particular order) call that has this capability is returned, if there is one.
                    
  @return Returns a NULL_PTR if there are no calls with the given capability. If a call is found with the given
          capability then that CC_CallPtr is returned.
*/
static CC_CallPtr getFirstCallWithCapability (CallControlManagerPtr ccmPtr, CC_CallCapabilityEnum::CC_CallCapability cap)
{
    if (ccmPtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    CC_DevicePtr devicePtr = ccmPtr->getActiveDevice();

    if (devicePtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    CC_DeviceInfoPtr deviceInfoPtr = devicePtr->getDeviceInfo();

    if (deviceInfoPtr == NULL)
    {
        return NULL_PTR(CC_Call);
    }

    vector<CC_CallPtr> calls = deviceInfoPtr->getCalls();

    for (vector<CC_CallPtr>::iterator it = calls.begin(); it != calls.end(); it++)
    {
        CC_CallPtr call = *it;

        if (call == NULL)
        {
            continue;
        }

        CC_CallInfoPtr callInfoPtr = call->getCallInfo();

        if (callInfoPtr == NULL)
        {
            continue;
        }

        if (callInfoPtr->hasCapability(cap))
        {
            return call;
        }
    }//end for (calls)

    return NULL_PTR(CC_Call);
}
开发者ID:kennych,项目名称:ikran,代码行数:59,代码来源:testapp.cpp

示例10: handleUnmuteAudioForFirstConnectedCall

static void handleUnmuteAudioForFirstConnectedCall (CallControlManagerPtr ccmPtr)
{
    CC_CallPtr call = getFirstCallInGivenState(ccmPtr, CONNECTED);

    if (call != NULL)
    {
    	CSFLogDebugS(logTag, "Unmuting (audio) 1st connected call...");
    	if (!call->unmuteAudio())
    	{
    		CSFLogDebugS(logTag, "Attempt to unmute (audio) failed.");
    	}
        CC_CallInfoPtr info = call->getCallInfo();
        if (info->isAudioMuted())
        {
            // note that when CTI adds mute it might fail here, because the setAudioMute will not be a synchronous call
            // So we might change this check for CTI when that time comes.
        	CSFLogDebugS(logTag, "MUTE FAILED TO BE REFLECTED IN CALL INFO");
        }
    }
    else
    {
    	CSFLogDebugS(logTag, "No calls exist that can be unmuted (audio).");
    }
}
开发者ID:kennych,项目名称:ikran,代码行数:24,代码来源:testapp.cpp

示例11: handleAdjustVolume

// Volume change: If a RINGIN call exists, adjust ringer volume.
//                If CONNECTED exists, adjust current call volume.
//                Otherwise, adjust default call volume.
static void handleAdjustVolume (CallControlManagerPtr ccmPtr, int adjust)
{
    CC_CallPtr call = getFirstCallInGivenState(ccmPtr, RINGIN);
    if (call != NULL)
    {
    	CSFLogDebug(logTag, "Changing ringer volume %d...", adjust);
        int currentVolume = ccmPtr->getAudioControl()->getRingerVolume();
    	if (currentVolume == -1)
    	{
    		CSFLogDebugS(logTag, "Attempt to determine ringer volume failed.");
    	}
    	else
    	{
    		int newVolume = currentVolume + adjust;
    		newVolume = newVolume > 100 ? 100 : newVolume < 0 ? 0 : newVolume;
    		if(!ccmPtr->getAudioControl()->setRingerVolume(newVolume))
    		{
    			CSFLogDebugS(logTag, "Attempt to adjust ringer volume failed.");
    		}
    	}
    	return;
    }

    call = getFirstCallInGivenState(ccmPtr, CONNECTED);
    if (call != NULL)
    {
    	CSFLogDebug(logTag, "Changing call volume %d...", adjust);
        CC_CallInfoPtr info = call->getCallInfo();
        int currentVolume = info->getVolume();
    	if (currentVolume == -1)
    	{
    		CSFLogDebugS(logTag, "Attempt to determine call volume failed.");
    	}
    	else
    	{
    		int newVolume = currentVolume + adjust;
    		newVolume = newVolume > 100 ? 100 : newVolume < 0 ? 0 : newVolume;
    		if(!call->setVolume(newVolume))
    		{
    			CSFLogDebugS(logTag, "Attempt to adjust call volume failed.");
    		}
    	}
    	return;
    }

    CSFLogDebug(logTag, "Changing default call volume %d...", adjust);
	int currentVolume = ccmPtr->getAudioControl()->getDefaultVolume();
	if (currentVolume == -1)
	{
		CSFLogDebugS(logTag, "Attempt to determine default call volume failed.");
	}
	else
	{
		int newVolume = currentVolume + adjust;
		newVolume = newVolume > 100 ? 100 : newVolume < 0 ? 0 : newVolume;
		if(!ccmPtr->getAudioControl()->setDefaultVolume(newVolume))
		{
			CSFLogDebugS(logTag, "Attempt to adjust default call volume failed.");
		}
	}
}
开发者ID:kennych,项目名称:ikran,代码行数:64,代码来源:testapp.cpp


注:本文中的CC_CallPtr::getCallInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。